logo

alpine-overlay

git clone https://anongit.hacktivis.me/git/alpine-overlay.git/

APKBUILD (2534B)


  1. # Maintainer: Haelwenn (lanodan) Monnier <contact+alpine@hacktivis.me>
  2. pkgname=utils-std-static
  3. tarname=utils-std
  4. pkgver=0.0.1
  5. pkgrel=0
  6. pkgdesc="Collection of commonly available Unix tools"
  7. url="https://hacktivis.me/git/utils-std"
  8. arch="all"
  9. license="MPL-2.0 0BSD BSD-2-Clause BSD-3-Clause CC0-1.0 GFDL-1.1-only WTFPL"
  10. makedepends="cmd:m4 cmd:yacc"
  11. checkdepends=""
  12. subpackages="$pkgname-dbg $pkgname-doc $pkgname-strings $pkgname-strings-doc:strings_doc"
  13. source="https://hacktivis.me/releases/utils-std/$tarname-$pkgver.tar.gz"
  14. builddir="$srcdir/$tarname-$pkgver"
  15. build() {
  16. PREFIX=/usr CRAM=true LDSTATIC='-static-pie' ./configure
  17. make
  18. }
  19. check() {
  20. # Workaround busybox rm(1) lacking -d
  21. mkdir -p busybox-overrides/
  22. ln -s ../cmd/rm busybox-overrides/rm
  23. # t gn, t gnr: missing names for group IDs in my Alpine install
  24. # t G: Busybox id(1) seems to sort numeric output
  25. sed -i \
  26. -e 's;^t gn ;skip gn ;' \
  27. -e 's;^t gnr ;skip gnr ;' \
  28. -e 's;^t G ;skip G ;' \
  29. test-cmd/id.sh
  30. PATH=$PWD/busybox-overrides/:$PATH make check
  31. }
  32. package() {
  33. make DESTDIR="$pkgdir" install
  34. # binaries that busybox puts in /bin (taken from coreutils/APKBUILD)
  35. local busybox_bin="base64 cat chgrp chmod chown cp date dd df echo false ln ls
  36. mkdir mknod mktemp mv nice printenv pwd rm rmdir sleep stat stty sync touch true uname"
  37. mkdir -p "$pkgdir"/bin/
  38. for i in $busybox_bin; do
  39. test -f cmd/$i || continue
  40. ln -s ../usr/bin/$i "$pkgdir"/bin/$i
  41. done
  42. # resolve conflict with binutils for cmd:strings
  43. rm "$pkgdir"/usr/bin/strings "$pkgdir"/usr/share/man/man1/strings.1
  44. # 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.
  45. # ERROR: utils-std-doc-0_git20240915-r0: trying to overwrite usr/share/man/man1/time.1.gz owned by man-pages-6.8-r0.
  46. rm "$pkgdir"/usr/share/man/man1/renice.1 "$pkgdir"/usr/share/man/man1/time.1
  47. }
  48. strings() {
  49. mkdir -p "$subpkgdir"/usr/bin/
  50. cp -p "$builddir"/cmd/strings "$subpkgdir"/usr/bin/
  51. }
  52. strings_doc() {
  53. local gzip=$(command -v pigz || echo gzip)
  54. depends="$depends_doc"
  55. install_if="docs $pkgname-strings=$pkgver-r$pkgrel"
  56. mkdir -p "$subpkgdir"/usr/share/man/man1/
  57. cp -p "$builddir"/cmd/strings.1 "$subpkgdir"/usr/share/man/man1/
  58. # ERROR: utils-std-strings-doc*: Found uncompressed man pages
  59. gzip -n -9 "$subpkgdir"/usr/share/man/man1/strings.1
  60. }
  61. sha512sums="
  62. b78d9adeca16187956fa32ca1743d8e707cba4aa543979243e4abe6a958c5892ef1b26982b45da50724e5af0ee31109d7d05c66751a21c77f06f04b7a56f8001 utils-std-0.0.1.tar.gz
  63. "