PKGBUILDs/core/systemd/PKGBUILD
2015-04-23 23:03:01 +00:00

208 lines
8.1 KiB
Bash

# Maintainer: Dave Reisner <dreisner@archlinux.org>
# Maintainer: Tom Gundersen <teg@jklm.no>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - disable optimization, currently breaks many things
# - v5: revert 5bac523 until the issue with it can be figured out
pkgbase=systemd
pkgname=('systemd' 'libsystemd' 'systemd-sysvcompat')
pkgver=219
pkgrel=6
arch=('i686' 'x86_64')
url="http://www.freedesktop.org/wiki/Software/systemd"
makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gobject-introspection' 'gperf'
'gtk-doc' 'intltool' 'iptables' 'kmod' 'libcap' 'libidn' 'libgcrypt'
'libmicrohttpd' 'libxslt' 'util-linux' 'linux-api-headers' 'lz4' 'pam'
'python' 'python-lxml' 'quota-tools' 'shadow' 'xz')
options=('strip' 'debug')
source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
'initcpio-hook-udev'
'initcpio-install-systemd'
'initcpio-install-udev'
'0001-tmpfiles-avoid-creating-duplicate-acl-entries.patch'
'0001-nspawn-when-connected-to-pipes-for-stdin-stdout-pass.patch'
'0001-core-shared-in-deserializing-match-same-files-reache.patch'
'0001-tmpfiles-Fix-handling-of-duplicate-lines.patch'
'0001-core-do-not-spawn-jobs-or-touch-other-units-during-c.patch'
'0001-use-x-machine-unix-prefix-for-the-container-bus-on-dbus1.patch'
'0001-unit-use-weaker-dependencies-between-mount-and-devic.patch'
'0001-core-rework-device-state-logic.patch'
'0001-core-don-t-change-removed-devices-to-state-tentative.patch'
'5bac5235934fabe5a3e6a9d47f4812f81034c427.patch')
md5sums=('e0d6c9a4b4f69f66932d2230298c9a34'
'90ea67a7bb237502094914622a39e281'
'58af51bd4c0464f195b3433b4e17cf6c'
'bde43090d4ac0ef048e3eaee8202a407'
'7cdefc73bf61934c353e4450e280e551'
'cb8550749cd52b5902ed6fdf0eb465ec'
'9d46aebfc04cc849fd4295f449b239a2'
'c4c9c0f0a06314450563ed571962881e'
'6b9d611dffd92c94641360c3ef2659c1'
'3a0fc672b34ced18ca1364edf8644165'
'cd2719e8e93ad662c00bf9f195fdce66'
'12e01f00c91e54680098a799517698f2'
'd0aa4e5ec598063eab2e79fb95bceece'
'a168ea8a805ee16c1dd1cfe6f5893558')
prepare() {
cd "$pkgname-$pkgver"
patch -Np1 <../0001-tmpfiles-avoid-creating-duplicate-acl-entries.patch
patch -Np1 <../0001-nspawn-when-connected-to-pipes-for-stdin-stdout-pass.patch
patch -Np1 <../0001-core-shared-in-deserializing-match-same-files-reache.patch
patch -Np1 <../0001-tmpfiles-Fix-handling-of-duplicate-lines.patch
patch -Np1 <../0001-core-do-not-spawn-jobs-or-touch-other-units-during-c.patch
patch -Np1 <../0001-use-x-machine-unix-prefix-for-the-container-bus-on-dbus1.patch
patch -Np1 <../0001-unit-use-weaker-dependencies-between-mount-and-devic.patch
patch -Np1 <../0001-core-rework-device-state-logic.patch
patch -Np1 <../0001-core-don-t-change-removed-devices-to-state-tentative.patch
[[ $CARCH == "arm" ]] && patch -Rp1 -i ../5bac5235934fabe5a3e6a9d47f4812f81034c427.patch || true
}
build() {
cd "$pkgname-$pkgver"
CFLAGS=`echo $CFLAGS | sed -e 's/-O2/-O0/'` && CXXFLAGS="$CFLAGS"
unset CPPFLAGS
local timeservers=({0..3}.arch.pool.ntp.org)
./configure \
--libexecdir=/usr/lib \
--localstatedir=/var \
--sysconfdir=/etc \
--enable-introspection \
--enable-gtk-doc \
--enable-lz4 \
--enable-compat-libs \
--disable-audit \
--disable-ima \
--disable-kdbus \
--with-sysvinit-path= \
--with-sysvrcnd-path= \
--with-ntp-servers="${timeservers[*]}"
make
}
package_systemd() {
pkgdesc="system and service manager"
license=('GPL2' 'LGPL2.1' 'MIT')
depends=('acl' 'bash' 'dbus' 'glib2' 'iptables' 'kbd' 'kmod' 'hwids' 'libcap'
'libgcrypt' 'libsystemd' 'libidn' 'lz4' 'pam' 'libseccomp' 'util-linux'
'xz')
provides=('nss-myhostname' "systemd-tools=$pkgver" "udev=$pkgver")
replaces=('nss-myhostname' 'systemd-tools' 'udev')
conflicts=('nss-myhostname' 'systemd-tools' 'udev')
optdepends=('python: systemd library bindings'
'cryptsetup: required for encrypted block devices'
'libmicrohttpd: remote journald capabilities'
'quota-tools: kernel-level quota management'
'systemd-sysvcompat: symlink package to provide sysvinit binaries'
'polkit: allow administration as unprivileged user')
backup=(etc/dbus-1/system.d/org.freedesktop.systemd1.conf
etc/dbus-1/system.d/org.freedesktop.hostname1.conf
etc/dbus-1/system.d/org.freedesktop.login1.conf
etc/dbus-1/system.d/org.freedesktop.locale1.conf
etc/dbus-1/system.d/org.freedesktop.machine1.conf
etc/dbus-1/system.d/org.freedesktop.timedate1.conf
etc/dbus-1/system.d/org.freedesktop.import1.conf
etc/dbus-1/system.d/org.freedesktop.network1.conf
etc/pam.d/systemd-user
etc/systemd/bootchart.conf
etc/systemd/coredump.conf
etc/systemd/journald.conf
etc/systemd/journal-remote.conf
etc/systemd/journal-upload.conf
etc/systemd/logind.conf
etc/systemd/system.conf
etc/systemd/timesyncd.conf
etc/systemd/resolved.conf
etc/systemd/user.conf
etc/udev/udev.conf)
install="systemd.install"
make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
# don't write units to /etc by default. some of these will be re-enabled on
# post_install.
rm -r "$pkgdir/etc/systemd/system/"*.wants
# get rid of RPM macros
rm -r "$pkgdir/usr/lib/rpm"
# add back tmpfiles.d/legacy.conf
install -m644 "systemd-$pkgver/tmpfiles.d/legacy.conf" "$pkgdir/usr/lib/tmpfiles.d"
# Replace dialout/tape/cdrom group in rules with uucp/storage/optical group
sed -i 's#GROUP="dialout"#GROUP="uucp"#g;
s#GROUP="tape"#GROUP="storage"#g;
s#GROUP="cdrom"#GROUP="optical"#g' "$pkgdir"/usr/lib/udev/rules.d/*.rules
sed -i 's/dialout/uucp/g;
s/tape/storage/g;
s/cdrom/optical/g' "$pkgdir"/usr/lib/sysusers.d/basic.conf
# add mkinitcpio hooks
install -Dm644 "$srcdir/initcpio-install-systemd" "$pkgdir/usr/lib/initcpio/install/systemd"
install -Dm644 "$srcdir/initcpio-install-udev" "$pkgdir/usr/lib/initcpio/install/udev"
install -Dm644 "$srcdir/initcpio-hook-udev" "$pkgdir/usr/lib/initcpio/hooks/udev"
# ensure proper permissions for /var/log/journal. This is only to placate
chown root:systemd-journal "$pkgdir/var/log/journal"
chmod 2755 "$pkgdir/var/log/journal"
# we'll create this on installation
rmdir "$pkgdir/var/log/journal/remote"
# fix pam file
sed 's|system-auth|system-login|g' -i "$pkgdir/etc/pam.d/systemd-user"
# ship default policy to leave services disabled
echo 'disable *' >"$pkgdir"/usr/lib/systemd/system-preset/99-default.preset
### split out manpages for sysvcompat
rm -rf "$srcdir/_sysvcompat"
install -dm755 "$srcdir"/_sysvcompat/usr/share/man/man8/
mv "$pkgdir"/usr/share/man/man8/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8 \
"$srcdir"/_sysvcompat/usr/share/man/man8
### split off runtime libraries
rm -rf "$srcdir/_libsystemd"
install -dm755 "$srcdir"/_libsystemd/usr/lib
cd "$srcdir"/_libsystemd
mv "$pkgdir"/usr/lib/lib{systemd,{g,}udev}*.so* usr/lib
# include MIT license, since it's technically custom
install -Dm644 "$srcdir/$pkgname-$pkgver/LICENSE.MIT" \
"$pkgdir/usr/share/licenses/systemd/LICENSE.MIT"
}
package_libsystemd() {
pkgdesc="systemd client libraries"
depends=('glib2' 'glibc' 'libgcrypt' 'lz4' 'xz')
license=('GPL2')
provides=('libgudev-1.0.so' 'libsystemd.so' 'libsystemd-daemon.so' 'libsystemd-id128.so'
'libsystemd-journal.so' 'libsystemd-login.so' 'libudev.so')
mv "$srcdir/_libsystemd"/* "$pkgdir"
}
package_systemd-sysvcompat() {
pkgdesc="sysvinit compat for systemd"
license=('GPL2')
groups=('base')
conflicts=('sysvinit')
depends=('systemd')
mv "$srcdir/_sysvcompat"/* "$pkgdir"
install -dm755 "$pkgdir/usr/bin"
for tool in runlevel reboot shutdown poweroff halt telinit; do
ln -s 'systemctl' "$pkgdir/usr/bin/$tool"
done
ln -s '../lib/systemd/systemd' "$pkgdir/usr/bin/init"
}
# vim: ft=sh syn=sh et