mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-06 13:57:14 +02:00
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
This commit is contained in:
parent
13a664944d
commit
9ba8b7c9fd
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user