From c04ae0a13af7e87051b4b756ae8658fc0b706c4c Mon Sep 17 00:00:00 2001 From: Jory Pratt Date: Thu, 11 Apr 2019 15:43:42 -0500 Subject: dev-util/utmps: Initial work to support utmp/wtmp on musl Signed-off-by: Jory Pratt --- dev-util/utmps/Manifest | 4 +++ dev-util/utmps/files/init.d.utmpd | 24 ++++++++++++++ dev-util/utmps/files/init.d.wtmpd | 24 ++++++++++++++ dev-util/utmps/utmps-0.0.2.1.ebuild | 62 +++++++++++++++++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 dev-util/utmps/Manifest create mode 100755 dev-util/utmps/files/init.d.utmpd create mode 100755 dev-util/utmps/files/init.d.wtmpd create mode 100644 dev-util/utmps/utmps-0.0.2.1.ebuild diff --git a/dev-util/utmps/Manifest b/dev-util/utmps/Manifest new file mode 100644 index 0000000..e296d10 --- /dev/null +++ b/dev-util/utmps/Manifest @@ -0,0 +1,4 @@ +AUX init.d.utmpd 837 BLAKE2B b74ca1ef40392a4ab64624fbd684841939b0903c55c2bc353bb1e54c79454688d32c3edcdbe5e102e8bc69540c2e2a456c34454b2c2e6effb7872032e867c6c2 SHA512 3f7f0e49d570a896e22a9d266be08bbf61fecb4378693112ce56a4a1c0eceab2425baa38eeff646fd543c13b2d0114b7b80e25a36c6ae5ea6e2668cd3d7d3071 +AUX init.d.wtmpd 837 BLAKE2B 749fbc4534c1eedbd87714fd5f6d2ea3635e4d464b7ab5f11f6d3b0da0a029cd947b8e9e184e0fc3a5ac2c68636610a02d8e7b66a0f531c102262e1d59e00b10 SHA512 0d894892885c609074986e6b2e1253169333b166edb5240769977155cdb25943a939645ddd18d7774feb17e39a1c72919eb5689c40ced9fadfb22ca20f7540b0 +DIST utmps-0.0.2.1.tar.gz 24791 BLAKE2B fcd77d40cb9d0e5c6de45f222b1491d8712ef6303cc4f093a251b51f239255fcd3ccc327ff82dcae2a7ab851adebb199ed8e6202e43a8f4e2dff1f1e6cd08cc0 SHA512 e0ead9dc4085ce778f22831eec0f79ad251c6f5cb83afa6e52a9ab47a4a0037695e70c2ff0624da8b406a8e3c79f0c8653600bc541fad90c4e21d241c53c27aa +EBUILD utmps-0.0.2.1.ebuild 1535 BLAKE2B a4010e4b69377696a4cb0e22ea2a7b5e71f88299972811396cc641a4c9eddc1516fe9a6c27ed97a9c7bfd37efffea6358f107bef1bf2a7f65127453a5bff2eef SHA512 f087936941ad5dd36bec5f28d5fedccaf2ad4b082c8e5e65a8fd6b32dd1d58d13f4a1900181cfe311e3cbfe88d13ad50bc5daba3587bf43498b471b3b6449da7 diff --git a/dev-util/utmps/files/init.d.utmpd b/dev-util/utmps/files/init.d.utmpd new file mode 100755 index 0000000..e4ba852 --- /dev/null +++ b/dev-util/utmps/files/init.d.utmpd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright (c) 2007-2015 The OpenRC Authors. +# See the Authors file at the top-level directory of this distribution and +# https://github.com/OpenRC/openrc/blob/master/AUTHORS +# +# This file is part of OpenRC. It is subject to the license terms in +# the LICENSE file found in the top-level directory of this +# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE +# This file may not be copied, modified, propagated, or distributed +# except according to the terms contained in the LICENSE file. + +description="start the secure utmpd" + +name="utmpd" +command="s6-ipcserver" +command_args="/run/utmps/utmpd-socket utmps-utmpd" +command_background=yes +command_user=utmp +pidfile="/run/utmps/utmpd.pid" +start_stop_daemon_args="-d /run/utmps" + +start_pre() { + checkpath -D -d -o utmp:utmp -m 0755 /run/utmps +} diff --git a/dev-util/utmps/files/init.d.wtmpd b/dev-util/utmps/files/init.d.wtmpd new file mode 100755 index 0000000..3126e0d --- /dev/null +++ b/dev-util/utmps/files/init.d.wtmpd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright (c) 2007-2015 The OpenRC Authors. +# See the Authors file at the top-level directory of this distribution and +# https://github.com/OpenRC/openrc/blob/master/AUTHORS +# +# This file is part of OpenRC. It is subject to the license terms in +# the LICENSE file found in the top-level directory of this +# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE +# This file may not be copied, modified, propagated, or distributed +# except according to the terms contained in the LICENSE file. + +description="start the secure wtmpd" + +name="wtmpd" +command="s6-ipcserver" +command_args="/run/utmps/wtmpd-socket utmps-wtmpd" +command_background=yes +command_user=utmp +pidfile="/run/utmps/wtmpd.pid" +start_stop_daemon_args="-d /run/utmps" + +start_pre() { + checkpath -D -d -o utmp:utmp -m 0755 /run/utmps +} diff --git a/dev-util/utmps/utmps-0.0.2.1.ebuild b/dev-util/utmps/utmps-0.0.2.1.ebuild new file mode 100644 index 0000000..ab068ed --- /dev/null +++ b/dev-util/utmps/utmps-0.0.2.1.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit user + +DESCRIPTION="skarnet.org implementation of the utmpx.h family of functions" +HOMEPAGE="https://www.skarnet.org/software/${PN}/" +SRC_URI="https://www.skarnet.org/software/${PN}/${P}.tar.gz" + +LICENSE="ISC" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="static static-libs" + +REQUIRED_USE="static? ( static-libs )" + +DEPEND=">=dev-libs/skalibs-2.8.0.0[static-libs?]" + +RDEPEND="!static? ( >=dev-libs/skalibs-2.8.0.0:= )" + +DOCS="AUTHORS README*" +HTML_DOCS="doc/*" + +pkg_setup() { + # Make sure utmp group exists, as it's used later on. + enewgroup utmp 406 + enewuser utmp -1 -1 /dev/null utmp +} + +src_prepare() { + default + + # Remove QA warning about LDFLAGS addition + sed -i "s/tryldflag LDFLAGS_AUTO -Wl,--hash-style=both/:/" "${S}/configure" || die + + # configure overrides gentoo's -fstack-protector default + sed -i "/^tryflag CFLAGS -fno-stack-protector$/d" "${S}/configure" || die +} + +src_configure() { + econf \ + --bindir=/bin \ + --dynlibdir=/$(get_libdir) \ + --libdir=/usr/$(get_libdir)/${PN} \ + --with-dynlib=/$(get_libdir) \ + --with-lib=/usr/$(get_libdir)/execline \ + --with-lib=/usr/$(get_libdir)/skalibs \ + --with-sysdeps=/usr/$(get_libdir)/skalibs \ + --enable-shared \ + $(use_enable static allstatic) \ + $(use_enable static static-libc) \ + $(use_enable static-libs static) +} + +src_install() { + default + + newinitd "${FILESDIR}/init.d.utmpd" utmpd + newinitd "${FILESDIR}/init.d.wtmpd" wtmpd +} \ No newline at end of file -- cgit v1.2.3