summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2020-10-28 21:57:19 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2020-10-28 22:03:19 -0700
commit06d012cc3dacb4a2c7ac2e28553c96965f9ddea9 (patch)
treef7ac4c49a067cf17b4302b6b3283c7430e28a2e8 /sys-apps
parentdev-lang/go: Stabilize 1.15.3 arm, #751061 (diff)
downloadgentoo-06d012cc3dacb4a2c7ac2e28553c96965f9ddea9.tar.gz
gentoo-06d012cc3dacb4a2c7ac2e28553c96965f9ddea9.tar.bz2
gentoo-06d012cc3dacb4a2c7ac2e28553c96965f9ddea9.zip
sys-apps/systemd-tmpfiles: new package
Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/systemd-tmpfiles/Manifest1
-rw-r--r--sys-apps/systemd-tmpfiles/files/stmpfiles-dev.confd2
-rw-r--r--sys-apps/systemd-tmpfiles/files/stmpfiles-dev.initd20
-rw-r--r--sys-apps/systemd-tmpfiles/files/stmpfiles-setup.confd2
-rw-r--r--sys-apps/systemd-tmpfiles/files/stmpfiles-setup.initd19
-rw-r--r--sys-apps/systemd-tmpfiles/metadata.xml8
-rw-r--r--sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild173
7 files changed, 225 insertions, 0 deletions
diff --git a/sys-apps/systemd-tmpfiles/Manifest b/sys-apps/systemd-tmpfiles/Manifest
new file mode 100644
index 000000000000..0e7a4c8589dd
--- /dev/null
+++ b/sys-apps/systemd-tmpfiles/Manifest
@@ -0,0 +1 @@
+DIST systemd-246.tar.gz 9534036 BLAKE2B 71b72abcd4d066d35d45d9835d41bec8faa9a7eddc80b48fe7073223f07d32f78a8442c52dc0800940f9750d9c5502123a633738981d797cf610d85df2035bf0 SHA512 7103f7da53f7ced3b5543c238f23bd11c82af8e37166c1720a90576b6b431b4329320c78726166c65a9f5e101dd465c0a86dd13c586c4e55e608a6273d8f324f
diff --git a/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.confd b/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.confd
new file mode 100644
index 000000000000..2ec4b5f0d8b8
--- /dev/null
+++ b/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.confd
@@ -0,0 +1,2 @@
+# Extra options to pass to stmpfiles
+#stmpfiles_opts=""
diff --git a/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.initd b/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.initd
new file mode 100644
index 000000000000..0952ef12cc2c
--- /dev/null
+++ b/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.initd
@@ -0,0 +1,20 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Released under the 2-clause BSD license.
+
+description="Set up tmpfiles.d entries for /dev"
+
+depend()
+{
+ provide stmpfiles-dev stmpfiles.dev tmpfiles-dev tmpfiles.dev
+ use dev-mount
+ before dev
+ keyword -prefix -vserver
+}
+
+start()
+{
+ ebegin "Setting up tmpfiles.d entries for /dev"
+ /bin/systemd-tmpfiles --prefix=/dev --create --boot ${stmpfiles_opts}
+ eend $?
+}
diff --git a/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.confd b/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.confd
new file mode 100644
index 000000000000..2ec4b5f0d8b8
--- /dev/null
+++ b/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.confd
@@ -0,0 +1,2 @@
+# Extra options to pass to stmpfiles
+#stmpfiles_opts=""
diff --git a/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.initd b/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.initd
new file mode 100644
index 000000000000..a55163d3fd65
--- /dev/null
+++ b/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Released under the 2-clause BSD license.
+
+description="Set up tmpfiles.d entries"
+
+depend()
+{
+ provide stmpfiles-setup stmpfiles.setup tmpfiles-setup tmpfiles.setup
+ need localmount
+}
+
+start()
+{
+ ebegin "Setting up tmpfiles.d entries"
+ /bin/systemd-tmpfiles --exclude-prefix=/dev --create --remove --boot \
+ ${stmpfiles_opts}
+ eend $?
+}
diff --git a/sys-apps/systemd-tmpfiles/metadata.xml b/sys-apps/systemd-tmpfiles/metadata.xml
new file mode 100644
index 000000000000..efcd58fe0b9b
--- /dev/null
+++ b/sys-apps/systemd-tmpfiles/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gyakovlev@gentoo.org</email>
+ <name>Georgy Yakovlev</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild b/sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild
new file mode 100644
index 000000000000..5b99c6958bc7
--- /dev/null
+++ b/sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild
@@ -0,0 +1,173 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MINKV="3.11"
+inherit meson
+
+DESCRIPTION="Creates, deletes and cleans up volatile and temporary files and directories"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz"
+
+LICENSE="BSD-2 GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0"
+KEYWORDS=""
+
+DEPEND="
+ >=sys-kernel/linux-headers-${MINKV}
+ sys-apps/acl:0=
+ >=sys-apps/util-linux-2.30:0=
+ sys-libs/libcap:0=
+"
+RDEPEND="${DEPEND}
+ !sys-apps/opentmpfiles
+ !sys-apps/systemd
+"
+
+S="${WORKDIR}/systemd-${PV}"
+
+src_configure() {
+ # disable everything until configure says "enabled features: ACL, tmpfiles"
+ local systemd_disable_options=(
+ adm-group
+ analyze
+ apparmor
+ audit
+ backlight
+ binfmt
+ blkid
+ bzip2
+ coredump
+ dbus
+ efi
+ elfutils
+ environment-d
+ fdisk
+ gcrypt
+ glib
+ gshadow
+ gnutls
+ hibernate
+ hostnamed
+ hwdb
+ idn
+ ima
+ initrd
+ firstboot
+ kernel-install
+ kmod
+ ldconfig
+ libcryptsetup
+ libcurl
+ libfido2
+ libidn
+ libidn2
+ libiptc
+ link-networkd-shared
+ link-systemctl-shared
+ link-timesyncd-shared
+ link-udev-shared
+ localed
+ logind
+ lz4
+ machined
+ microhttpd
+ networkd
+ nss-myhostname
+ nss-resolve
+ nss-systemd
+ openssl
+ p11kit
+ pam
+ pcre2
+ polkit
+ portabled
+ pstore
+ pwquality
+ randomseed
+ resolve
+ rfkill
+ seccomp
+ selinux
+ smack
+ sysusers
+ timedated
+ timesyncd
+ tpm
+ qrencode
+ quotacheck
+ userdb
+ utmp
+ vconsole
+ wheel-group
+ xdg-autostart
+ xkbcommon
+ xz
+ zlib
+ zstd
+ )
+
+ # prepend -D and append =false, e.g. zstd becomes -Dzstd=false
+ systemd_disable_options=( ${systemd_disable_options[@]/#/-D} )
+ systemd_disable_options=( ${systemd_disable_options[@]/%/=false} )
+
+ local emesonargs=(
+ -Dtmpfiles=true
+ -Dacl=true
+ -Dstandalone-binaries=true # this and below option does the magic
+ -Dstatic-libsystemd=true
+ -Dsysvinit-path=''
+ ${systemd_disable_options[@]}
+ )
+ meson_src_configure
+}
+
+src_compile() {
+ # tmpfiles and sysusers can be built as standalone, link systemd-shared in statically.
+ # https://github.com/systemd/systemd/pull/16061 original implementation
+ # we just need to pass -Dstandalone-binaries=true and
+ # use <name>.standalone target below.
+ # check meson.build for if have_standalone_binaries condition per target.
+ local mytargets=(
+ systemd-tmpfiles.standalone
+ man/tmpfiles.d.5
+ man/systemd-tmpfiles.8
+ )
+ meson_src_compile "${mytargets[@]}"
+}
+
+src_install() {
+ # lean and mean installation, single binary and man-pages
+ pushd "${BUILD_DIR}" > /dev/null || die
+ into /
+ newbin systemd-tmpfiles.standalone systemd-tmpfiles
+
+ doman man/{systemd-tmpfiles.8,tmpfiles.d.5}
+
+ popd > /dev/null || die
+
+ # service files adapter from opentmpfiles
+ newinitd "${FILESDIR}"/stmpfiles-dev.initd stmpfiles-dev
+ newinitd "${FILESDIR}"/stmpfiles-setup.initd stmpfiles-setup
+
+ newconfd "${FILESDIR}"/stmpfiles-dev.confd stmpfiles-dev
+ newconfd "${FILESDIR}"/stmpfiles-setup.confd stmpfiles-setup
+}
+
+# adapted from opentmpfiles ebuild
+add_service() {
+ local initd=$1
+ local runlevel=$2
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ mkdir -p "${EROOT}/etc/runlevels/${runlevel}"
+ ln -snf "${EROOT}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}"
+}
+
+pkg_postinst() {
+ if [[ -z $REPLACING_VERSIONS ]]; then
+ add_service stmpfiles-dev sysinit
+ add_service stmpfiles-setup boot
+ fi
+}