summaryrefslogtreecommitdiff
path: root/pcr/opentmpfiles/PKGBUILD
blob: 24864474efc1b3c816eb5ba641aba59b5c4ce16a (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
# Maintainer: David P. <megver83@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
pkgver=0.1.3
pkgrel=6.parabola1
pkgdesc="A standalone utility for handling systemd-style tmpfiles.d settings"
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
}

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"

    install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
    install -m644 "${srcdir}/${pkgname}-${pkgver}/license" "${pkgdir}/usr/share/licenses/${pkgname}/"
}