PKGBUILD 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # SPDX-License-Identifier: CC0-1.0
  2. # Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
  3. # Contributor: bill-auger <bill-auger@programmer.net>
  4. pkgbase=parabola-hackers
  5. pkgname=(parabola-hackers parabola-hackers-nshd)
  6. pkgver=20220802
  7. pkgrel=1
  8. pkgdesc='Programs for doing magic with hackers.git'
  9. url='https://git.parabola.nu/packages/parabola-hackers.git/'
  10. license=('GPL')
  11. arch=('armv7h' 'i686' 'x86_64')
  12. makedepends=('git' 'go')
  13. source=("parabola-hackers::git://git.parabola.nu/packages/parabola-hackers.git#tag=v${pkgver}")
  14. _go_sources=("git.lukeshu.com/go/libgnulinux#branch=master"
  15. "git.lukeshu.com/go/libnslcd#branch=master"
  16. "git.lukeshu.com/go/libsystemd#commit=0a43955"
  17. "github.com/pkg/errors#tag=v0.8.0"
  18. "go.googlesource.com/sys#commit=bb9c189"
  19. "gopkg.in/check.v1#commit=20d25e2"
  20. "gopkg.in/yaml.v2#commit=5420a8b")
  21. for _src in ${_go_sources[*]}; do
  22. source+=("gopkg-$(sed -e 's/#.*//' -e 's/\//_/g' <<<"$_src")::git+https://$_src")
  23. done
  24. sha256sums=(SKIP)
  25. sha256sums+=( $(echo ${_go_sources[*]/*/SKIP}) )
  26. prepare() {
  27. # verify versioning
  28. local go_pkg_ver=$(grep VERSION "$srcdir"/$pkgbase/config.mk | awk '{print $3}')
  29. local err_msg="VERSION in config.mk does not match the git tag (aka: pkgver)"
  30. [[ "$go_pkg_ver" == "$pkgver" ]] || ! echo "$err_msg" || return 1
  31. # install golang deps
  32. mv -Tv gopkg-go.googlesource.com_sys "$srcdir/$pkgbase"/go/src/golang.org/x/sys
  33. for gopkg in gopkg-*; do
  34. mv -Tv "$gopkg" "$srcdir/$pkgbase"/go/src/"$(sed 's/_/\//g' <<<"${gopkg#gopkg-}")"
  35. done
  36. # load git submodules
  37. cd "$srcdir/$pkgbase"
  38. git submodule update --init
  39. }
  40. build() {
  41. cd "$srcdir/$pkgbase"
  42. make
  43. }
  44. check() {
  45. # FIXME:
  46. # On armv7h the tests fail with:
  47. # FAIL gopkg.in/yaml.v2 [build failed]
  48. # On x86_64 the tests fail with:
  49. # FAIL: TestSCMCredentials (0.00s)
  50. # fatal error: checkptr: pointer arithmetic result points to invalid allocation
  51. # FAIL golang.org/x/sys/unix 0.288s
  52. cd "$srcdir/$pkgbase"
  53. # make check
  54. make check || :
  55. }
  56. package_parabola-hackers() {
  57. backup=(etc/$pkgbase.yml)
  58. depends=('ruby' 'colordiff')
  59. cd "$srcdir/$pkgbase"
  60. make DESTDIR="${pkgdir}" install
  61. # cleanup 'parabola-hackers-nshd' files
  62. find "$pkgdir" -type f \( -name 'nshd*' -o -name shadow \) -delete
  63. find "$pkgdir" -type d -empty -exec rmdir -p --ignore-fail-on-non-empty -- {} +
  64. }
  65. package_parabola-hackers-nshd() {
  66. pkgdesc='NSS and PAM integration for parabola-hackers'
  67. license=(AGPL3 Apache custom:BSD2 custom:BSD3 GPL LGPL2.1 WTFPL2)
  68. depends=("parabola-hackers=$pkgver" 'nss-pam-ldapd')
  69. backup=(etc/nshd/shadow)
  70. install=parabola-hackers-nshd.install
  71. replaces=(nshd)
  72. conflicts=(nshd)
  73. cd "$srcdir/$pkgbase"
  74. make DESTDIR="${pkgdir}" install
  75. # cleanup 'parabola-hackers' files
  76. find "$pkgdir" -type f -not \( -name 'nshd*' -o -name shadow \) -delete
  77. find "$pkgdir" -type d -empty -exec rmdir -p --ignore-fail-on-non-empty -- {} +
  78. # install licenses
  79. install -d "${pkgdir}/usr/share/licenses/${pkgname}"
  80. cp LICENSES.txt LICENSE.bsd* "${pkgdir}/usr/share/licenses/${pkgname}"
  81. }