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

_commit=b000d389f91ec182db721a3be428de04e05b9efd

pkgname=runit-scripts
pkgver=20171120
pkgrel=2
pkgdesc='Runit initscripts for GNU/Linux'
provides=('init' 'openrc-pid1')
conflicts=('init' 'openrc-pid1')
url='https://gitlab.com/Megver83/runit-scripts'
license=('GPL3')
arch=('armv7h' 'i686' 'x86_64')
depends=('procps-ng' 'awk' 'sh' 'udev' 'runit')
optdepends=('openrc: for managing services with OpenRC')
makedepends=('git')
source=("git+https://gitlab.com/Megver83/$pkgname.git#commit=${_commit}")
backup=('etc/runit/rc.conf'
        'etc/runit/rc.local'
        'etc/runit/rc.shutdown')
sha512sums=('SKIP')
install=runit.install

pkgver() {
	cd "$srcdir/$pkgname"
	git log -n1 --format='%cd' --date=format:'%Y%m%d'
}

prepare() {
	cd "$srcdir/$pkgname"
	sed 's|/sbin|/bin|' -i Makefile
}

build() {
	cd "$srcdir/$pkgname"
	make
}

package() {
	cd "$srcdir/$pkgname"

	make DESTDIR="${pkgdir}" PREFIX="/usr" install

	rm -f "${pkgdir}"/etc/runit/runsvdir/current
	install -d "${pkgdir}"/usr/bin
	ln -sT runit-init "${pkgdir}"/usr/bin/init

	# License
	mkdir -p "${pkgdir}"/usr/share/licenses/runit-scripts
	cp {COPYING,LICENSE} "${pkgdir}"/usr/share/licenses/runit-scripts/
}