blob: 6aae5c6ff411174a7b6fe345da8a09f4dcf1ef74 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
pkgbase=parabola-hackers
pkgname=(parabola-hackers parabola-hackers-nshd)
pkgver=20210719
pkgrel=1
_gitver=9f2356b34595b9663c1b25674607d0c981461f2b
pkgdesc='Programs for doing magic with hackers.git'
url='https://git.parabola.nu/packages/parabola-hackers.git/'
license=('GPL')
arch=('armv7h' 'i686' 'x86_64')
makedepends=('go' 'git')
source=("parabola-hackers::git://git.parabola.nu/packages/parabola-hackers.git#commit=${_gitver}"
LICENSE.lgpl-2.1.txt::https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
LICENSE.gpl-2.txt::https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
LICENSE.apache-2.0.txt::https://www.apache.org/licenses/LICENSE-2.0
LICENSE.wtfpl-2.txt::http://www.wtfpl.net/txt/copying/)
_gomodules=("git.lukeshu.com/go/libgnulinux#branch=master"
"git.lukeshu.com/go/libnslcd#branch=master"
"git.lukeshu.com/go/libsystemd#commit=0a43955"
"github.com/pkg/errors#tag=v0.8.0"
"go.googlesource.com/sys#commit=bb9c189"
"gopkg.in/check.v1#commit=20d25e2"
"gopkg.in/yaml.v2#commit=5420a8b")
for _gomodule in "${_gomodules[@]}"; do
source+=("gopkg-$(sed -e 's/#.*//' -e 's/\//_/g' <<<"$_gomodule")::git+https://$_gomodule")
done
sha256sums=('SKIP'
'dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551'
'8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643'
'cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30'
'0356258391e190dc1d44ea01565cfe627fe44e27dad693a0a54c2483a7b223e5'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP')
pkgver() {
cd "$srcdir/$pkgbase"
grep VERSION < config.mk | awk '{print $3}'
}
prepare() {
mv -Tv gopkg-go.googlesource.com_sys "$srcdir/$pkgbase"/go/src/golang.org/x/sys
for gopkg in gopkg-*; do
mv -Tv "$gopkg" "$srcdir/$pkgbase"/go/src/"$(sed 's/_/\//g' <<<"${gopkg#gopkg-}")"
done
cd "$srcdir/$pkgbase"
printf '%s\n' \
prefix='/usr' \
bindir='$(libexecdir)/$(PACKAGE)' \
libexecdir='$(libdir)' \
sysconfdir='/etc' \
>> config.mk
mv -v "$srcdir"/LICENSE* .
git submodule update --init
# FIXME: fix this upstream
# GOPATH='/build/parabola-hackers/src/parabola-hackers/go' AR='ar' CC='gcc -std=gnu99' CGO_ENABLED='1' go install nshd
# go install: version is required when current directory is not in a module
# Try 'go install nshd@latest' to install the latest version
# NOTE: this kludge is very brittle - it would (probably) fail if bins_go contained multiple items
# luckily, the golang 'nshd' is not likely to ever change
sed -i 's|$(go_env) go install $(bins_go)|$(go_env) go install $(bins_go)@latest|' Makefile
# FIXME: the above kludge did not work
# GOPATH='/build/parabola-hackers/src/parabola-hackers/go' AR='ar' CC='gcc -std=gnu99' CGO_ENABLED='1' go install nshd@latest
# go install nshd@latest: malformed module path "nshd": missing dot in first path element
}
build() {
cd "$srcdir/$pkgbase"
make
}
check() {
# On armv7h the tests fails with:
# | FAIL gopkg.in/yaml.v2 [build failed]
if [ "$CARCH" != "armv7h" ]; then
cd "$srcdir/$pkgbase"
make check
fi
}
package_parabola-hackers() {
backup=(etc/$pkgbase.yml)
depends=('ruby' 'colordiff')
cd "$srcdir/$pkgbase"
make DESTDIR="${pkgdir}" install
find "$pkgdir" -type f \( -name 'nshd*' -o -name shadow \) -delete
find "$pkgdir" -type d -empty -exec rmdir -p --ignore-fail-on-non-empty -- {} +
}
package_parabola-hackers-nshd() {
pkgdesc='NSS and PAM integration for parabola-hackers'
license=('GPL3')
depends=("parabola-hackers=$pkgver" 'nss-pam-ldapd')
backup=(etc/nshd/shadow)
install=parabola-hackers-nshd.install
replaces=(nshd)
conflicts=(nshd)
cd "$srcdir/$pkgbase"
make DESTDIR="${pkgdir}" install
find "$pkgdir" -type f -not \( -name 'nshd*' -o -name shadow \) -delete
find "$pkgdir" -type d -empty -exec rmdir -p --ignore-fail-on-non-empty -- {} +
install -d "${pkgdir}/usr/share/licenses/${pkgname}"
cp -t "${pkgdir}/usr/share/licenses/${pkgname}" -- LICENSE.txt LICENSE.bsd*.txt
}
|