aboutsummaryrefslogtreecommitdiffstats
path: root/community/tini/APKBUILD
blob: 44565983e44b6c5924d50da5ffc4db2058fdb276 (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
# Maintainer: Danilo Bürger <danilo@feastr.de>

pkgname=tini
pkgver=0.9.0
pkgrel=1
pkgdesc="A tiny but valid init for containers"
url="https://github.com/krallin/tini"
arch="all"
license="MIT"
depends=""
depends_dev=""
makedepends="$depends_dev cmake"
install=""
subpackages="$pkgname-static"
source="$pkgname-$pkgver.tar.gz::https://github.com/krallin/tini/archive/v$pkgver.tar.gz"

builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	export CFLAGS="-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
	cmake . || return 1
	make || return 1
	make tini-static || return 1
}

package() {
	cd "$builddir"
	install -D -m755 tini "$pkgdir"/sbin/tini || return 1

	# compat wrapper
	mkdir -p "$pkgdir"/usr/bin
	cat > "$pkgdir"/usr/bin/tini <<EOF
#!/bin/sh
echo 'WARNING: Tini has been relocated to /sbin/tini.
Please update your scripts to use /sbin/tini going forward.
/usr/bin/tini has been preserved for backwards compatibility in Alpine 3.4,
but WILL BE REMOVED in Alpine 3.5.
' >&2

exec /sbin/tini "\$@"
EOF
	chmod 755 "$pkgdir"/usr/bin/tini
}

static() {
	cd "$builddir"
	pkgdesc="Static build of tini"
	install -D -m755 tini-static "$subpkgdir"/sbin/tini-static || return 1
}

md5sums="efd014cf45babe76415c4d6caee643d8  tini-0.9.0.tar.gz"
sha256sums="e327772e52b6c696650401b09677e34d5d72dda19036a0300994b99c9a123bbb  tini-0.9.0.tar.gz"
sha512sums="6eb75390903b76e5f9eed92df387362d079c2b7df1976171dfcbdcf0c97e587514f21b0d1a7c4d9f607dffe16ab4d5582eb02890abb658c176123e8b29e5fe86  tini-0.9.0.tar.gz"