PKGBUILDs/community/syncthing/PKGBUILD
2014-11-30 19:16:50 +01:00

68 lines
2.5 KiB
Bash

# $Id:
# Maintainer : Martin Wimpress <code@flexion.org>
# Contributor: Sauyon Lee <sauyonl@sauyon.com>
# Contributor: Kevin MacMartin <prurigro@gmail.com>
# Contributor: korjjj <korjjj+aur@gmail.com>
# ALARM: Dominik Heidler <dominik@heidler.eu>
# - set the GOARM env var
# - set the goarch parameter
# - skip the testsuite (due to timeouts)
# - use the latest version (0.10.9) as we're at it
pkgname=syncthing
pkgver=0.10.9
pkgrel=1
pkgdesc="Open Source Continuous Replication / Cluster Synchronization Thing"
url="http://syncthing.net/"
license=('GPL3')
arch=('i686' 'x86_64')
depends=('glibc')
makedepends=('git' 'go' 'godep' 'inetutils' 'sed')
source=("$pkgname-$pkgver::git+https://github.com/syncthing/syncthing.git#tag=v${pkgver}"
"syncthing@.service"
"syncthing.service"
"syncthing.1")
sha1sums=('SKIP'
'204cad3823306c793a14a17a23220e26199160d4'
'2d3870eff21ad0724a48ba93e87064686693e3b9'
'17be8b3f99c577e325765abc251f597e204d7711')
install=${pkgname}.install
prepare() {
cd "${srcdir}"
mkdir -p "src/github.com/syncthing"
mv "${pkgname}-${pkgver}" "src/github.com/syncthing/${pkgname}"
}
build() {
export GOPATH="${srcdir}"
[ "$CARCH" == 'arm' ] && export GOARM=5
[ "$CARCH" == 'armv6h' ] && export GOARM=6
[ "$CARCH" == 'armv7h' ] && export GOARM=7
cd "${srcdir}/src/github.com/syncthing/${pkgname}"
# the env var is not enough - we need to specify the -goarch param
# until https://github.com/syncthing/syncthing/pull/1048 is merged
go run build.go -no-upgrade -goarch armv${GOARM} build
}
check() {
export GOPATH="${srcdir}"
[ "$CARCH" == 'arm' ] && export GOARM=5
[ "$CARCH" == 'armv6h' ] && export GOARM=6
[ "$CARCH" == 'armv7h' ] && export GOARM=7
cd "${srcdir}/src/github.com/syncthing/${pkgname}"
# each test has a time limit of 10sec - that is exceeded on arm (pandaboard = 20sec)
# see https://github.com/syncthing/syncthing/issues/1049
#go run build.go -no-upgrade -goarch armv${GOARM} test
}
package() {
cd "${srcdir}/src/github.com/syncthing/${pkgname}"
install -D -m 755 ${pkgname} "${pkgdir}/usr/bin/${pkgname}"
install -D -m 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
install -D -m 644 "${srcdir}/${pkgname}@.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}@.service"
install -D -m 644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/user/${pkgname}.service"
install -D -m 644 "${srcdir}/${pkgname}.1" "${pkgdir}/usr/share/man/man1/${pkgname}.1"
}