From c01746a7e37c4b32614f76bb559225eebf43bfba Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Sat, 27 Dec 2014 15:31:12 -0300 Subject: discosrv is the discovery server for syncthing --- pcr/discosrv/PKGBUILD | 45 +++++++++++++++++++++++++++++++++++++++++++ pcr/discosrv/discosrv.install | 6 ++++++ pcr/discosrv/discosrv.service | 12 ++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 pcr/discosrv/PKGBUILD create mode 100644 pcr/discosrv/discosrv.install create mode 100644 pcr/discosrv/discosrv.service (limited to 'pcr/discosrv') 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 + +_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 -- cgit v1.2.3