# Contributor: Łukasz Jendrysik # Contributor: Carlo Landmeter # Contributor: Sören Tempel # Maintainer: Natanael Copa pkgname=syncthing pkgver=1.23.6 pkgrel=2 pkgdesc="Open Source Continuous File Synchronization" url="https://syncthing.net/" arch="all" license="MPL-2.0" pkgusers="$pkgname" pkggroups="$pkgname" makedepends="go" install="$pkgname.pre-install" subpackages="$pkgname-doc $pkgname-utils $pkgname-openrc" source="$pkgname-$pkgver.tar.gz::https://github.com/syncthing/syncthing/archive/v$pkgver.tar.gz only-test-with-race-when-provided.patch $pkgname.initd " options="chmod-clean" # secfixes: # 1.15.1-r0: # - CVE-2021-21404 export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" case "$CARCH" in # oom on tests arm*) options="$options !check" ;; esac build() { # 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 } check() { # shellcheck disable=2046 # very flake go test $(go list ./lib/... ./cmd/... | grep -Ev '(lib/model)') } package() { install -d -o $pkgname -g $pkgname "$pkgdir"/var/lib/$pkgname install -D -m755 "$builddir"/bin/$pkgname "$pkgdir"/usr/bin/$pkgname install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname # Desktop files so people in Desktop Environments can put them on Autostart install -Dm0644 etc/linux-desktop/*.desktop -t "$pkgdir"/usr/share/applications # 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 } utils() { cd "$builddir/bin" pkgdesc="Syncthing server utilities" for i in *; do if ! [ "$i" = "$pkgname" ]; then install -Dm 755 "$builddir"/bin/"$i" "$subpkgdir"/usr/bin/"$i" fi done } sha512sums=" 1f559e68fc66602bdca4ebf39d0bb292ba438430f5dee409f0b6c80be75aec3f0ad835ac6c8607208718a9ee32d99bf992241ee3eed41e70b7a543acae6c8bda syncthing-1.23.6.tar.gz 81bcb6b2e0956624b596201d1de24a3b6fcb10d08761f2c426081350b611295a7f4d47775d175f2ee5dbbb289b98bc022389fc9992f0d31bcdbfde855ceafaf8 only-test-with-race-when-provided.patch 7fe49210180827c28f3ee9a1a95da3884dbef34de9bdc643f4455c9a056adba81f16c1c6ac059e83bee360aea091ace98b8a6f4c4b26a32c450f61f15206d3f5 syncthing.initd "