| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-189.ebuild,v 1.3 2012/08/28 16:53:42 zmedico Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit autotools-utils bash-completion-r1 linux-info pam systemd user
|
| 8 |
|
| 9 |
DESCRIPTION="System and service manager for Linux"
|
| 10 |
HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
|
| 11 |
SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
|
| 12 |
|
| 13 |
LICENSE="GPL-2 LGPL-2.1 MIT"
|
| 14 |
SLOT="0"
|
| 15 |
KEYWORDS="~amd64 ~arm ~x86"
|
| 16 |
IUSE="acl audit cryptsetup gcrypt lzma pam qrcode selinux tcpd"
|
| 17 |
|
| 18 |
# We need to depend on sysvinit for sulogin which is used in the rescue
|
| 19 |
# mode. Bug #399615.
|
| 20 |
|
| 21 |
MINKV="2.6.39"
|
| 22 |
|
| 23 |
COMMON_DEPEND=">=sys-apps/dbus-1.4.10
|
| 24 |
>=sys-apps/kmod-5
|
| 25 |
>=sys-apps/util-linux-2.20
|
| 26 |
~sys-fs/udev-189
|
| 27 |
sys-libs/libcap
|
| 28 |
acl? ( sys-apps/acl )
|
| 29 |
audit? ( >=sys-process/audit-2 )
|
| 30 |
cryptsetup? ( >=sys-fs/cryptsetup-1.4.2 )
|
| 31 |
gcrypt? ( >=dev-libs/libgcrypt-1.4.5 )
|
| 32 |
lzma? ( app-arch/xz-utils )
|
| 33 |
pam? ( virtual/pam )
|
| 34 |
qrcode? ( media-gfx/qrencode )
|
| 35 |
selinux? ( sys-libs/libselinux )
|
| 36 |
tcpd? ( sys-apps/tcp-wrappers )"
|
| 37 |
|
| 38 |
# sysvinit for sulogin
|
| 39 |
RDEPEND="${COMMON_DEPEND}
|
| 40 |
sys-apps/hwids
|
| 41 |
sys-apps/sysvinit
|
| 42 |
!<sys-libs/glibc-2.10
|
| 43 |
!~sys-fs/udev-187"
|
| 44 |
DEPEND="${COMMON_DEPEND}
|
| 45 |
app-arch/xz-utils
|
| 46 |
app-text/docbook-xsl-stylesheets
|
| 47 |
dev-libs/libxslt
|
| 48 |
dev-util/gperf
|
| 49 |
dev-util/intltool
|
| 50 |
>=sys-kernel/linux-headers-${MINKV}"
|
| 51 |
|
| 52 |
AUTOTOOLS_IN_SOURCE_BUILD=1
|
| 53 |
|
| 54 |
pkg_setup() {
|
| 55 |
enewgroup lock # used by var-lock.mount
|
| 56 |
enewgroup tty 5 # used by mount-setup for /dev/pts
|
| 57 |
}
|
| 58 |
|
| 59 |
src_prepare() {
|
| 60 |
# systemd-analyze is for python2.7 only nowadays.
|
| 61 |
sed -i -e '1s/python/&2.7/' src/analyze/systemd-analyze
|
| 62 |
|
| 63 |
# link against external udev.
|
| 64 |
sed -i -e 's:libudev\.la:-ludev:' Makefile.am
|
| 65 |
|
| 66 |
local PATCHES=(
|
| 67 |
"${FILESDIR}"/0001-Disable-udev-targets-for-udev-189.patch
|
| 68 |
"${FILESDIR}"/0002-journald-add-missing-includes.patch
|
| 69 |
"${FILESDIR}"/0003-journal-add-HAVE_XZ-check-to-avoid-build-failure.patch
|
| 70 |
)
|
| 71 |
|
| 72 |
autotools-utils_src_prepare
|
| 73 |
|
| 74 |
# XXX: support it within eclass
|
| 75 |
eautomake
|
| 76 |
}
|
| 77 |
|
| 78 |
src_configure() {
|
| 79 |
local myeconfargs=(
|
| 80 |
--localstatedir=/var
|
| 81 |
--with-distro=gentoo
|
| 82 |
# install everything to /usr
|
| 83 |
--with-rootprefix=/usr
|
| 84 |
--with-rootlibdir=/usr/$(get_libdir)
|
| 85 |
# but pam modules have to lie in /lib*
|
| 86 |
--with-pamlibdir=/$(get_libdir)/security
|
| 87 |
# this avoids dep on pciutils & usbutils
|
| 88 |
--with-pci-ids-path=/usr/share/misc/pci.ids
|
| 89 |
--with-usb-ids-path=/usr/share/misc/usb.ids
|
| 90 |
# make sure we get /bin:/sbin in $PATH
|
| 91 |
--enable-split-usr
|
| 92 |
# udev parts
|
| 93 |
--disable-introspection
|
| 94 |
--disable-gtk-doc
|
| 95 |
--disable-gudev
|
| 96 |
$(use_enable acl)
|
| 97 |
$(use_enable audit)
|
| 98 |
$(use_enable cryptsetup libcryptsetup)
|
| 99 |
$(use_enable gcrypt)
|
| 100 |
$(use_enable lzma xz)
|
| 101 |
$(use_enable pam)
|
| 102 |
$(use_enable qrcode qrencode)
|
| 103 |
$(use_enable selinux)
|
| 104 |
$(use_enable tcpd tcpwrap)
|
| 105 |
)
|
| 106 |
|
| 107 |
autotools-utils_src_configure
|
| 108 |
}
|
| 109 |
|
| 110 |
src_install() {
|
| 111 |
autotools-utils_src_install \
|
| 112 |
bashcompletiondir=/tmp
|
| 113 |
|
| 114 |
# compat for init= use
|
| 115 |
dosym ../usr/lib/systemd/systemd /bin/systemd
|
| 116 |
dosym ../lib/systemd/systemd /usr/bin/systemd
|
| 117 |
# rsyslog.service depends on it...
|
| 118 |
dosym ../usr/bin/systemctl /bin/systemctl
|
| 119 |
|
| 120 |
# move files as necessary
|
| 121 |
newbashcomp "${D}"/tmp/systemd-bash-completion.sh ${PN}
|
| 122 |
rm -r "${D}"/tmp || die
|
| 123 |
|
| 124 |
# we just keep sysvinit tools, so no need for the mans
|
| 125 |
rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
|
| 126 |
|| die
|
| 127 |
rm "${D}"/usr/share/man/man1/init.1 || die
|
| 128 |
|
| 129 |
# Create /run/lock as required by new baselay/OpenRC compat.
|
| 130 |
insinto /usr/lib/tmpfiles.d
|
| 131 |
doins "${FILESDIR}"/gentoo-run.conf
|
| 132 |
|
| 133 |
# Check whether we won't break user's system.
|
| 134 |
[[ -x "${D}"/bin/systemd ]] || die '/bin/systemd symlink broken, aborting.'
|
| 135 |
[[ -x "${D}"/usr/bin/systemd ]] || die '/usr/bin/systemd symlink broken, aborting.'
|
| 136 |
}
|
| 137 |
|
| 138 |
pkg_preinst() {
|
| 139 |
local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS ~DEVTMPFS
|
| 140 |
~FANOTIFY ~HOTPLUG ~INOTIFY_USER ~IPV6 ~NET ~PROC_FS ~SIGNALFD
|
| 141 |
~SYSFS ~!IDE ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2"
|
| 142 |
kernel_is -ge ${MINKV//./ } || ewarn "Kernel version at least ${MINKV} required"
|
| 143 |
check_extra_config
|
| 144 |
}
|
| 145 |
|
| 146 |
optfeature() {
|
| 147 |
local i desc=${1} text
|
| 148 |
shift
|
| 149 |
|
| 150 |
text=" [\e[1m$(has_version ${1} && echo I || echo ' ')\e[0m] ${1}"
|
| 151 |
shift
|
| 152 |
|
| 153 |
for i; do
|
| 154 |
elog "${text}"
|
| 155 |
text="& [\e[1m$(has_version ${1} && echo I || echo ' ')\e[0m] ${1}"
|
| 156 |
done
|
| 157 |
elog "${text} (${desc})"
|
| 158 |
}
|
| 159 |
|
| 160 |
pkg_postinst() {
|
| 161 |
mkdir -p "${ROOT}"/run || ewarn "Unable to mkdir /run, this could mean trouble."
|
| 162 |
if [[ ! -L "${ROOT}"/etc/mtab ]]; then
|
| 163 |
ewarn "Upstream suggests that the /etc/mtab file should be a symlink to /proc/mounts."
|
| 164 |
ewarn "It is known to cause users being unable to unmount user mounts. If you don't"
|
| 165 |
ewarn "require that specific feature, please call:"
|
| 166 |
ewarn " $ ln -sf '${ROOT}proc/self/mounts' '${ROOT}etc/mtab'"
|
| 167 |
ewarn
|
| 168 |
fi
|
| 169 |
|
| 170 |
elog "To get additional features, a number of optional runtime dependencies may"
|
| 171 |
elog "be installed:"
|
| 172 |
optfeature 'for systemd-analyze' \
|
| 173 |
'dev-lang/python:2.7' 'dev-python/dbus-python'
|
| 174 |
optfeature 'for systemd-analyze plotting ability' \
|
| 175 |
'dev-python/pycairo[svg]'
|
| 176 |
optfeature 'for GTK+ systemadm UI and gnome-ask-password-agent' \
|
| 177 |
'sys-apps/systemd-ui'
|
| 178 |
elog
|
| 179 |
|
| 180 |
ewarn "Please note this is a work-in-progress and many packages in Gentoo"
|
| 181 |
ewarn "do not supply systemd unit files yet. You are testing it on your own"
|
| 182 |
ewarn "responsibility. Please remember than you can pass:"
|
| 183 |
ewarn " init=/sbin/init"
|
| 184 |
ewarn "to your kernel to boot using sysvinit / OpenRC."
|
| 185 |
}
|