summaryrefslogtreecommitdiff
path: root/pcr/runit/PKGBUILD
blob: 2ca8c29109186915835fc0c97b829adce9b727c9 (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
# Maintainer: David P. <megver83@parabola.nu>
# Maintainer (Artix): Chris Cromer <chris@cromer.cl>

pkgbase=runit
pkgname=('runit' 'runit-doc')
pkgver=2.1.2
pkgrel=1.parabola4
arch=('armv7h' 'i686' 'x86_64')
url='http://smarden.org/runit/'
license=('BSD3')
source=("http://smarden.org/${pkgname}/${pkgbase}-${pkgver}.tar.gz")
sha512sums=('a18773ebf1aa22305dd89ed67363165b9fcf86c192b2be4e268d08005dd82d51265160c637abe072f2f2e378c4b315a75bd3d3e602c3e75bdd451a3b0190f8cf')

prepare() {
	# set default service path to /run/runit/service
	cd "${srcdir}/admin/${pkgbase}-${pkgver}"
	sed -i 's|"/service/"|"/run/runit/service/"|' src/sv.c
}

build() {
	cd "${srcdir}/admin/${pkgbase}-${pkgver}"

	CFLAGS="${CFLAGS} -static"
	LDFLAGS="${LDFLAGS} -static"

	package/compile
}

check() {
	cd "${srcdir}/admin/${pkgbase}-${pkgver}"
	package/check
}

package_runit() {
	pkgdesc='Cross-platform Unix init scheme with service supervision'
	depends=('bash' 'runit-init' 'util-linux')
	optdepends=('runit-doc: documentation')
	provides=('init')
    groups=('init')
    conflicts=('systemd-sysvcompat' 'sysvinit' 'init')
	# commands
	mkdir -p "${pkgdir}/usr/bin"
	install -Dm755 ${srcdir}/admin/${pkgbase}-${pkgver}/command/* "${pkgdir}/usr/bin"

	# man pages
	mkdir -p "${pkgdir}/usr/share/man/man8"
	install -Dm644 ${srcdir}/admin/${pkgbase}-${pkgver}/man/* "${pkgdir}/usr/share/man/man8"

	# default directories
	mkdir -p "$pkgdir/etc/runit/runsvdir/default"

	# license
	install -Dm644 "${srcdir}/admin/${pkgbase}-${pkgver}/package/COPYING" "$pkgdir/usr/share/licenses/runit/COPYING"
	
	# init
	ln -sf runit-init "${pkgdir}/usr/bin/init"
}

package_runit-doc() {
    pkgdesc='Documentation for the runit init system'
	groups=('init-doc')
	arch=('any')
	install -v -m755 -d "${pkgdir}/usr/share/doc"
	cp -r "${srcdir}/admin/${pkgbase}-${pkgver}/doc" "${pkgdir}/usr/share/doc/${pkgbase}-${pkgver}"
	rm "${pkgdir}/usr/share/doc/${pkgbase}-${pkgver}/debian"
}