logo

alpine-overlay

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

APKBUILD (2486B)


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