commit: 45de1031c5d9bfc636941177af89f6edd8b3ae03 parent 7772587ccf787e5f9aec319670852b5510519092 Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Date: Fri, 20 Dec 2024 04:31:07 +0100 lanodan/utils-std-static: new, based on lanodan/utils-stdDiffstat:
A | lanodan/utils-std-static/APKBUILD | 78 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 78 insertions(+), 0 deletions(-)diff --git a/lanodan/utils-std-static/APKBUILD b/lanodan/utils-std-static/APKBUILD
@@ -0,0 +1,78 @@ +# Maintainer: Haelwenn (lanodan) Monnier <contact+alpine@hacktivis.me> +pkgname=utils-std-static +tarname=utils-std +pkgver=0.0.1 +pkgrel=0 +pkgdesc="Collection of commonly available Unix tools" +url="https://hacktivis.me/git/utils-std" +arch="all" +license="MPL-2.0 0BSD BSD-2-Clause BSD-3-Clause CC0-1.0 GFDL-1.1-only WTFPL" +makedepends="cmd:m4 cmd:yacc" +checkdepends="" +subpackages="$pkgname-dbg $pkgname-doc $pkgname-strings $pkgname-strings-doc:strings_doc" +source="https://hacktivis.me/releases/utils-std/$tarname-$pkgver.tar.gz" +builddir="$srcdir/$tarname-$pkgver" + +build() { + PREFIX=/usr CRAM=true LDSTATIC='-static-pie' ./configure + + make +} + +check() { + # Workaround busybox rm(1) lacking -d + mkdir -p busybox-overrides/ + ln -s ../cmd/rm busybox-overrides/rm + + # t gn, t gnr: missing names for group IDs in my Alpine install + # t G: Busybox id(1) seems to sort numeric output + sed -i \ + -e 's;^t gn ;skip gn ;' \ + -e 's;^t gnr ;skip gnr ;' \ + -e 's;^t G ;skip G ;' \ + test-cmd/id.sh + + PATH=$PWD/busybox-overrides/:$PATH make check +} + +package() { + make DESTDIR="$pkgdir" install + + # binaries that busybox puts in /bin (taken from coreutils/APKBUILD) + local busybox_bin="base64 cat chgrp chmod chown cp date dd df echo false ln ls + mkdir mknod mktemp mv nice printenv pwd rm rmdir sleep stat stty sync touch true uname" + + mkdir -p "$pkgdir"/bin/ + for i in $busybox_bin; do + test -f cmd/$i || continue + ln -s ../usr/bin/$i "$pkgdir"/bin/$i + done + + # resolve conflict with binutils for cmd:strings + rm "$pkgdir"/usr/bin/strings "$pkgdir"/usr/share/man/man1/strings.1 + + # ERROR: utils-std-doc-0_git20240915-r0: trying to overwrite usr/share/man/man1/renice.1.gz owned by util-linux-doc-2.40.1-r1. + # ERROR: utils-std-doc-0_git20240915-r0: trying to overwrite usr/share/man/man1/time.1.gz owned by man-pages-6.8-r0. + rm "$pkgdir"/usr/share/man/man1/renice.1 "$pkgdir"/usr/share/man/man1/time.1 +} + +strings() { + mkdir -p "$subpkgdir"/usr/bin/ + cp -p "$builddir"/cmd/strings "$subpkgdir"/usr/bin/ +} + +strings_doc() { + local gzip=$(command -v pigz || echo gzip) + depends="$depends_doc" + install_if="docs $pkgname-strings=$pkgver-r$pkgrel" + + mkdir -p "$subpkgdir"/usr/share/man/man1/ + cp -p "$builddir"/cmd/strings.1 "$subpkgdir"/usr/share/man/man1/ + + # ERROR: utils-std-strings-doc*: Found uncompressed man pages + gzip -n -9 "$subpkgdir"/usr/share/man/man1/strings.1 +} + +sha512sums=" +b78d9adeca16187956fa32ca1743d8e707cba4aa543979243e4abe6a958c5892ef1b26982b45da50724e5af0ee31109d7d05c66751a21c77f06f04b7a56f8001 utils-std-0.0.1.tar.gz +"