From e872d397928d456b9805a01939695ed36d3ae316 Mon Sep 17 00:00:00 2001 From: TheChymera Date: Wed, 15 Oct 2014 19:50:52 +0200 Subject: [PATCH] new versioned ebuild from nektoo (via zugaina) --- net-p2p/syncthing/syncthing-0.10.1.ebuild | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 net-p2p/syncthing/syncthing-0.10.1.ebuild diff --git a/net-p2p/syncthing/syncthing-0.10.1.ebuild b/net-p2p/syncthing/syncthing-0.10.1.ebuild new file mode 100644 index 0000000..8d68231 --- /dev/null +++ b/net-p2p/syncthing/syncthing-0.10.1.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header:$ + +EAPI="5" + +inherit eutils base systemd + +DESCRIPTION="Open, trustworthy and decentralized syncing engine (some kind of analog of DropBox and BTSync)" +HOMEPAGE="http://syncthing.net" +SRC_URI="https://github.com/syncthing/${PN}/archive/v${PV}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" + +DEPEND=" + dev-lang/go + app-misc/godep +" +RDEPEND="${DEPEND}" + +DOCS=( README.md CONTRIBUTORS LICENSE CONTRIBUTING.md ) + +export GOPATH="${S}" + +GO_PN="github.com/syncthing/${PN}" +S="${S}/src/${GO_PN}" + +src_unpack() { + mkdir -p ${S} || die + unpack ${A} + + cd ${WORKDIR}/${P} + # Move everything except src (cannot move it to itself) to ${S} + mv `ls | grep -v '^src$'` ${S} || die +} + +src_compile() { + local version="v${PV}"; + local date="$(date +%s)"; + local user="$(whoami)" + local host="$(hostname)"; host="${host%%.*}"; + local lf="-w -X main.Version ${version} -X main.BuildStamp ${date} -X main.BuildUser ${user} -X main.BuildHost ${host}" + + godep go build -ldflags "${lf}" -tags noupgrade ./cmd/syncthing || die +} + +src_install() { + dobin syncthing + systemd_newunit "${FILESDIR}"/syncthing.service syncthing@.service + base_src_install_docs +} + +pkg_postinst() { + ewarn "To run syncthing as a service, execute" + ewarn " systemctl start syncthing@" +}