blob: cf184c42976ca8338e590a593978a64b31a64c94 (
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
|
# Maintainer: Kevin MacMartin <prurigro@gmail.com>
# Contributor: Iiridayn
# Contributor: hucsmn
# Contributor: mqs
_binname=stdiscosrv
_pkgname=syncthing
pkgname=$_pkgname-discosrv
epoch=1
pkgver=1.18.3
pkgrel=1
pkgdesc='Discover server for the syncthing P2P synchronization utility'
url='http://syncthing.net'
license=('MIT')
install=$pkgname.install
depends=('glibc')
makedepends=('go')
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
source=(
"https://github.com/$_pkgname/$_pkgname/archive/v$pkgver.tar.gz"
"$pkgname.service"
"$pkgname.tmpfiles.conf"
)
sha512sums=(
'd667fcdecc2f810d98e7da5fc9e00d4abebb68f31130363cd4982de47bb8550029cc9285d1b1242a5d9510dcb8db11aa44877bb48750b87a09895476a08669a4'
'f67a6051a1bbe9d3b562caaaecfc4829afa25cfddc5d5dd70dc8170bddc9d938fd85ab89b1c198f074f323d8e385d9fa8bc3a9bfe53594629dbfbf984c2e7015'
'28b0bb6a6f2fa536ec8cb887cfebf4706be25af5e29da39e2e3776daeeeb48f75fb5be255472920355948d8905830342866e89299facd626ddf8a658d84faf27'
)
prepare() {
rm -rf src
install -d src/github.com/$_pkgname
mv $_pkgname-$pkgver src/github.com/$_pkgname/$_pkgname
cd src/github.com/$_pkgname/$_pkgname
go mod vendor -modcacherw
}
build() {
export GOPATH="$srcdir"
cd src/github.com/$_pkgname/$_pkgname/cmd/stdiscosrv
go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
.
}
package() {
# Install systemd service and tmpfiles config
install -Dm644 $pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
install -Dm644 $pkgname.tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
# Install license and list of authors
cd src/github.com/$_pkgname/$_pkgname
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 AUTHORS "$pkgdir/usr/share/licenses/$pkgname/AUTHORS"
# Install the man page
install -Dm644 man/$_binname.1 "$pkgdir/usr/share/man/man1/$pkgname.1"
# Install the binary
install -Dm755 cmd/$_binname/$_binname "$pkgdir/usr/bin/$pkgname"
}
|