diff options
-rw-r--r-- | pcr/opentmpfiles/PKGBUILD | 72 | ||||
-rw-r--r-- | pcr/opentmpfiles/opentmpfiles.hook | 10 |
2 files changed, 49 insertions, 33 deletions
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. <megver83@parabola.nu> +# Contributor: Luke Shumaker <lukeshu@parabola.nu> # Maintainer (Artix): artoo <artoo@manjaro.org> # Contributor (Artix): williamh <williamh@gentoo.org> -_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 <w.d.hubbs@gmail.com> +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 |