Commit 9ba8b7c9 authored by Natanael Copa's avatar Natanael Copa
Browse files

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
parent 13a66494
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment