APKBUILD 2.35 KB
Newer Older
1
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
2
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
3
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
4
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
5
pkgname=syncthing
Leo's avatar
Leo committed
6
pkgver=1.10.0
Leo's avatar
Leo committed
7
pkgrel=0
8
pkgdesc="Open Source Continuous File Synchronization"
TBK's avatar
TBK committed
9
options="chmod-clean"
10
url="https://syncthing.net/"
11
arch="all !mips !mips64" # go is missing
12
arch="$arch !ppc64le !aarch64" # Tests fail
13
license="MPL-2.0"
14
15
pkgusers="$pkgname"
pkggroups="$pkgname"
16
makedepends="go"
17
install="$pkgname.pre-install"
TBK's avatar
TBK committed
18
19
subpackages="$pkgname-doc $pkgname-utils $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/syncthing/syncthing/archive/v$pkgver.tar.gz
20
	only-test-with-race-when-provided.patch
opal hart's avatar
opal hart committed
21
	$pkgname.initd
22
	"
23
24

build() {
TBK's avatar
TBK committed
25
26
27
28
29
30
	# Build syncthing + server utils
	local cmd
	for cmd in syncthing stdiscosrv strelaypoolsrv strelaysrv; do
		echo "Compiling $cmd"
		go run build.go -no-upgrade -version=v$pkgver install $cmd
	done
31
32
}

33
check() {
Shiz ...'s avatar
Shiz ... committed
34
	go run build.go -no-upgrade test
35
36
}

37
package() {
38
	install -d -o $pkgname -g $pkgname "$pkgdir"/var/lib/$pkgname
TBK's avatar
TBK committed
39
	install -D -m755 "$builddir"/bin/$pkgname "$pkgdir"/usr/bin/$pkgname
40
	install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
TBK's avatar
TBK committed
41

42
43
44
	# Desktop files so people in Desktop Environments can put them on Autostart
	install -Dm0644 etc/linux-desktop/*.desktop -t "$pkgdir"/usr/share/applications

TBK's avatar
TBK committed
45
46
47
48
49
50
51
52
53
54
55
56
	# man pages
	cd "$builddir/man"
	local file
	for file in *.1; do
		install -Dm644 "$file" "$pkgdir"/usr/share/man/man1/"$file"
	done
	for file in *.5; do
		install -Dm644 "$file" "$pkgdir"/usr/share/man/man5/"$file"
	done
	for file in *.7; do
		install -Dm644 "$file" "$pkgdir"/usr/share/man/man7/"$file"
	done
57
58
}

59
utils() {
TBK's avatar
TBK committed
60
61
62
	cd "$builddir/bin"
	pkgdesc="Syncthing server utilities"
	for i in *; do
63
		if ! [ "$i" = "$pkgname" ]; then
TBK's avatar
TBK committed
64
			install -Dm 755 "$builddir"/bin/"$i" "$subpkgdir"/usr/bin/"$i"
65
66
67
68
		fi
	done
}

Leo's avatar
Leo committed
69
sha512sums="c47d48684c66ed3257ba8e6cb36e01375a9f132faaa27ef99a761a1420cadeeecf6e9b62d953ca2e71be174d17d715b7d65558eb7a4e5af05e5b6f2c1a31efc5  syncthing-1.10.0.tar.gz
TBK's avatar
TBK committed
70
81bcb6b2e0956624b596201d1de24a3b6fcb10d08761f2c426081350b611295a7f4d47775d175f2ee5dbbb289b98bc022389fc9992f0d31bcdbfde855ceafaf8  only-test-with-race-when-provided.patch
opal hart's avatar
opal hart committed
71
7fe49210180827c28f3ee9a1a95da3884dbef34de9bdc643f4455c9a056adba81f16c1c6ac059e83bee360aea091ace98b8a6f4c4b26a32c450f61f15206d3f5  syncthing.initd"