summaryrefslogtreecommitdiff
path: root/pcr/opentmpfiles/PKGBUILD
blob: 69be963f2fec3ab0b0ea8903b27480e4d46c3155 (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
# Maintainer (Manjaro): artoo <artoo@manjaro.org>
# Contributor (Manjaro): williamh <williamh@gentoo.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_url="https://github.com/OpenRC/opentmpfiles/archive"

pkgname=opentmpfiles
pkgver=0.1.3
pkgrel=1
pkgdesc="A standalone utility for handling systemd-style tmpfiles.d settings"
arch=('any')
url="http://www.gentoo.org/proj/en/base/openrc/"
license=('BSD2')
groups=('openrc-base')
depends=('openrc')
backup=('etc/conf.d/opentmpfiles-dev'
        'etc/conf.d/opentmpfiles-setup')
source=("${pkgname}-${pkgver}.tar.gz::${_url}/${pkgver}.tar.gz")
sha256sums=('1fdd4587c62d815296fb4162002cf001e3ed7aae8727d9b4360f527169e6b3be')

_inst_initd(){
    install -Dm755 openrc/$1.initd ${pkgdir}/etc/init.d/$1
    sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|' \
        -i ${pkgdir}/etc/init.d/$1
}

_inst_confd(){
    install -Dm755 openrc/$1.confd ${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"
}