summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 261799bf9545760ecf465afa312de12421cc6230 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: Matt Quintanilla <matt @ matt quintanilla . xyz>
# Contributor: Marco Rubin <marco.rubin@protonmail.com>
# Contributor: EatMyVenom <eat.my.venomm@gmail.com>
# Contributor: Andrew Gregory <andrew.gregory.8@gmail.com>
# Contributor: Lone_Wolf <lonewolf at xs4all dot nl>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>

pkgname=openrc
pkgver=0.54.2
pkgrel=1
pkgdesc='Dependency based init system that works with sysvinit and systemd or on its own.'
arch=('i686' 'x86_64')
url='https://github.com/OpenRC/openrc'
license=('BSD')
depends=('pam')
optdepends=('openrc-arch-services-git: collection of services for Arch'
            'net-tools: for network service support'
            'opentmpfiles: adds support for systemd-style tmpfiles.d'
            'bash-completion: tab completion for openrc commands in bash shells'
            'zsh-completions: tab completion for openrc commands in zsh shells')
makedepends=('meson' 'pam' 'psmisc')
provides=('librc.so' 'init-rc' 'libeinfo.so' 'svc-manager')
backup=(etc/openrc/inittab
        etc/openrc/rc.conf
        etc/openrc/conf.d/{bootmisc,consolefont,devfs,dmesg,fsck,hostname,hwclock,keymaps}
        etc/openrc/conf.d/{killprocs,localmount,modules,netmount,network,staticroute})
source=("$url/archive/$pkgver.tar.gz"
        'openrc.logrotate')
b2sums=('46f7439c9cc264dee19ce3b2ae7d3ac892d302242b9de0855afdfc368bed8bea5b34d95d46327ce3ce796b5dff8e3d30f110249d60ed408a6d6d9a085c7d1c7d'
        'f283de20b5a07e3c5d21a28b9de72f0a71fd2cc1b70a5567db80373c7144aec0e6ac217eef77acbbb05eff2134c22ee6746b7f248abc4587042c456ed0a32a31')

prepare() {
    cd $pkgname-$pkgver
    # inittab does not honor SBINDIR
    sed -ie 's!/sbin/rc!/usr/bin/rc!g' support/sysvinit/inittab
}

build() {
    cd $pkgname-$pkgver
    # libexecdir and sbindir: overwrite arch-meson defaults
    # sysconfdir: avoid conflicts with other init systems
    arch-meson                       \
        --libexecdir=/usr/libexec/rc \
        --sbindir=/usr/bin           \
        -Dbash-completions=true      \
        -Dbranding='"Arch Linux"'    \
        -Dos=Linux                   \
	-Drootprefix=/usr            \
        -Dpam=true                   \
        -Dpkg_prefix=''              \
        -Dpkgconfig=true             \
        -Dselinux=disabled           \
        -Dsysconfdir=/etc/openrc     \
        -Dzsh-completions=true       \
        build
    meson compile -C build
}

package() {
    cd $pkgname-$pkgver
    meson install -C build --destdir "$pkgdir"

    # default path to inittab conflicts with initscripts
    # install -Dm644 support/sysvinit/inittab "$pkgdir/etc/inittab"

    # avoid initscripts conflict, requires openrc-sysvinit
    install -Dm644 support/sysvinit/inittab "$pkgdir/etc/openrc/inittab"

    # rotate boot log
    install -Dm0644 "$srcdir/$pkgname.logrotate" "$pkgdir/etc/logrotate.d/$pkgname"

    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}