summaryrefslogtreecommitdiff
path: root/pcr/opentmpfiles/PKGBUILD
blob: c25cfeeb71f566ab864816349575434ebf6618b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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>

pkgbase=opentmpfiles
pkgname=(opentmpfiles opentmpfiles-systemdcompat)
pkgver=0.1.3
pkgrel=8
pkgdesc="A standalone utility to handle systemd-style tmpfiles.d files"
arch=('any')
url="https://github.com/OpenRC/opentmpfiles"
license=('BSD2')
backup=('etc/conf.d/opentmpfiles-dev'
        'etc/conf.d/opentmpfiles-setup')
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'
            '5f0f1ce57bb8a497e2e9dd9982a9e7a366eadee6bfcca029a02aa6b9f51b56c3d938a02941851e6fcdea64f5f0472bd92f52d4d911fdeb036decf2162ac2ff2f')

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_opentmpfiles-systemdcompat() {
  pkgdesc='Compatibility wrapper for opentmpfiles providing the systemd-tmpfiles program'
  depends=('opentmpfiles')
  conflicts=('systemd-tools')

  install -d "$pkgdir"/usr/bin
  ln -s tmpfiles "$pkgdir"/usr/bin/systemd-tmpfiles
}