blob: 9e7e047f34a8ae7a4aaf883994a70417e571c506 (
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
# Maintainer: Moses Narrow <moe_narrow@use.startmail.com>
# Maintainer: Rudi [KittyCash] <rudi@skycoinmail.com>
projectname=skycoin
pkgname=skywire
pkgname1=skywire
githuborg=SkycoinProject
pkgdesc="TESTNET Skywire: Building a New Internet. Skycoin.com"
pkgver='autogenerated'
#pkgver='autogenerated'
pkggopath="github.com/${githuborg}/${pkgname1}"
pkgrel=7
#pkgrel=7
arch=('any')
url="https://${pkggopath}"
license=()
makedepends=(git go skycoin-keyring)
provides=('skywire')
conflicts=('skywire-mainnet')
source=("git+${url}.git#branch=${BRANCH:-master}"
"skywire-scripts.tar.gz"
"skywire-systemd.tar.gz"
"PKGBUILD.sig")
sha256sums=('SKIP'
'd7b865e9b794d0889c1044cee25d1c1aad1fdd2c4256da18c11b3b19e218224a'
'5b110b1ce7544d46f52934b742fcb819dbfc50c78702e93a1efa3246d14af45b'
'SKIP')
validpgpkeys=('DE08F924EEE93832DABC642CA8DC761B1C0C0CFC' # Moses Narrow <moe_narrow@use.startmail.com>
'98F934F04F9334B81DFA3398913BBD5206B19620') #iketheadore skycoin <luxairlake@protonmail.com>
#tar -czvf skywire-scripts.tar.gz skywire-scripts
#tar -czvf skywire-systemd.tar.gz skywire-systemd
export GOOS=linux
export GOPATH=${srcdir}
export CGO_ENABLED=0
case "$CARCH" in
x86) export GOARCH="386" GO386="387" ;;
x86_64) export GOARCH="amd64" ;;
arm*) export GOARCH="arm" ;;
armel) export GOARCH="arm" GOARM="5" ;;
armhf) export GOARCH="arm" GOARM="6" ;;
armv7) export GOARCH="arm" GOARM="7" ;;
armv8) export GOARCH="arm64" ;;
aarch64) export GOARCH="arm64" ;;
mips) export GOARCH="mips" ;;
mips64) export GOARCH="mips64" ;;
mips64el) export GOARCH="mips64le" ;;
mipsel) export GOARCH="mipsle" ;;
*) return 1 ;;
esac
pkgver() {
cd ${srcdir}/${pkgname1}
local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
local count=$(git rev-list --count HEAD)
local commit=$(git rev-parse --short HEAD)
echo "${date}.${count}_${commit}"
}
prepare() {
#verify PKGBUILD signature
gpg --verify ${srcdir}/PKGBUILD.sig ../PKGBUILD
# https://wiki.archlinux.org/index.php/Go_package_guidelines
mkdir -p ${srcdir}/go/src/github.com/${githuborg}/ ${srcdir}/go/bin
ln -rTsf ${srcdir}/${pkgname1} ${srcdir}/go/src/github.com/${githuborg}/${pkgname1}
cd ${srcdir}/go/src/github.com/${githuborg}/${pkgname1}/cmd
git checkout master
git submodule --quiet update --init --recursive
}
build() {
export GOPATH=${srcdir}/go
export GOBIN=${GOPATH}/bin
export PATH=${GOPATH}/bin:${PATH}
cmddir=${srcdir}/go/src/github.com/${githuborg}/${pkgname1}/cmd
#using go build for determinism
cd ${cmddir}/skywire-manager
msg2 'building skywire-manager binary'
go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ .
cd ${cmddir}/skywire-node
msg2 'building skywire-node binary'
go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ .
cd ${cmddir}/socks/socksc
msg2 'building skywire-socksc binary'
go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ .
cd ${cmddir}/socks/sockss
msg2 'building skywire-sockss binary'
go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ .
cd ${cmddir}/ssh/sshc
msg2 'building skywire-sshc binary'
go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ .
cd ${cmddir}/ssh/sshs
msg2 'building skywire-sshs binary'
go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ .
#binary transparency
cd $GOBIN
msg2 'binary sha256sums'
sha256sum $(ls)
}
package() {
options=(!strip staticlibs)
#create directory trees
mkdir -p ${pkgdir}/usr/bin
mkdir -p ${pkgdir}/usr/lib/${projectname}/go/bin
mkdir -p ${pkgdir}/usr/lib/${projectname}/${pkgname1}/
#restate go envs
export GOPATH=${pkgdir}/usr/lib/${projectname}/go
export GOBIN=${pkgdir}/usr/lib/${projectname}/go/bin
#install binaries & symlink to /usr/bin
msg2 'installing binaries'
skybins=${srcdir}/go/bin
#collect the binaries & install
skywirebins=$(ls $srcdir/go/bin/)
for i in ${skywirebins}; do
install -Dm755 ${srcdir}/go/bin/${i} ${GOBIN}/${i}
ln -rTsf ${GOBIN}/${i} ${pkgdir}/usr/bin/${pkgname1}-${i}
chmod 755 ${GOBIN}/${i}
done
mv ${pkgdir}/usr/bin/${pkgname1}-${pkgname1}-manager ${pkgdir}/usr/bin/${pkgname1}-manager
mv ${pkgdir}/usr/bin/${pkgname1}-${pkgname1}-node ${pkgdir}/usr/bin/${pkgname1}-node
#install the web dir
cp -r ${srcdir}/${pkgname1}/static ${pkgdir}/usr/lib/${projectname}/${pkgname1}/
mkdir -p ${pkgdir}/usr/share/doc/${projectname}/${pkgname1}
#install the docs
cp -r ${srcdir}/${pkgname1}/docs/api ${pkgdir}/usr/share/doc/${projectname}/${pkgname1}-manager
#install the scripts
skywirescripts=$(ls $srcdir/$pkgname1-scripts/)
for i in ${skywirescripts}; do
install -Dm755 ${srcdir}/${pkgname1}-scripts/${i} ${GOBIN}/${i}
ln -rTsf ${GOBIN}/${i} ${pkgdir}/usr/bin/${i}
chmod 755 ${pkgdir}/usr/lib/${projectname}/go/bin/${i}
done
#install the system.d services
install -Dm644 ${srcdir}/${pkgname1}-systemd/${pkgname1}-manager.service ${pkgdir}/usr/lib/systemd/system/${pkgname1}-manager.service
install -Dm644 ${srcdir}/${pkgname1}-systemd/${pkgname1}-node.service ${pkgdir}/usr/lib/systemd/system/${pkgname1}-node.service
}
|