logo

alpine-overlay

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

APKBUILD (3658B)


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