aboutsummaryrefslogtreecommitdiffstats
path: root/main/syncthing/APKBUILD
blob: f60afa5653b39d1fdb60ec0fbb89fdef8013abab (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=syncthing
pkgver=0.10.1
pkgrel=0
pkgdesc="Open Source Continuous File Synchronization"
url="http://syncthing.net/"
arch="all"
license="MIT"
pkgusers="$pkgname"
pkggroups="$pkgname"
depends=""
depends_dev=""
makedepends="$depends_dev godep go mercurial bash"
install="$pkgname.pre-install"
subpackages=""
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.bz2
	syncthing.confd
	syncthing.initd"
giturl="git://github.com/$pkgname/$pkgname.git"
disturl="dev.alpinelinux.org:/archive/$pkgname/"

_builddir="$srcdir/src/github.com/syncthing"

prepare() {
	local i
	mkdir -p $_builddir
	mv $srcdir/$pkgname-$pkgver $_builddir/$pkgname
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

snapshot() {
	abuild clean
	mkdir -p "$srcdir" && cd "$srcdir"
	git clone --branch v${pkgver} \
		$giturl \
		$pkgname-$pkgver || return 1
	tar jcf $pkgname-$pkgver.tar.bz2 $pkgname-$pkgver || return 1
	rsync --progress -La $pkgname-$pkgver.tar.bz2 $disturl || return 1
}

build() {
	cd "$_builddir"/$pkgname
	export GOPATH="$srcdir"
	go run build.go -no-upgrade
}

package() {
	mkdir -p "$pkgdir"/usr/bin || return 1
	install -d -o $pkgname -g $pkgname \
		"$pkgdir"/var/lib/$pkgname || return 1
	mv "$_builddir"/$pkgname/bin/* \
		"$pkgdir"/usr/bin || return 1
	install -D -m755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
	install -D -m644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname || return 1
}

md5sums="6293c7d19bcb633e781bb064ac55d835  syncthing-0.10.1.tar.bz2
c4923d6df4d3e51274869c09ea46a3e1  syncthing.confd
b71538acb1db22a407bb579fc84f6696  syncthing.initd"
sha256sums="6aff1fa98307b8574bf24a8aab6db280eb60e1a960921a6b2ed748d6432897fd  syncthing-0.10.1.tar.bz2
da396f944d7b5b2e4f5a7a9a3a7b31529cf359ef7ebecec4c48383d0c8b6821e  syncthing.confd
a8ae8faf9ab78e6f72c648530e7383cac7fd42ab6f90b6ec05860e441d24e39e  syncthing.initd"
sha512sums="3528a7fb06ae2f4cbf2c64b58af427576b8b6546e8dd1f225af96b391f035977dc048a7d66467cb74cc7d0fbbd3d0a6d7e18f6b81e95cbd8621bb53500684cec  syncthing-0.10.1.tar.bz2
b19cc3d802caa33f4d06852de590d2d984c12cf27d0540162cd7195da4f3f149c83c72e7a10f385b32b27fff6f39d33698e7402442a3f32a9da136c5d19059ae  syncthing.confd
5c58421d644feface48c582083c4df632434bdf686b046d7926190cdb9639a4d595ad7e628d9d80abd2e19eebfb5b8eba560e5eb1d2672f6d9dfda713aa57254  syncthing.initd"