summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
Diffstat (limited to 'pcr')
-rw-r--r--pcr/discosrv/PKGBUILD45
-rw-r--r--pcr/discosrv/discosrv.install6
-rw-r--r--pcr/discosrv/discosrv.service12
3 files changed, 63 insertions, 0 deletions
diff --git a/pcr/discosrv/PKGBUILD b/pcr/discosrv/PKGBUILD
new file mode 100644
index 000000000..13b169a8b
--- /dev/null
+++ b/pcr/discosrv/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer : fauno <fauno@parabola.nu>
+
+_pkgname=discosrv
+pkgname=${_pkgname}-git
+pkgver=2014.12.27
+pkgrel=1
+pkgdesc="Discovery server for syncthing"
+url="https://github.com/syncthing/discosrv"
+license=('GPL3' 'custom:BSD1' 'custom:BSD3' 'Apache')
+arch=('i686' 'x86_64')
+depends=('glibc')
+makedepends=('git' 'go' 'godep')
+install=${_pkgname}.install
+source=(https://repo.parabola.nu/other/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig}
+ ${_pkgname}.service)
+md5sums=('4ddae1dd5cb4745953e97d7537ad36c3'
+ 'SKIP'
+ '511efdc439b909da5cc7e3037b2a4391')
+
+mksource() {
+ set -o pipefail
+ mkdir -p "${pkgname}-${pkgver}"
+ export GOPATH="${srcdir}/${pkgname}-${pkgver}"
+
+ go get -d github.com/syncthing/discosrv
+}
+
+build() {
+ export GOPATH="${srcdir}/${pkgname}-${pkgver}"
+ cd "${srcdir}/${pkgname}-${pkgver}/src/github.com/syncthing/${_pkgname}"
+ go build
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}/src/github.com/syncthing/${_pkgname}"
+ install -D -m 755 ${_pkgname} "${pkgdir}/usr/bin/${_pkgname}"
+
+ for license in "${srcdir}/${pkgname}-${pkgver}"/src/*/*/*/LICENSE; do
+ local dir="$(dirname "${license}")"
+ install -Dm 644 "${license}" "${pkgdir}/usr/share/licenses/${pkgname}/${dir##*/}/LICENSE"
+ done
+
+ install -dm750 --owner nobody --group nobody ${pkgdir}/var/discosrv
+ install -Dm644 ${srcdir}/${_pkgname}.service ${pkgdir}/usr/lib/systemd/system/${_pkgname}.service
+}
diff --git a/pcr/discosrv/discosrv.install b/pcr/discosrv/discosrv.install
new file mode 100644
index 000000000..1251cae15
--- /dev/null
+++ b/pcr/discosrv/discosrv.install
@@ -0,0 +1,6 @@
+post_install() {
+cat << EOF
+ If you find trouble starting discosrv, try running \`chown -R
+ nobody:nobody /var/discosrv\` after first start.
+EOF
+}
diff --git a/pcr/discosrv/discosrv.service b/pcr/discosrv/discosrv.service
new file mode 100644
index 000000000..1ba22c9ce
--- /dev/null
+++ b/pcr/discosrv/discosrv.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Discovery Service for Syncthing
+After=network.target
+
+[Service]
+User=nobody
+Group=nobody
+ExecStart=/usr/bin/discosrv
+Restart=on-success
+
+[Install]
+WantedBy=default.target