From 4e071be0a5310b31f5860361605ada547c3a2f42 Mon Sep 17 00:00:00 2001 From: fbt Date: Mon, 20 Nov 2017 00:47:31 +0300 Subject: [PATCH] Steal Arch's pkgbuild and strip it Signed-off-by: fbt --- PKGBUILD | 179 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 129 insertions(+), 50 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 1d7a56a..52aaff3 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,68 +1,147 @@ -# Maintainer: Jack L. Frost -# % Trigger: 1434722047 % -# vim: ft=sh +# PKGBUILD stripped to only provide libsystemd and libsystemd-udev. +# Original Arch maintainers: +# Maintainer: Christian Hesse +# Maintainer: Dave Reisner +# Maintainer: Tom Gundersen -pkgdesc="Standalone systemd libs" -pkgname=( 'libsystemd-standalone' 'libsystemd-udev' ) -pkgver=235 -pkgrel=1 -arch=('i686' 'x86_64') -url="http://www.freedesktop.org/wiki/Software/systemd" -license=('GPL2' 'LGPL2.1' 'MIT') -makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gobject-introspection' 'gperf' - 'gtk-doc' 'intltool' 'kmod' 'libcap' 'libgcrypt' 'libmicrohttpd' 'libxslt' - 'linux-api-headers' 'pam' 'python' 'python-lxml' 'quota-tools' 'xz') +pkgbase=libsystemd-standalone +pkgname=('libsystemd-standalone' 'libsystemd-udev') +# latest commit on stable branch +_commit='743b771c559c6101544f7358a42c8c519fe4b0db' +# Bump this to latest major release for signed tag verification, +# the commit count is handled by pkgver() function. +pkgver=235.38 +pkgrel=2 +arch=('x86_64') +url="https://www.github.com/systemd/systemd" +makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gperf' 'lz4' 'xz' 'pam' 'libelf' + 'intltool' 'iptables' 'kmod' 'libcap' 'libidn' 'libgcrypt' + 'libmicrohttpd' 'libxslt' 'util-linux' 'linux-api-headers' + 'python-lxml' 'quota-tools' 'shadow' 'gnu-efi-libs' 'git' + 'meson' 'libseccomp') options=('strip') -source=( "https://github.com/systemd/systemd/archive/v${pkgver}.tar.gz" ) +validpgpkeys=('63CDA1E5D3FC22B998D20DD6327F26951A015CC4') # Lennart Poettering +source=('git://github.com/systemd/systemd-stable.git' + 'git://github.com/systemd/systemd.git') # pull in for tags, backports & reverts + +_backports=( + # Fix typo in statx macro (#7180) (FS#56289) + '8e6a7a8b2be409d356bcaface00f6d44390c07ff' +) + +_reverts=( +) + +_validate_tag() { + local success fingerprint trusted status tag=v${pkgver%.*} + + parse_gpg_statusfile /dev/stdin < <(git verify-tag --raw "$tag" 2>&1) + + if (( ! success )); then + error 'failed to validate tag %s\n' "$tag" + return 1 + fi + + if ! in_array "$fingerprint" "${validpgpkeys[@]}" && (( ! trusted )); then + error 'unknown or untrusted public key: %s\n' "$fingerprint" + return 1 + fi + + case $status in + 'expired') + warning 'the signature has expired' + ;; + 'expiredkey') + warning 'the key has expired' + ;; + esac + + return 0 +} + +pkgver() { + local version count + + cd "systemd-stable" + + version="$(git describe --abbrev=0 --tags)" + count="$(git rev-list --count ${version}..)" + printf '%s.%s' "${version#v}" "${count}" +} + +prepare() { + cd "systemd-stable" + + git remote add upstream ../systemd/ + git fetch --all + + git checkout "${_commit}" + + _validate_tag || return + + local _commit + for _commit in "${_backports[@]}"; do + git cherry-pick -n "$_commit" + done + for _commit in "${_reverts[@]}"; do + git revert -n "$_commit" + done +} build() { - cd "systemd-$pkgver" + local timeservers=({0..3}.arch.pool.ntp.org) - ./autogen.sh - ./configure + local meson_options=( + -Daudit=false + -Dgnuefi=true + -Dima=false + -Dlz4=true - make + -Ddbuspolicydir=/usr/share/dbus-1/system.d + -Ddefault-dnssec=no + # TODO(dreisner): consider changing this to unified + -Ddefault-hierarchy=hybrid + -Ddefault-kill-user-processes=false + -Dfallback-hostname='archlinux' + -Dntp-servers="${timeservers[*]}" + -Drpmmacrosdir=no + -Dsysvinit-path= + -Dsysvrcnd-path= + ) + + arch-meson "systemd-stable" build "${meson_options[@]}" + + ninja -C build + + DESTDIR="$srcdir"/full-install ninja -C build install } package_libsystemd-standalone() { - install='libsystemd.install' - provides=( 'libsystemd.so' 'libsystemd' ) + pkgdesc="systemd client libraries" + depends=('glibc' 'libcap' 'libgcrypt' 'lz4' 'xz') + license=('GPL2') + provides=('libsystemd' 'libsystemd.so') - make -C "systemd-$pkgver" DESTDIR="$pkgdir" install-rootlibLTLIBRARIES + install -dm755 "$pkgdir"/usr/lib/ + cp --archive "$srcdir"/full-install/usr/lib/lib{nss_*,systemd}.so* "$pkgdir"/usr/lib/ - # Headers - cd "systemd-$pkgver" - install -Dm644 src/systemd/_sd-common.h "${pkgdir}/usr/include/systemd/_sd-common.h" - install -Dm644 src/systemd/sd-messages.h "${pkgdir}/usr/include/systemd/sd-messages.h" - install -Dm644 src/systemd/sd-event.h "${pkgdir}/usr/include/systemd/sd-event.h" - install -Dm644 src/systemd/sd-bus.h "${pkgdir}/usr/include/systemd/sd-bus.h" - install -Dm644 src/systemd/sd-bus-protocol.h "${pkgdir}/usr/include/systemd/sd-bus-protocol.h" - install -Dm644 src/systemd/sd-bus-vtable.h "${pkgdir}/usr/include/systemd/sd-bus-vtable.h" - install -Dm644 src/systemd/sd-daemon.h "${pkgdir}/usr/include/systemd/sd-daemon.h" - install -Dm644 src/systemd/sd-id128.h "${pkgdir}/usr/include/systemd/sd-id128.h" - install -Dm644 src/systemd/sd-journal.h "${pkgdir}/usr/include/systemd/sd-journal.h" - install -Dm644 src/systemd/sd-login.h "${pkgdir}/usr/include/systemd/sd-login.h" - - # pkg-config - install -Dm644 src/libsystemd/libsystemd.pc "${pkgdir}/usr/lib/pkgconfig/libsystemd.pc" - - # remove libudev stuff - cd "$pkgdir/usr/lib" - rm libudev.so* libudev.la + install -dm755 "$pkgdir"/usr/lib/pkgconfig/ + cp --archive "$srcdir"/full-install/usr/lib/pkgconfig/libsystemd.pc "$pkgdir"/usr/lib/pkgconfig/ } package_libsystemd-udev() { - _libudev_version='1.6.6' - install='libsystemd.install' - provides=( 'libudev.so' 'libudev' ) + pkgdesc="udev client libraries" + depends=('glibc' 'libcap' 'libgcrypt' 'lz4' 'xz') + license=('GPL2') + provides=('libudev' 'libudev.so') - install -Dm644 "systemd-$pkgver/.libs/libudev.la" "${pkgdir}/usr/lib/libudev.la" - install -Dm644 "systemd-$pkgver/.libs/libudev.so.$_libudev_version" "${pkgdir}/usr/lib/libudev.so.$_libudev_version" - ln -s "libudev.so.$_libudev_version" "$pkgdir/usr/lib/libudev.so.1" - ln -s "libudev.so.$_libudev_version" "$pkgdir/usr/lib/libudev.so" + install -dm755 "$pkgdir"/usr/lib/ + cp --archive "$srcdir"/full-install/usr/lib/libudev.so* "$pkgdir"/usr/lib/ - install -Dm644 "systemd-$pkgver/src/libudev/libudev.pc" "$pkgdir/usr/lib/pkgconfig/libudev.pc" - install -Dm644 "systemd-$pkgver/src/libudev/libudev.h" "$pkgdir/usr/include/libudev.h" + install -dm755 "$pkgdir"/usr/lib/pkgconfig/ + cp --archive "$srcdir"/full-install/usr/lib/pkgconfig/libudev.pc "$pkgdir"/usr/lib/pkgconfig/ } -sha1sums=('bda1bd1cb09bba798c3e125fb902f6c9e75308c4') +# vim: ft=sh syn=sh et +sha1sums=('SKIP' + 'SKIP')