diff options
-rw-r--r-- | main/syncthing/APKBUILD | 73 | ||||
-rw-r--r-- | main/syncthing/syncthing.confd | 1 | ||||
-rw-r--r-- | main/syncthing/syncthing.initd | 13 | ||||
-rw-r--r-- | main/syncthing/syncthing.pre-install | 3 | ||||
-rw-r--r-- | testing/syncthing/APKBUILD | 45 |
5 files changed, 90 insertions, 45 deletions
diff --git a/main/syncthing/APKBUILD b/main/syncthing/APKBUILD new file mode 100644 index 0000000000..ec7c4542b0 --- /dev/null +++ b/main/syncthing/APKBUILD @@ -0,0 +1,73 @@ +# Contributor: Carlo Landmeter <clandmeter@gmail.com> +# Maintainer: +pkgname=syncthing +pkgver=0.9.8 +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="2acb433a1e0f23def517bbe688aa6bfb syncthing-0.9.8.tar.bz2 +c4923d6df4d3e51274869c09ea46a3e1 syncthing.confd +b71538acb1db22a407bb579fc84f6696 syncthing.initd" +sha256sums="2a4ad3bba9097db437b34e8be022da95dcd4539a5004a225976b6421ab9ed956 syncthing-0.9.8.tar.bz2 +da396f944d7b5b2e4f5a7a9a3a7b31529cf359ef7ebecec4c48383d0c8b6821e syncthing.confd +a8ae8faf9ab78e6f72c648530e7383cac7fd42ab6f90b6ec05860e441d24e39e syncthing.initd" +sha512sums="f0eb42e9a0641ab00637e00b858b295ddfb8a72c170254db3ebaa2453ff2e0f71a035df14656d08bd4d28a4ea05e341fae3ab228dab08f918230ddf2d37b94d3 syncthing-0.9.8.tar.bz2 +b19cc3d802caa33f4d06852de590d2d984c12cf27d0540162cd7195da4f3f149c83c72e7a10f385b32b27fff6f39d33698e7402442a3f32a9da136c5d19059ae syncthing.confd +5c58421d644feface48c582083c4df632434bdf686b046d7926190cdb9639a4d595ad7e628d9d80abd2e19eebfb5b8eba560e5eb1d2672f6d9dfda713aa57254 syncthing.initd" diff --git a/main/syncthing/syncthing.confd b/main/syncthing/syncthing.confd new file mode 100644 index 0000000000..ffa341f9eb --- /dev/null +++ b/main/syncthing/syncthing.confd @@ -0,0 +1 @@ +syncthing_args="-no-browser" diff --git a/main/syncthing/syncthing.initd b/main/syncthing/syncthing.initd new file mode 100644 index 0000000000..40738cc3a2 --- /dev/null +++ b/main/syncthing/syncthing.initd @@ -0,0 +1,13 @@ +#!/sbin/runscript + +name=syncthing +command=/usr/bin/$name +command_args=$syncthing_args +start_stop_daemon_args="--background --user $name --group $name" + +depend() { + use logger dns + need net + after firewall +} + diff --git a/main/syncthing/syncthing.pre-install b/main/syncthing/syncthing.pre-install new file mode 100644 index 0000000000..b2207a0d7b --- /dev/null +++ b/main/syncthing/syncthing.pre-install @@ -0,0 +1,3 @@ +#!/bin/sh +adduser -H -h /var/lib/syncthing -s /sbin/nologin -D syncthing 2>/dev/null +exit 0 diff --git a/testing/syncthing/APKBUILD b/testing/syncthing/APKBUILD deleted file mode 100644 index 40f5a45036..0000000000 --- a/testing/syncthing/APKBUILD +++ /dev/null @@ -1,45 +0,0 @@ -# Contributor: Carlo Landmeter <clandmeter@gmail.com> -# Maintainer: -pkgname=syncthing -pkgver=0.9.5 -pkgrel=0 -pkgdesc="Open Source Continuous File Synchronization" -url="http://syncthing.net/" -arch="all" -license="MIT" -depends="" -depends_dev="" -makedepends="$depends_dev godep go mercurial bash" -install="" -subpackages="" -source="syncthing-${pkgver}.tar.gz::https://github.com/syncthing/syncthing/archive/v$pkgver.tar.gz" - -_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 -} - -build() { - cd "$_builddir"/$pkgname - export GOPATH="$srcdir" - ./build.sh "" -tags noupgrade -} - -package() { - mkdir -p "$pkgdir"/usr/bin - mv "$_builddir"/$pkgname/bin/* \ - "$pkgdir"/usr/bin || return 1 -} - -md5sums="034925c10154c5fbe2583e18c05c3314 syncthing-0.9.5.tar.gz" -sha256sums="df27d0920d77f82e8dc30bb95c40001828e70b6a7568156a6a47b7caf22765b4 syncthing-0.9.5.tar.gz" -sha512sums="ccfdea7a8e400c89abb031613104da4a16bdccd200d90181166773cafe7a2922025d26db002f017fa7139a25422304a743013d76d99d28c867757b6bf3b5f573 syncthing-0.9.5.tar.gz" |