From 9ba8b7c9fd89f59ca397b08af14e28da79bd0b4a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 5 May 2016 07:19:30 +0000 Subject: community/tini: move to /sbin and add static build keep /usr/bin/tini for backward compat for a while https://github.com/krallin/tini/issues/38#issuecomment-217121729 --- community/tini/APKBUILD | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'community/tini') diff --git a/community/tini/APKBUILD b/community/tini/APKBUILD index 66bbfd0383..44565983e4 100644 --- a/community/tini/APKBUILD +++ b/community/tini/APKBUILD @@ -2,7 +2,7 @@ pkgname=tini pkgver=0.9.0 -pkgrel=0 +pkgrel=1 pkgdesc="A tiny but valid init for containers" url="https://github.com/krallin/tini" arch="all" @@ -11,21 +11,42 @@ depends="" depends_dev="" makedepends="$depends_dev cmake" install="" -subpackages="" +subpackages="$pkgname-static" source="$pkgname-$pkgver.tar.gz::https://github.com/krallin/tini/archive/v$pkgver.tar.gz" -_builddir="$srcdir"/$pkgname-$pkgver +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 + 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"/usr/bin/tini || return 1 + cd "$builddir" + install -D -m755 tini "$pkgdir"/sbin/tini || return 1 + + # compat wrapper + mkdir -p "$pkgdir"/usr/bin + cat > "$pkgdir"/usr/bin/tini <&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" -- cgit v1.2.3