From f635764077b2b695681e4d098a0489c2a3ff390a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 27 Jul 2018 20:11:16 -0400 Subject: pcr/opentmpfiles: Split off opentmpfiles-systemdcompat, improve - Remove pointless boilerplate - Use git signed tag - Don't include the "systemd-tmpfiles" program in the main package, as to not conflict with notsystemd. - Add a pacman hook similar to systemd --- pcr/opentmpfiles/PKGBUILD | 72 +++++++++++++++++++++----------------- pcr/opentmpfiles/opentmpfiles.hook | 10 ++++++ 2 files changed, 49 insertions(+), 33 deletions(-) create mode 100644 pcr/opentmpfiles/opentmpfiles.hook diff --git a/pcr/opentmpfiles/PKGBUILD b/pcr/opentmpfiles/PKGBUILD index 24864474e..3e01e3d2b 100644 --- a/pcr/opentmpfiles/PKGBUILD +++ b/pcr/opentmpfiles/PKGBUILD @@ -1,47 +1,53 @@ # Maintainer: David P. +# Contributor: Luke Shumaker # Maintainer (Artix): artoo # Contributor (Artix): williamh -_sed_args+=(-e 's|#!/sbin/runscript|#!/usr/bin/openrc-run|g') - -pkgname=opentmpfiles +pkgbase=opentmpfiles +pkgname=(opentmpfiles opentmpfiles-systemdcompat) pkgver=0.1.3 -pkgrel=6.parabola1 -pkgdesc="A standalone utility for handling systemd-style tmpfiles.d settings" +pkgrel=7 +pkgdesc="A standalone utility to handle systemd-style tmpfiles.d files" arch=('any') url="https://github.com/OpenRC/opentmpfiles" license=('BSD2') -depends=('pacman') backup=('etc/conf.d/opentmpfiles-dev' 'etc/conf.d/opentmpfiles-setup') -source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz") -sha512sums=('fd0b10ebfeb621466edadede50ec6e8f415861ab3b14b833c75bd71f7296e9c091e59144d39e1f9efd342b6d97776cade5a692c941085e33e9651fd885da7121') - -_inst_initd(){ - install -Dm755 openrc/$1.initd ${pkgdir}/etc/init.d/$1 -} - -_inst_confd(){ - install -Dm755 openrc/$1.confd ${pkgdir}/etc/conf.d/$1 - - sed "${_sed_args[@]}" -i ${pkgdir}/etc/conf.d/$1 +makedepends=('git') +validpgpkeys=('D57AEC44668E2E5073A440096E5416F430C46538') # William Hubbs +source=("git+https://github.com/OpenRC/opentmpfiles#tag=${pkgver}?signed" + 'opentmpfiles.hook') +sha512sums=('SKIP' + '8b3e4af592d5c81bc1f965cb2d70637180821f5cebd947e900f8cdbded66825a3e642857137a781cd443ed17df19b91cf3009a3a590f8e63fa490c74897a0707') + +package_opentmpfiles() { + optdepends=('opentmpfiles-systemdcompat') + + cd "${srcdir}/${pkgname}" + + make bindir="/usr/bin" DESTDIR="${pkgdir}" install + install -Dm644 license "${pkgdir}/usr/share/licenses/${pkgname}/license.txt" + + # OpenRC + install -Dm755 openrc/opentmpfiles-dev.confd "$pkgdir"/etc/conf.d/opentmpfiles-dev + install -Dm755 openrc/opentmpfiles-dev.initd "$pkgdir"/etc/init.d/opentmpfiles-dev + install -Dm755 openrc/opentmpfiles-setup.confd "$pkgdir"/etc/conf.d/opentmpfiles-setup + install -Dm755 openrc/opentmpfiles-setup.initd "$pkgdir"/etc/init.d/opentmpfiles-setup + + # Gentoo does this on post-install + install -d "${pkgdir}"/etc/runlevels/{boot,sysinit} + ln -sT "/etc/init.d/opentmpfiles-dev" "${pkgdir}/etc/runlevels/sysinit/opentmpfiles-dev" + ln -sT "/etc/init.d/opentmpfiles-setup" "${pkgdir}/etc/runlevels/boot/opentmpfiles-setup" + + # pacman hooks (based on libre/systemd) + install -Dm644 -t "$pkgdir"/usr/share/libalpm/hooks ../opentmpfiles.hook } -package() { - cd "${srcdir}/${pkgname}-${pkgver}" - make bindir="/usr/bin" DESTDIR="${pkgdir}" install - - for f in opentmpfiles-dev opentmpfiles-setup; do - _inst_confd "$f" - _inst_initd "$f" - done - - install -dm755 ${pkgdir}/etc/runlevels/{boot,sysinit} - ln -snf "/etc/init.d/opentmpfiles-dev" "${pkgdir}/etc/runlevels/sysinit/opentmpfiles-dev" - ln -snf "/etc/init.d/opentmpfiles-setup" "${pkgdir}/etc/runlevels/boot/opentmpfiles-setup" - - ln -snf "/usr/bin/tmpfiles" "${pkgdir}/usr/bin/systemd-tmpfiles" +package_opentmpfiles-systemdcompat() { + pkgdesc='Compatibility wrapper for opentmpfiles providing the systemd-tmpfiles program' + depends=('opentmpfiles') + conflicts=('systemd-tools') - install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}" - install -m644 "${srcdir}/${pkgname}-${pkgver}/license" "${pkgdir}/usr/share/licenses/${pkgname}/" + install -d "$pkgdir"/usr/bin + ln -s tmpfiles "$pkgdir"/usr/bin/systemd-tmpfiles } diff --git a/pcr/opentmpfiles/opentmpfiles.hook b/pcr/opentmpfiles/opentmpfiles.hook new file mode 100644 index 000000000..8fd7e9a9b --- /dev/null +++ b/pcr/opentmpfiles/opentmpfiles.hook @@ -0,0 +1,10 @@ +[Trigger] +Type = File +Operation = Install +Operation = Upgrade +Target = usr/lib/tmpfiles.d/*.conf + +[Action] +Description = Creating temporary files... +When = PostTransaction +Exec = /usr/bin/systemd-tmpfiles --create -- cgit v1.2.3