diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-05-05 07:19:30 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-05-05 11:05:35 +0000 |
commit | 9ba8b7c9fd89f59ca397b08af14e28da79bd0b4a (patch) | |
tree | 2467eeba0191c97f90a71ec7f3ca371c7048ea24 /community/tini/APKBUILD | |
parent | 13a664944d088525dd5a577558efa63167235456 (diff) | |
download | aports-9ba8b7c9fd89f59ca397b08af14e28da79bd0b4a.tar.bz2 aports-9ba8b7c9fd89f59ca397b08af14e28da79bd0b4a.tar.xz |
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
Diffstat (limited to 'community/tini/APKBUILD')
-rw-r--r-- | community/tini/APKBUILD | 39 |
1 files changed, 30 insertions, 9 deletions
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 <<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" |