diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2012-03-11 19:57:20 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2012-03-11 19:58:55 +0800 |
commit | a01e8ec27f7dcede68555649d0175adb772b7803 (patch) | |
tree | 7941ee504b490c454c8fc8a49457467df555cf06 | |
parent | 75f410718b63563e64e28525f42cde50bc8a6737 (diff) |
Sync the systemd ebuild with portage
7 files changed, 139 insertions, 95 deletions
diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest index c1bd211..d549c04 100644 --- a/sys-apps/systemd/Manifest +++ b/sys-apps/systemd/Manifest @@ -1,7 +1,10 @@ -AUX 0001-Revert-Revert-Revert-fsck-add-new-l-switch-to-fsck-m.patch 1045 RMD160 f080497a39fb8d9c4a1afe46066bdba248373a72 SHA1 dfc7df7b5667a8cace130273e4137dd783966080 SHA256 55ac7ebe6f241261bd72e4d6c6eae1c8b7883cca2ef5c2d18ea7da6addbdba18 AUX 0002-never-umount-lib-rc-init.d.patch 803 RMD160 6e62d9631496984ff8b7c8938e279f1f43439ce8 SHA1 5a377c49813fb390022cde987acbbf528b7a3f55 SHA256 eccc3ba9ea0172bf6a7eae8ad9b823275b3e7a319a1688f22a452f649ba8c310 AUX 0003-Revert-logind-use-new-udev_enumerate_add_match_paren.patch 1893 RMD160 05c4dc35aea2b109fabe2fe8873107e31c5ac488 SHA1 bf881e6c3ba08d7ab70e3c88ea35ffacbe36bc0f SHA256 5160e982bb4da3b7a016ff4776d356c77e9ee9f9ea7ce57041cb428fd84e738c AUX 0004-Revert-loginctl-use-new-udev_device_has_tag-call-fro.patch 3788 RMD160 33ff6f15a9eeecd644848260ccb3847be5f070f9 SHA1 0a9852ea5a4b04407b6537c0ac4c975677aebb9f SHA256 b7ed863ff9675b680ab333c1b808365e63b10629b503045c0b9dd9f68cfd97af -EBUILD systemd-9999.ebuild 3878 RMD160 dcd04ebe13215e0ffe806298015e05fe26fe5cf3 SHA1 d69edbc8d4b65df2b46f48e35245fd4c99d09675 SHA256 225e0095efcbb83b929a6baf598aee56d4d618267ed2738aa41e8484eada493a +AUX gentoo-run.conf 226 RMD160 3bea7b3d3fe3b3589d8bfdeaf52112ab46a67e82 SHA1 521d0d3ff408905075f42b3b00ccc77da2355c6a SHA256 a23fa3b35b4e9d5f1c41dc77cb5be1cec492eb903a57472df3d93a053db28ca7 +AUX update-etc-systemd-symlinks.path 119 RMD160 b2512605a2313af9fca6b611a32b66e2c435577a SHA1 70ddad85c6981b9a0a81f1d0f84f4b039951c543 SHA256 4dbbe99fdc4b7922ad6fb4c6f39c975a4b139e04b04a65e3c79650b364fdc02a +AUX update-etc-systemd-symlinks.service 165 RMD160 aab6eb2ff82ae82be72c12682fda2bc62d7b2e51 SHA1 6a766b8ef0a97290431756c8bbabf242447c632e SHA256 77f199392367cefc6d70110b955fb5f2ebafaf21ea8ca355b1863a44f130bf69 +AUX update-etc-systemd-symlinks.sh 451 RMD160 94066bbc526f108e2a3a49ad3b8dc52eb1ed4ad7 SHA1 9ad3fa9e5bef1b7d10a54101ddedb299d0f875a7 SHA256 1ed27cf8c2ca5ab862b9d935eec613d1a21ceb4cc363a4bfdac6430387e350df +EBUILD systemd-9999.ebuild 5148 RMD160 c6190c2b3ac741787970c0f566a0fdddaa2983cf SHA1 c3314b2d8690ba71c8a329214af8f9c7f5d1a0e7 SHA256 61e5e87147ad5285f0c2bc8b067674d28d57c4484824621a84a53a2bb08b80d8 MISC ChangeLog 1624 RMD160 94503486a7be92493a8afa8fc72337b19dd3cfa9 SHA1 2adf0d3ef152ceaf342d598c138fd86a20f6e0f5 SHA256 aebdc6e74d77a5f172ed5ea77fde1dbfa2a48f0da04a8654bc7b862b44bfd9c7 MISC metadata.xml 524 RMD160 d51fb3f45aefd84a637f2f67cead553e12d389ab SHA1 4f86cab283737af9e58633d466e2588d80bec18c SHA256 0ee1c96fc4604189104897c95e2ded166e55be2e04af40523b2afb5564dbbe33 diff --git a/sys-apps/systemd/files/0001-Revert-Revert-Revert-fsck-add-new-l-switch-to-fsck-m.patch b/sys-apps/systemd/files/0001-Revert-Revert-Revert-fsck-add-new-l-switch-to-fsck-m.patch deleted file mode 100644 index da961c0..0000000 --- a/sys-apps/systemd/files/0001-Revert-Revert-Revert-fsck-add-new-l-switch-to-fsck-m.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 48b2521b1894e09248a6e099c0cb1783015f66a8 Mon Sep 17 00:00:00 2001 -From: Henry Gebhardt <hsggebhardt@googlemail.com> -Date: Thu, 25 Nov 2010 22:58:43 +0100 -Subject: [PATCH] Revert "Revert "Revert "fsck: add new -l switch to fsck mount options""" - -This reverts commit e9ecea880571e520c60fae2dd2f10fcfd7dd1ab8. - -Needs development version of util-linux. ---- - src/fsck.c | 3 +-- - 1 files changed, 1 insertions(+), 2 deletions(-) - -diff --git a/src/fsck.c b/src/fsck.c -index fdcf6b4..dfaf221 100644 ---- a/src/fsck.c -+++ b/src/fsck.c -@@ -142,7 +142,7 @@ static void test_files(void) { - } - - int main(int argc, char *argv[]) { -- const char *cmdline[8]; -+ const char *cmdline[7]; - int i = 0, r = EXIT_FAILURE, q; - pid_t pid; - siginfo_t status; -@@ -213,7 +213,6 @@ int main(int argc, char *argv[]) { - cmdline[i++] = "/sbin/fsck"; - cmdline[i++] = "-a"; - cmdline[i++] = "-T"; -- cmdline[i++] = "-l"; - - if (!root_directory) - cmdline[i++] = "-M"; --- -1.7.3.2 - diff --git a/sys-apps/systemd/files/gentoo-run.conf b/sys-apps/systemd/files/gentoo-run.conf new file mode 100644 index 0000000..5b3bcab --- /dev/null +++ b/sys-apps/systemd/files/gentoo-run.conf @@ -0,0 +1,5 @@ +# New OpenRC versions replace /var/lock with a symlink to /run/lock. +# We just create that directory for now, just in case. +# Of course, it's not guaranteed that'll satisfy all relevant packages. + +d /run/lock 0755 root root - diff --git a/sys-apps/systemd/files/update-etc-systemd-symlinks.path b/sys-apps/systemd/files/update-etc-systemd-symlinks.path new file mode 100644 index 0000000..33a9576 --- /dev/null +++ b/sys-apps/systemd/files/update-etc-systemd-symlinks.path @@ -0,0 +1,5 @@ +[Unit] +Description=Update /etc/systemd/system symlinks for units moved to /usr + +[Path] +PathChanged=/lib/systemd/system diff --git a/sys-apps/systemd/files/update-etc-systemd-symlinks.service b/sys-apps/systemd/files/update-etc-systemd-symlinks.service new file mode 100644 index 0000000..c05a194 --- /dev/null +++ b/sys-apps/systemd/files/update-etc-systemd-symlinks.service @@ -0,0 +1,6 @@ +[Unit] +Description=Update /etc/systemd/system symlinks for units moved to /usr + +[Service] +Type=oneshot +ExecStart=/usr/libexec/systemd/update-etc-systemd-symlinks.sh diff --git a/sys-apps/systemd/files/update-etc-systemd-symlinks.sh b/sys-apps/systemd/files/update-etc-systemd-symlinks.sh new file mode 100755 index 0000000..ce81bba --- /dev/null +++ b/sys-apps/systemd/files/update-etc-systemd-symlinks.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Update symlinks to systemd units moved into /usr/systemd. +# (c) 2012 Michał Górny +# Released under the terms of the 2-clause BSD license + +IFS_SAVE=${IFS} +IFS=' +' +# follow + symlink type will match broken symlinks only +set -- $(find -L /etc/systemd/system -type l -print) +IFS=${IFS_SAVE} + +for f; do + old_path=$(readlink "${f}") + new_path=/usr/lib${old_path#/lib} + if [ -f "${new_path}" ]; then + ln -v -s -f "${new_path}" "${f}" + fi +done diff --git a/sys-apps/systemd/systemd-9999.ebuild b/sys-apps/systemd/systemd-9999.ebuild index b160ac8..9328c2f 100644 --- a/sys-apps/systemd/systemd-9999.ebuild +++ b/sys-apps/systemd/systemd-9999.ebuild @@ -4,10 +4,10 @@ EAPI=4 -inherit autotools bash-completion linux-info pam systemd git +inherit autotools bash-completion-r1 linux-info pam systemd git-2 EGIT_BRANCH="master" -EGIT_REPO_URI="git://anongit.freedesktop.org/systemd" +EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd" DESCRIPTION="System and service manager for Linux" HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd" @@ -16,46 +16,46 @@ SRC_URI="" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="audit cryptsetup gtk pam plymouth selinux tcpd" +IUSE="acl audit cryptsetup gtk lzma pam plymouth selinux tcpd" -COMMON_DEPEND=">=sys-apps/dbus-1.4.10 - >=sys-fs/udev-171 +# Vala-0.10 doesn't work with libnotify 0.7.1 +VALASLOT="0.14" +# A little higher than upstream requires +# but I had real trouble with 2.6.37 and systemd. +MINKV="2.6.38" + +# dbus version because of systemd units +# sysvinit for sulogin +RDEPEND=">=sys-apps/dbus-1.4.10 + >=sys-apps/kmod-5 + sys-apps/sysvinit >=sys-apps/util-linux-2.19 + >=sys-fs/udev-172 sys-libs/libcap + acl? ( sys-apps/acl ) audit? ( >=sys-process/audit-2 ) cryptsetup? ( sys-fs/cryptsetup ) gtk? ( dev-libs/dbus-glib >=dev-libs/glib-2.26 + dev-libs/libgee:0 x11-libs/gtk+:2 >=x11-libs/libnotify-0.7 ) + lzma? ( app-arch/xz-utils ) pam? ( virtual/pam ) plymouth? ( sys-boot/plymouth ) selinux? ( sys-libs/libselinux ) tcpd? ( sys-apps/tcp-wrappers )" -# Vala-0.10 doesn't work with libnotify 0.7.1 -VALASLOT="0.12" -# A little higher than upstream requires -# but I had real trouble with 2.6.37 and systemd. -MINKV="2.6.38" - -# dbus, udev versions because of systemd units -# blocker on old packages to avoid collisions with above -# openrc blocker to avoid udev rules starting openrc scripts -RDEPEND="${COMMON_DEPEND} - !!sys-apps/systemd-dbus - !!sys-apps/systemd-udev - !<sys-apps/openrc-0.8.3" -DEPEND="${COMMON_DEPEND} +DEPEND="${RDEPEND} + app-arch/xz-utils + dev-util/gperf + dev-util/intltool gtk? ( dev-lang/vala:${VALASLOT} ) >=sys-kernel/linux-headers-${MINKV}" -pkg_pretend() { - local CONFIG_CHECK="AUTOFS4_FS CGROUPS DEVTMPFS ~FANOTIFY ~IPV6" - linux-info_pkg_setup - kernel_is -ge ${MINKV//./ } || die "Kernel version at least ${MINKV} required" -} +# Due to vala being broken. +AUTOTOOLS_IN_SOURCE_BUILD=1 pkg_setup() { enewgroup lock # used by var-lock.mount @@ -63,61 +63,85 @@ pkg_setup() { } src_prepare() { - git_src_prepare # Force the rebuild of .vala sources #touch src/*.vala || die - epatch "${FILESDIR}"/*.patch + #epatch "${FILESDIR}"/*.patch eautoreconf intltoolize -c -f } src_configure() { + local myeconfargs=( + --with-distro=gentoo + # install everything to /usr + --with-rootprefix=/usr + --with-rootlibdir=/usr/$(get_libdir) + # but pam modules have to lie in /lib* + --with-pamlibdir=/$(get_libdir)/security + --localstatedir=/var + # make sure we get /bin:/sbin in $PATH + --enable-split-usr + $(use_enable acl) + $(use_enable audit) + $(use_enable cryptsetup libcryptsetup) + $(use_enable gtk) + $(use_enable lzma xz) + $(use_enable pam) + $(use_enable plymouth) + $(use_enable selinux) + $(use_enable tcpd tcpwrap) + ) + if use gtk; then export VALAC="$(type -p valac-${VALASLOT})" fi - econf --with-distro=gentoo \ - --with-rootdir= \ - --localstatedir=/var \ - --docdir=/tmp/docs \ - $(use_enable audit) \ - $(use_enable cryptsetup libcryptsetup) \ - $(use_enable gtk) \ - $(use_enable pam) \ - $(use_enable selinux) \ - $(use_enable tcpd tcpwrap) \ - - # right now it is enabled on per-distro basis - # let's just hack into the check - $(use plymouth && echo have_plymouth=true) + + econf "${myeconfargs[@]}" } src_install() { emake DESTDIR="${D}" bashcompletiondir=/tmp install - # move files as necessary - dobashcompletion "${D}"/tmp/systemctl-bash-completion.sh - dodoc "${D}"/tmp/docs/* - rm -rf "${D}"/tmp || die - - cd "${D}"/usr/share/man/man8/ - for i in halt poweroff reboot runlevel shutdown telinit; do - mv ${i}.8 systemd.${i}.8 || die - done + # compat for init= use + dosym ../usr/lib/systemd/systemd /bin/systemd + dosym ../lib/systemd/systemd /usr/bin/systemd + # rsyslog.service depends on it... + dosym ../usr/bin/systemctl /bin/systemctl - if ! use selinux; then - rm "${D}"/lib/systemd/system/sysinit.target.wants/sys-kernel-security.automount - fi + # move files as necessary + newbashcomp "${D}"/tmp/systemd-bash-completion.sh ${PN} + rm -r "${D}"/tmp || die + + # we just keep sysvinit tools, so no need for the mans + rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ + || die + rm "${D}"/usr/share/man/man1/init.1 || die + + # Create /run/lock as required by new baselay/OpenRC compat. + insinto /usr/lib/tmpfiles.d + doins "${FILESDIR}"/gentoo-run.conf + + # Migration helpers. + exeinto /usr/libexec/systemd + doexe "${FILESDIR}"/update-etc-systemd-symlinks.sh + systemd_dounit "${FILESDIR}"/update-etc-systemd-symlinks.{service,path} + systemd_enable_service sysinit.target update-etc-systemd-symlinks.path +} - # Drop the .pc file to avoid automagic depends. - # This a temporary workaround for gx86 packages. - rm -f "${D}"/usr/share/pkgconfig/systemd.pc || die +pkg_preinst() { + local CONFIG_CHECK="~AUTOFS4_FS ~CGROUPS ~DEVTMPFS ~FANOTIFY ~IPV6" + kernel_is -ge ${MINKV//./ } || ewarn "Kernel version at least ${MINKV} required" + check_extra_config +} - keepdir /run +optfeature() { + elog " [\e[1m$(has_version ${1} && echo I || echo ' ')\e[0m] ${1} (${2})" } pkg_postinst() { - if [[ ! -L "${ROOT}"etc/mtab ]]; then + mkdir -p "${ROOT}"/run || ewarn "Unable to mkdir /run, this could mean trouble." + if [[ ! -L "${ROOT}"/etc/mtab ]]; then ewarn "Upstream suggests that the /etc/mtab file should be a symlink to /proc/mounts." ewarn "It is known to cause users being unable to unmount user mounts. If you don't" ewarn "require that specific feature, please call:" @@ -131,9 +155,27 @@ pkg_postinst() { elog " $ man tmpfiles.d" elog + elog "To get additional features, a number of optional runtime dependencies may" + elog "be installed:" + optfeature 'dev-python/dbus-python' 'for systemd-analyze' + optfeature 'dev-python/pycairo[svg]' 'for systemd-analyze plotting ability' + elog + ewarn "Please note this is a work-in-progress and many packages in Gentoo" ewarn "do not supply systemd unit files yet. You are testing it on your own" ewarn "responsibility. Please remember than you can pass:" ewarn " init=/sbin/init" ewarn "to your kernel to boot using sysvinit / OpenRC." + + # Don't run it if we're outta / + if [[ ! ${ROOT%/} ]]; then + # Update symlinks to moved units. + sh "${FILESDIR}"/update-etc-systemd-symlinks.sh + + # Try to start migration unit. + ebegin "Trying to start migration helper path monitoring." + systemctl --system start update-etc-systemd-symlinks.path 2>/dev/null + eend ${?} + fi } + |