summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-07-12 18:29:46 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-07-27 17:04:31 -0400
commit1551c11016e077cfdfda0338745a5d2cb10da1da (patch)
tree3cc4f4184f9b35a0391325a10d58f787bd789f12
parent80ba2c6556ff34b64333b04b28a704271ed78f6d (diff)
downloadabslibre-1551c11016e077cfdfda0338745a5d2cb10da1da.tar.gz
abslibre-1551c11016e077cfdfda0338745a5d2cb10da1da.tar.bz2
abslibre-1551c11016e077cfdfda0338745a5d2cb10da1da.zip
pcr/elogind: Update v235.4->v238.1, improve
- v235.4 -> v238.1 - Every time you use a "#branch=" git URL, I die a little. Use a tag or a commit hash if you use a git URL. Preferably a signed tag. - Add a prepare() function to switch to the desired commit from the ${pkgver%%.*}-stable branch *after* makepkg has verified the signed tag referred to in sources=() (same as core/systemd) - Adopt the $base_pkgver.$commits_from_stable pkgver notation of core/systemd - Add a pkgver() function to update $commits_from_stable for you (same as core/systemd) - Use 2-space indent, same as every other PKGBUILD - Do similar package splitting to libre/systemd - Depend on generic 'udev', 'libudev', rather than 'eudev', 'libeudev' - Don't depend on -elogind versions of packages, let pacman figure it out - Split libelogind-manpages in to a speparate package, to avoid conflicts with systemd-libsystemd - Drop options=('!libtool') -- recent versions use Meson, not Autotools - makedepends: Drop libtool, we use Meson now - makedepends: Drop intltool, it isn't used - makedepends/elogind:depends: Drop libseccomp, it isn't used (commented out in the source) - makedepends: Drop polkit(-elogind), README claims it isn't a compile-time dep - makedepends: Replace gtk-doc with docbook-xsl, they switched a while ago - makedepends: Add libcap, just to be safe - makedepends: Add acl, just to be safe, since it is used - elogind:conflicts: Drop consolekit, it doesn't exist - elogind:conflicts: Drop pm-utils, it doesn't exist - elogind:conflicts: Drop systemd-sysvinit, there's no reason to have it - elogind:conflicts: Add systemd, they both ship the same dbus files - libelogind:depends: Drop libcap, it isn't linked against it - libelogind:depends: Drop libeudev, it isn't linked against libudev.so
-rw-r--r--pcr/elogind/PKGBUILD119
-rw-r--r--pcr/elogind/protect-user-XDG_RUNTIME_DIR.patch23
2 files changed, 73 insertions, 69 deletions
diff --git a/pcr/elogind/PKGBUILD b/pcr/elogind/PKGBUILD
index 70baac39b..f300c6447 100644
--- a/pcr/elogind/PKGBUILD
+++ b/pcr/elogind/PKGBUILD
@@ -1,70 +1,97 @@
# Maintainer (Artix): artoo <artoo@cromnix.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Maintainer: David P. <megver83@parabola.nu>
+# Contributor: Luke Shumaker <lukeshu@parabola.nu>
+
+# Note: have libelogind-manpages as a separate package, so that
+# systemd-libsystemd (which also includes the same manpages) and
+# libelogind don't conflict.
pkgbase=elogind
-pkgname=('elogind' 'libelogind')
-pkgver=235.4
+pkgname=('elogind' 'libelogind' 'libelogind-manpages')
+pkgver=238.1.0
+_commit='8bb4695ef79404b6731b20dee58115c313444754'
pkgrel=1
pkgdesc="The systemd project's logind, extracted to a standalone package"
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/elogind/elogind"
-license=('GPL' 'LGPL2.1')
-makedepends=('intltool' 'libtool' 'gperf' 'gtk-doc' 'polkit-elogind' 'dbus-elogind' 'eudev' 'libseccomp' 'meson' 'git')
-options=('!libtool')
-# source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/elogind/elogind/archive/v${pkgver}.tar.gz"
-# "protect-user-XDG_RUNTIME_DIR.patch")
-source=("git+https://github.com/elogind/elogind.git#branch=v235-stable")
+license=('GPL2' 'LGPL2.1') # Mostly LGPL2.1, only the single `src/uaccess-command/uaccess-command.c` file is GPL2
+makedepends=('acl' 'docbook-xsl' 'gperf' 'pam'
+ 'libcap' 'polkit' 'dbus' 'udev' 'meson' 'git')
+validpgpkeys=('0C4DF110D49D911C593050BF5FC1DF9CEC74BA48') # Sven Eden <seden@havi.de>
+source=(# fragment is latest tag for source verification, final merge in prepare()
+ "git+https://github.com/elogind/elogind#tag=v${pkgver%.*}?signed")
sha256sums=('SKIP')
prepare() {
- cd ${pkgbase} #-${pkgver}
-# patch -Np1 -i ${srcdir}/protect-user-XDG_RUNTIME_DIR.patch
+ cd "$pkgbase"
+
+ # merge the latest stable commit (fast-foward only to make sure
+ # the verified tag is in)
+ git merge --ff-only "${_commit}"
+}
+
+pkgver() {
+ local version count
+
+ cd "$pkgbase"
+
+ version="$(git describe --abbrev=0 --tags)"
+ count="$(git rev-list --count ${version}..)"
+ printf '%s.%s' "${version#v}" "${count}"
}
build() {
- local meson_options=(
- -Drootlibdir=/usr/lib
- -Drootlibexecdir=/usr/lib/elogind
- -Ddbuspolicydir=/usr/share/dbus-1/system.d
- -Ddefault-hierarchy=hybrid
- -Dcgroup-controller=openrc
-# -Ddefault-kill-user-processes=false
- )
-
-# arch-meson "$pkgbase-${pkgver}" build "${meson_options[@]}"
- arch-meson "$pkgbase" build "${meson_options[@]}"
-
- ninja -C build
+ local meson_options=(
+ -Drootlibdir=/usr/lib
+ -Drootlibexecdir=/usr/lib/elogind
+ -Ddbuspolicydir=/usr/share/dbus-1/system.d
+ -Ddefault-hierarchy=hybrid
+ -Dcgroup-controller=openrc
+ )
+
+ arch-meson "$pkgbase" build "${meson_options[@]}"
+
+ ninja -C build
+
+ # Go ahead and split the package now. It's easier this way, because
+ # we can use mv instead of awkward, error-prone rm/cp pairs.
+ rm -rf "$srcdir/dest"
+
+ # Put things in the main systemd package by default
+ DESTDIR="$srcdir/dest/elogind" ninja -C build install
+
+ install -d "$srcdir/dest/libelogind"/usr/lib
+ mv -T "$srcdir/dest"/{elogind,libelogind}/usr/lib/pkgconfig
+ mv -T "$srcdir/dest"/{elogind,libelogind}/usr/include
+ mv -t "$srcdir/dest/libelogind"/usr/lib -- "$srcdir/dest/elogind"/usr/lib/libelogind*
+
+ install -d "$srcdir/dest"/libelogind-manpages/usr/share/man
+ mv -T "$srcdir/dest"/{elogind,libelogind-manpages}/usr/share/man/man3
}
package_elogind() {
- pkgdesc="The systemd project's logind, extracted to a standalone package"
- provides=("elogind=${pkgver}")
- depends=('acl' 'pam' 'dbus-elogind' 'eudev' 'libseccomp' 'libelogind')
- conflicts=('systemd-sysvcompat' 'consolekit' 'pm-utils')
- replaces=('consolekit' 'pm-utils')
- optdepends=('elogind-openrc: elogind initscript'
- 'polkit-elogind: polkit support')
- backup=('etc/elogind/logind.conf')
-
- DESTDIR="$pkgdir" ninja -C build install
-
- mkdir ${srcdir}/_libelogind
- mv -v ${pkgdir}/usr/lib/pkgconfig ${srcdir}/_libelogind
- mv -v ${pkgdir}/usr/include/ ${srcdir}/_libelogind
- mv -v ${pkgdir}/usr/lib/libelogind*.so* ${srcdir}/_libelogind
+ depends=('acl' 'pam' 'dbus' 'udev' 'libelogind')
+ conflicts=('systemd') # because both provide org.freedesktop.login1
+ optdepends=('elogind-openrc: elogind initscript'
+ 'polkit-elogind: polkit support')
+ backup=('etc/elogind/logind.conf')
+
+ cp -rT -d --no-preserve=ownership,timestamp "$srcdir/dest/$pkgname" "$pkgdir"
}
package_libelogind(){
- pkgdesc="elogind client libraries"
- provides=('libelogind.so' "libelogind=${pkgver}")
- depends=('libcap' 'libeudev')
+ pkgdesc="elogind client libraries"
+ provides=('libelogind.so')
+ optdepends=('libelogind-manpages')
+
+ cp -rT -d --no-preserve=ownership,timestamp "$srcdir/dest/$pkgname" "$pkgdir"
+}
- cd ${pkgbase} #-${pkgver}
+package_libelogind-manpages() {
+ pkgdesc='Manual pages for libelogind'
+ depends=('libelogind')
+ conflicts=('systemd-libsystemd') # because both provide the same manpages
- install -dm755 ${pkgdir}/usr/lib
- mv ${srcdir}/_libelogind/include ${pkgdir}/usr
- mv ${srcdir}/_libelogind/pkgconfig ${pkgdir}/usr/lib
- mv ${srcdir}/_libelogind/libelogind*.so* ${pkgdir}/usr/lib
+ cp -rT -d --no-preserve=ownership,timestamp "$srcdir/dest/$pkgname" "$pkgdir"
}
diff --git a/pcr/elogind/protect-user-XDG_RUNTIME_DIR.patch b/pcr/elogind/protect-user-XDG_RUNTIME_DIR.patch
deleted file mode 100644
index c97569ce8..000000000
--- a/pcr/elogind/protect-user-XDG_RUNTIME_DIR.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-github.com/linuxmint/systemd-betsy commit-hash f7ab85f1e1169ac1598dfc1fba1c01063840b3c5
-
-
-Orignal Commit Author: https://github.com/clefebvre
-===================================================================
---- elogind-234.4.orig/src/login/pam_elogind.c
-+++ elogind-234.4/src/login/pam_elogind.c
-@@ -463,6 +463,15 @@
- if (r != PAM_SUCCESS)
- return r;
- }
-+ else {
-+ if (pw->pw_uid == 0) {
-+ r = pam_misc_setenv(handle, "XDG_RUNTIME_DIR", "/run/user/0", 0);
-+ if (r != PAM_SUCCESS) {
-+ pam_syslog(handle, LOG_ERR, "Failed to set runtime dir for UID 0.");
-+ return r;
-+ }
-+ }
-+ }
-
- if (!isempty(seat)) {
- r = pam_misc_setenv(handle, "XDG_SEAT", seat, 0);