diff options
author | Georgy Yakovlev <gyakovlev@gentoo.org> | 2020-10-28 21:57:19 -0700 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2020-10-28 22:03:19 -0700 |
commit | 06d012cc3dacb4a2c7ac2e28553c96965f9ddea9 (patch) | |
tree | f7ac4c49a067cf17b4302b6b3283c7430e28a2e8 /sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild | |
parent | dev-lang/go: Stabilize 1.15.3 arm, #751061 (diff) | |
download | gentoo-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/systemd-tmpfiles/systemd-tmpfiles-246.ebuild')
-rw-r--r-- | sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild | 173 |
1 files changed, 173 insertions, 0 deletions
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 +} |