PKGBUILDs/core/systemd/PKGBUILD

196 lines
6.8 KiB
Bash
Raw Normal View History

2014-07-16 02:33:04 +00:00
# Maintainer: Dave Reisner <dreisner@archlinux.org>
# Maintainer: Tom Gundersen <teg@jklm.no>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2015-10-10 14:58:52 +00:00
# - disable gold/LTO
2015-06-23 02:00:02 +00:00
# - removed makedepend on gnu-efi-libs, --enable-gnuefi configure option
2014-07-16 02:33:04 +00:00
pkgbase=systemd
pkgname=('systemd' 'libsystemd' 'systemd-sysvcompat')
2015-11-27 17:40:32 +00:00
pkgver=228
2016-02-05 16:06:22 +00:00
pkgrel=4
2014-07-16 02:33:04 +00:00
arch=('i686' 'x86_64')
url="http://www.freedesktop.org/wiki/Software/systemd"
2015-11-27 17:40:32 +00:00
makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gperf' 'lz4' 'xz' 'pam' 'libelf'
2015-06-23 02:00:02 +00:00
'intltool' 'iptables' 'kmod' 'libcap' 'libidn' 'libgcrypt'
'libmicrohttpd' 'libxslt' 'util-linux' 'linux-api-headers'
2015-07-30 12:05:41 +00:00
'python-lxml' 'quota-tools' 'shadow' 'git')
2014-07-18 01:02:26 +00:00
options=('strip' 'debug')
2015-06-23 02:00:02 +00:00
source=("git://github.com/systemd/systemd.git#tag=v$pkgver"
2014-07-16 02:33:04 +00:00
'initcpio-hook-udev'
'initcpio-install-systemd'
2015-02-17 04:46:29 +00:00
'initcpio-install-udev'
2015-06-23 02:00:02 +00:00
'arch.conf'
'loader.conf'
'splash-arch.bmp')
md5sums=('SKIP'
2014-11-22 16:06:32 +00:00
'90ea67a7bb237502094914622a39e281'
2015-06-27 21:19:51 +00:00
'976c5511b6493715e381f43f16cdb151'
2015-07-18 18:23:57 +00:00
'1b3aa3a0551b08af9305d33f85b5c2fc'
2015-06-23 02:00:02 +00:00
'20ead378f5d6df4b2a3e670301510a7d'
'ddaef54f68f6c86c6c07835fc668f62a'
'1e2f9a8b0fa32022bf0a8f39123e5f4e')
2015-02-17 04:46:29 +00:00
prepare() {
2015-09-20 15:32:52 +00:00
cd "$pkgbase"
2015-06-23 02:00:02 +00:00
2015-11-27 17:40:32 +00:00
# sd-ndisc: drop RA packets from non-link-local addresses
# https://github.com/systemd/systemd/commit/3ccd31635353
# https://github.com/systemd/systemd/issues/1866
git cherry-pick -n 3ccd31635353
# networkd: link - do not drop config for loopback device
# https://github.com/systemd/systemd/commit/e5d44b34cca3
# https://github.com/systemd/systemd/issues/2023
git cherry-pick -n e5d44b34cca3
2016-02-05 16:06:22 +00:00
# virt: detect dmi before cpuid
# https://github.com/systemd/systemd/commit/050e65ada2e0
# https://github.com/systemd/systemd/issues/1993
git cherry-pick -n 050e65ada2e0
2015-06-23 02:00:02 +00:00
./autogen.sh
2015-02-17 04:46:29 +00:00
}
2014-07-16 02:33:04 +00:00
build() {
2015-09-20 15:32:52 +00:00
cd "$pkgbase"
2015-06-23 02:00:02 +00:00
local timeservers=({0..3}.arch.pool.ntp.org)
2014-07-16 02:33:04 +00:00
2015-10-10 14:58:52 +00:00
LDFLAGS+=" -Wl,-fuse-ld=bfd"
CFLAGS+=" -fno-lto"
CXXFLAGS+=" -fno-lto"
2014-07-18 01:02:26 +00:00
2014-07-16 02:33:04 +00:00
./configure \
--libexecdir=/usr/lib \
--localstatedir=/var \
--sysconfdir=/etc \
2014-11-12 02:53:00 +00:00
--enable-lz4 \
2014-07-16 02:33:04 +00:00
--enable-compat-libs \
--disable-audit \
--disable-ima \
--with-sysvinit-path= \
--with-sysvrcnd-path= \
2014-11-12 02:53:00 +00:00
--with-ntp-servers="${timeservers[*]}"
2014-07-16 02:33:04 +00:00
make
}
package_systemd() {
pkgdesc="system and service manager"
2015-06-23 02:00:02 +00:00
license=('GPL2' 'LGPL2.1')
2015-04-19 14:43:25 +00:00
depends=('acl' 'bash' 'dbus' 'glib2' 'iptables' 'kbd' 'kmod' 'hwids' 'libcap'
2015-11-27 17:40:32 +00:00
'libgcrypt' 'libsystemd' 'libidn' 'lz4' 'pam' 'libelf' 'libseccomp'
2015-10-17 01:00:28 +00:00
'util-linux' 'xz')
2014-07-16 02:33:04 +00:00
provides=('nss-myhostname' "systemd-tools=$pkgver" "udev=$pkgver")
replaces=('nss-myhostname' 'systemd-tools' 'udev')
conflicts=('nss-myhostname' 'systemd-tools' 'udev')
2015-07-30 12:05:41 +00:00
optdepends=('cryptsetup: required for encrypted block devices'
2014-07-16 02:33:04 +00:00
'libmicrohttpd: remote journald capabilities'
'quota-tools: kernel-level quota management'
2014-08-27 06:22:24 +00:00
'systemd-sysvcompat: symlink package to provide sysvinit binaries'
'polkit: allow administration as unprivileged user')
2014-07-16 02:33:04 +00:00
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
2015-04-19 14:43:25 +00:00
etc/dbus-1/system.d/org.freedesktop.import1.conf
etc/dbus-1/system.d/org.freedesktop.network1.conf
2014-07-16 02:33:04 +00:00
etc/pam.d/systemd-user
etc/systemd/bootchart.conf
2014-09-03 00:17:53 +00:00
etc/systemd/coredump.conf
2014-07-16 02:33:04 +00:00
etc/systemd/journald.conf
2015-04-19 14:43:25 +00:00
etc/systemd/journal-remote.conf
etc/systemd/journal-upload.conf
2014-07-16 02:33:04 +00:00
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"
2015-09-20 15:32:52 +00:00
make -C "$pkgbase" DESTDIR="$pkgdir" install
2014-07-16 02:33:04 +00:00
# don't write units to /etc by default. some of these will be re-enabled on
# post_install.
2015-04-19 14:43:25 +00:00
rm -r "$pkgdir/etc/systemd/system/"*.wants
2014-07-16 02:33:04 +00:00
# get rid of RPM macros
rm -r "$pkgdir/usr/lib/rpm"
# add back tmpfiles.d/legacy.conf
2015-09-20 15:32:52 +00:00
install -m644 "$pkgbase/tmpfiles.d/legacy.conf" "$pkgdir/usr/lib/tmpfiles.d"
2014-07-16 02:33:04 +00:00
# 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"
2014-09-03 00:17:53 +00:00
# ensure proper permissions for /var/log/journal. This is only to placate
2014-07-16 02:33:04 +00:00
chown root:systemd-journal "$pkgdir/var/log/journal"
2015-04-19 14:43:25 +00:00
chmod 2755 "$pkgdir/var/log/journal"
# we'll create this on installation
rmdir "$pkgdir/var/log/journal/remote"
2014-07-16 02:33:04 +00:00
# fix pam file
sed 's|system-auth|system-login|g' -i "$pkgdir/etc/pam.d/systemd-user"
2014-09-03 00:17:53 +00:00
# ship default policy to leave services disabled
echo 'disable *' >"$pkgdir"/usr/lib/systemd/system-preset/99-default.preset
2015-09-29 00:27:17 +00:00
### manpages shipped with systemd-sysvcompat
rm "$pkgdir"/usr/share/man/man8/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8
2014-07-16 02:33:04 +00:00
2015-09-29 00:27:17 +00:00
### runtime libraries shipped with libsystemd
rm "$pkgdir"/usr/lib/lib{nss,systemd,udev}*.so*
2014-07-16 02:33:04 +00:00
2015-06-23 02:00:02 +00:00
# add example bootctl configuration
install -Dm644 "$srcdir/arch.conf" "$pkgdir"/usr/share/systemd/bootctl/arch.conf
install -Dm644 "$srcdir/loader.conf" "$pkgdir"/usr/share/systemd/bootctl/loader.conf
install -Dm644 "$srcdir/splash-arch.bmp" "$pkgdir"/usr/share/systemd/bootctl/splash-arch.bmp
2014-07-16 02:33:04 +00:00
}
package_libsystemd() {
pkgdesc="systemd client libraries"
2015-07-18 18:23:57 +00:00
depends=('glibc' 'libgcrypt' 'lz4' 'xz')
2014-07-16 02:33:04 +00:00
license=('GPL2')
2015-06-23 02:00:02 +00:00
provides=('libsystemd.so' 'libsystemd-daemon.so' 'libsystemd-id128.so'
2014-07-16 02:33:04 +00:00
'libsystemd-journal.so' 'libsystemd-login.so' 'libudev.so')
2015-09-29 00:27:17 +00:00
make -C "$pkgbase" DESTDIR="$pkgdir" install-libLTLIBRARIES
2014-07-16 02:33:04 +00:00
}
package_systemd-sysvcompat() {
pkgdesc="sysvinit compat for systemd"
license=('GPL2')
groups=('base')
conflicts=('sysvinit')
depends=('systemd')
2015-09-29 00:27:17 +00:00
install -dm755 "$pkgdir"/usr/share/man/man8
cp -d --no-preserve=ownership,timestamp \
"$pkgbase"/man/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8 \
"$pkgdir"/usr/share/man/man8
2014-07-16 02:33:04 +00:00
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