From 6b9e0841711803f7205c5b40b629224d12632bb5 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Sat, 28 Jun 2014 23:09:50 +0200 Subject: [PATCH] Added syncthing and dependancy ebuilds (verbatim from http://data.gpo.zugaina.org/mva/ ) --- app-misc/godep/godep-9999.ebuild | 44 +++++++++++ .../files/0.8.14_no_bin_upgrades.patch | 29 +++++++ net-p2p/syncthing/syncthing-9999.ebuild | 77 +++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 app-misc/godep/godep-9999.ebuild create mode 100644 net-p2p/syncthing/files/0.8.14_no_bin_upgrades.patch create mode 100644 net-p2p/syncthing/syncthing-9999.ebuild diff --git a/app-misc/godep/godep-9999.ebuild b/app-misc/godep/godep-9999.ebuild new file mode 100644 index 0000000..38ba91d --- /dev/null +++ b/app-misc/godep/godep-9999.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" + +inherit git-r3 + +RESTRICT="strip" + +DESCRIPTION="native bindings for the FUSE kernel module" +HOMEPAGE="https://github.com/tools/godep" +EGIT_REPO_URI="https://github.com/tools/${PN}.git" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="" +IUSE="" + +DEPEND="dev-lang/go" +RDEPEND="" + +GO_PN="github.com/tools/${PN}" +EGIT_CHECKOUT_DIR="${S}/src/${GO_PN}" + +export GOPATH="${S}" + +src_prepare() { + go get ${GO_PN} +} + +src_compile() { + go build -v -x -work ${GO_PN} || die +} + +src_install() { +# go install -v -x -work ${GO_PN} || die + +dobin ${S}/bin/godep +#insinto /usr/lib/go/ +#doins -r "${S}/pkg" +#insinto /usr/lib/go/src/pkg +#doins -r "${S}/src/." +} diff --git a/net-p2p/syncthing/files/0.8.14_no_bin_upgrades.patch b/net-p2p/syncthing/files/0.8.14_no_bin_upgrades.patch new file mode 100644 index 0000000..c8a7fad --- /dev/null +++ b/net-p2p/syncthing/files/0.8.14_no_bin_upgrades.patch @@ -0,0 +1,29 @@ +--- cmd/syncthing/main.go 2014-06-13 05:29:07.566946128 +0700 ++++ cmd/syncthing/main.go 2014-06-13 05:32:31.603821890 +0700 +@@ -110,11 +110,9 @@ + func main() { + var reset bool + var showVersion bool +- var doUpgrade bool + flag.StringVar(&confDir, "home", getDefaultConfDir(), "Set configuration directory") + flag.BoolVar(&reset, "reset", false, "Prepare to resync from cluster") + flag.BoolVar(&showVersion, "version", false, "Show version") +- flag.BoolVar(&doUpgrade, "upgrade", false, "Perform upgrade") + flag.IntVar(&logFlags, "logflags", logFlags, "Set log flags") + flag.Usage = usageFor(flag.CommandLine, usage, extraUsage) + flag.Parse() +@@ -126,14 +124,6 @@ + + l.SetFlags(logFlags) + +- if doUpgrade { +- err := upgrade() +- if err != nil { +- l.Fatalln(err) +- } +- return +- } +- + if len(os.Getenv("GOGC")) == 0 { + debug.SetGCPercent(25) + } diff --git a/net-p2p/syncthing/syncthing-9999.ebuild b/net-p2p/syncthing/syncthing-9999.ebuild new file mode 100644 index 0000000..7818c04 --- /dev/null +++ b/net-p2p/syncthing/syncthing-9999.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: This ebuild is from mva overlay; Bumped by mva; $ + +EAPI="5" + +if [ "$PV" != "9999" ]; then + SRC_URI="https://github.com/calmh/${PN}/archive/v${PV}.tar.gz" + KEYWORDS="~amd64 ~x86 ~arm ~darwin ~winnt ~fbsd" +else + vcs="git-r3" + SRC_URI="" + EGIT_REPO_URI="https://github.com/calmh/${PN}" + KEYWORDS="" +fi + +inherit eutils base ${vcs} + +DESCRIPTION="Open, trustworthy and decentralized syncing engine (some kind of analog of DropBox and BTSync)" +HOMEPAGE="http://syncthing.net" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="" +IUSE="tools" + +DEPEND=" + dev-lang/go + app-misc/godep +" +RDEPEND="${DEPEND}" + +DOCS=( README.md CONTRIBUTORS LICENSE CONTRIBUTING.md ) + +export GOPATH="${S}" + +GO_PN="github.com/calmh/${PN}" +EGIT_CHECKOUT_DIR="${S}/src/${GO_PN}" +S="${EGIT_CHECKOUT_DIR}" + +src_prepare() { + ewarn "Sorry, but now we'll cut off 'upgrade' command from the syncthing" + ewarn "We're not a Windows©®™ and we can't trust selfupgrades from precompiled binaries" + +# cd "${EGIT_CHECKOUT_DIR}" + epatch "${FILESDIR}"/0.8.14_no_bin_upgrades.patch +# rm "${EGIT_CHECKOUT_DIR}/cmd/syncthing/upgrade.go" + rm cmd/syncthing/upgrade.go +} + +src_compile() { +# cd ${EGIT_CHECKOUT_DIR} + + # XXX: All the stuff below needs for "-version" command to show actual info + local version="$(git describe --always)"; + local date="$(git show -s --format=%ct)"; + 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}" + +# go vet ./... + godep go build -ldflags "${lf}" ./cmd/syncthing + + use tools && ( + godep go build ./cmd/stcli + godep go build ./cmd/stpidx + godep go build ./discover/cmd/discosrv + ) +} + +src_install() { +# cd ${EGIT_CHECKOUT_DIR} + + dobin syncthing + use tools && dobin stcli stpidx discosrv + base_src_install_docs +}