diff options
author | swills <swills@FreeBSD.org> | 2014-08-15 01:39:29 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2014-08-15 01:39:29 +0800 |
commit | 4e209092fc971832f7163c6f16fbbda2da4602c2 (patch) | |
tree | 314b4bee480a8ee7d8941247a7525dbf5a4965da /net | |
parent | 4d480e91cd134455a1d7c9aef79780cf74a518d4 (diff) | |
download | freebsd-ports-gnome-4e209092fc971832f7163c6f16fbbda2da4602c2.tar.gz freebsd-ports-gnome-4e209092fc971832f7163c6f16fbbda2da4602c2.tar.zst freebsd-ports-gnome-4e209092fc971832f7163c6f16fbbda2da4602c2.zip |
net/syncthing: add port for syncthing
Syncthing replaces proprietary sync and cloud services with something open,
trustworthy and decentralized.
WWW: http://syncthing.net/
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/syncthing/Makefile | 77 | ||||
-rw-r--r-- | net/syncthing/distinfo | 20 | ||||
-rw-r--r-- | net/syncthing/files/patch-build.sh | 25 | ||||
-rw-r--r-- | net/syncthing/files/patch-upgrade__upgrade_supported.go | 10 | ||||
-rw-r--r-- | net/syncthing/files/syncthing.in | 55 | ||||
-rw-r--r-- | net/syncthing/pkg-descr | 6 |
7 files changed, 194 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 4a94f27709f5..b2f2fe920905 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1150,6 +1150,7 @@ SUBDIR += suckblow SUBDIR += sup SUBDIR += svnup + SUBDIR += syncthing SUBDIR += tableutil SUBDIR += tac_plus-libradius SUBDIR += tac_plus4 diff --git a/net/syncthing/Makefile b/net/syncthing/Makefile new file mode 100644 index 000000000000..b188c073d72b --- /dev/null +++ b/net/syncthing/Makefile @@ -0,0 +1,77 @@ +# Created by: Steve Wills <swills@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= syncthing +PORTVERSION= 0.9.4 +CATEGORIES= net +MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/archive/v${PORTVERSION}.tar.gz?dummy=/:group1 \ + https://bitbucket.org/kardianos/osext/get/:group2 \ + https://crypto.go.googlecode.com/archive/:group3 \ + https://text.go.googlecode.com/archive/:group4 \ + https://snappy-go.googlecode.com/archive/:group5 \ + https://codeload.github.com/bkaradzic/go-lz4/legacy.tar.gz/77e2ba8?dummy=/:group6 \ + https://codeload.github.com/calmh/xdr/legacy.tar.gz/e1714bb?dummy=/:group7 \ + https://codeload.github.com/juju/ratelimit/legacy.tar.gz/f9f36d1?dummy=/:group8 \ + https://codeload.github.com/syndtr/goleveldb/legacy.tar.gz/2b4cbca?dummy=/:group9 \ + https://codeload.github.com/vitrun/qart/legacy.tar.gz/ccb109c?dummy=/:group10 +DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}:group1 \ + 5d3ddcf53a50${EXTRACT_SUFX}:group2 \ + f3cebac2bd11c2bf03c15bfa4c66688ad02a0a40${EXTRACT_SUFX}:group3 \ + d65bffbc88a153d23a6d2a864531e6e7c2cde59b${EXTRACT_SUFX}:group4 \ + 12e4b4183793ac4b061921e7980845e750679fd0${EXTRACT_SUFX}:group5 \ + bkaradzic-go-lz4-77e2ba8${EXTRACT_SUFX}:group6 \ + calmh-xdr-e1714bb${EXTRACT_SUFX}:group7 \ + juju-ratelimit-f9f36d1${EXTACT_SUFX}:group8 \ + syndtr-goleveldb-2b4cbca${EXTRACT_SUFX}:group9 \ + vitrun-qart-ccb109c${EXTRACT_SUFX}:group10 + +MAINTAINER= swills@FreeBSD.org +COMMENT= Encrypted file sync tool + +BUILD_DEPENDS= ${LOCALBASE}/bin/go:${PORTSDIR}/lang/go \ + bash:${PORTSDIR}/shells/bash + +USE_RC_SUBR= syncthing +PLIST_FILES= bin/syncthing bin/stindex bin/stevents +PORTDOCS= * + +USERS= syncthing +GROUPS= syncthing + +post-patch: + ${REINPLACE_CMD} -e 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/build.sh + cd ${WRKSRC} ; \ + ${MKDIR} src/code.google.com/p \ + src/bitbucket.org/kardianos \ + src/github.com/bkaradzic \ + src/github.com/calmh \ + src/github.com/juju \ + src/github.com/syndtr \ + src/github.com/vitrun \ + src/github.com/syncthing/syncthing ; \ + ${MV} ${WRKDIR}/kardianos-osext-5d3ddcf53a50 ${WRKSRC}/src/bitbucket.org/kardianos/osext ; \ + ${MV} ${WRKDIR}/crypto.go-f3cebac2bd11/ src/code.google.com/p/go.crypto ; \ + ${MV} ${WRKDIR}/snappy-go-12e4b4183793 src/code.google.com/p/snappy-go ; \ + ${MV} ${WRKDIR}/text.go-d65bffbc88a1 src/code.google.com/p/go.text ; \ + ${MV} ${WRKDIR}/bkaradzic-go-lz4-77e2ba8 src/github.com/bkaradzic/go-lz4 ; \ + ${MV} ${WRKDIR}/calmh-xdr-e1714bb src/github.com/calmh/xdr ; \ + ${MV} ${WRKDIR}/juju-ratelimit-f9f36d1 src/github.com/juju/ratelimit ; \ + ${MV} ${WRKDIR}/syndtr-goleveldb-2b4cbca src/github.com/syndtr/goleveldb ; \ + ${MV} ${WRKDIR}/vitrun-qart-ccb109c src/github.com/vitrun/qart ; \ + ${CP} -r lamport luhn beacon scanner versioner files \ + protocol auto config discover events logger model osutil \ + upgrade upnp src/github.com/syncthing/syncthing + +do-build: + cd ${WRKSRC} ; ${SETENV} GOPATH=${WRKSRC} bash ./build.sh + +do-install: +.for x in stevents stindex syncthing + ${INSTALL_PROGRAM} ${WRKSRC}/bin/${x} ${STAGEDIR}${PREFIX}/bin +.endfor + ${MKDIR} ${STAGEDIR}${DOCSDIR} +.for x in CONTRIBUTORS LICENSE README.md + ${INSTALL_MAN} ${WRKSRC}/${x} ${STAGEDIR}${DOCSDIR} +.endfor + +.include <bsd.port.mk> diff --git a/net/syncthing/distinfo b/net/syncthing/distinfo new file mode 100644 index 000000000000..be69385e2dc0 --- /dev/null +++ b/net/syncthing/distinfo @@ -0,0 +1,20 @@ +SHA256 (syncthing-0.9.4.tar.gz) = e1cfbc3055ca26662d9f3664bd236357f84f6523360cc2aa4c3e83fcd74fcfad +SIZE (syncthing-0.9.4.tar.gz) = 1814400 +SHA256 (5d3ddcf53a50.tar.gz) = d39ed6aa63c76b62d6cd5850128f7205f0d983ffbb78f121afbd4a3c85937587 +SIZE (5d3ddcf53a50.tar.gz) = 3060 +SHA256 (f3cebac2bd11c2bf03c15bfa4c66688ad02a0a40.tar.gz) = 288fa9ba282c7f7bb9680a922063f08cc3924315baa0ca980b45877a00133b04 +SIZE (f3cebac2bd11c2bf03c15bfa4c66688ad02a0a40.tar.gz) = 326179 +SHA256 (d65bffbc88a153d23a6d2a864531e6e7c2cde59b.tar.gz) = 8cbaccd3eda3eb7d191839158cbcedaa03b3b5ffd10c4267adb990408114b397 +SIZE (d65bffbc88a153d23a6d2a864531e6e7c2cde59b.tar.gz) = 3238701 +SHA256 (12e4b4183793ac4b061921e7980845e750679fd0.tar.gz) = 9125379be11ac96241a5ad5801c81f27028b181c658ed42cfd385db04fcee6f2 +SIZE (12e4b4183793ac4b061921e7980845e750679fd0.tar.gz) = 7772 +SHA256 (bkaradzic-go-lz4-77e2ba8.tar.gz) = 8d6a3f73bb2e21a64292d14af1a8466707c14f71b70d48fde317746cd2ac8d0e +SIZE (bkaradzic-go-lz4-77e2ba8.tar.gz) = 232876 +SHA256 (calmh-xdr-e1714bb.tar.gz) = 354133594fc70dac499a44ffd6d857f1f730345f8db3d07def4e38daec5ec791 +SIZE (calmh-xdr-e1714bb.tar.gz) = 9250 +SHA256 (juju-ratelimit-f9f36d1) = d2117682d9ef68764cfdd4de51b4d150cd2c6c0b6a9fcaa50d5891443b42285a +SIZE (juju-ratelimit-f9f36d1) = 7382 +SHA256 (syndtr-goleveldb-2b4cbca.tar.gz) = aa0c0917c51de5fa5bf6bd7a2a410bdbc7f27d72146ffb2bf7376273c02275c5 +SIZE (syndtr-goleveldb-2b4cbca.tar.gz) = 106774 +SHA256 (vitrun-qart-ccb109c.tar.gz) = 6daeaea6334827e56daa82d601df9bca1bb48dd9b1deb2f8708ffb3867afd112 +SIZE (vitrun-qart-ccb109c.tar.gz) = 23243 diff --git a/net/syncthing/files/patch-build.sh b/net/syncthing/files/patch-build.sh new file mode 100644 index 000000000000..4db53623439f --- /dev/null +++ b/net/syncthing/files/patch-build.sh @@ -0,0 +1,25 @@ +--- build.sh.orig 2014-08-12 22:35:37.000000000 +0000 ++++ build.sh 2014-08-14 15:44:43.884147180 +0000 +@@ -5,11 +5,9 @@ + + distFiles=(README.md LICENSE CONTRIBUTORS) # apart from the binary itself + +-# replace "...-12-g123abc" with "...+12-g123abc" to remain semver compatible-ish +-version=$(git describe --always --dirty) +-version=$(echo "$version" | sed 's/-\([0-9]\{1,3\}-g[0-9a-f]\{5,10\}\)/+\1/') ++version=v%%PORTVERSION%% + +-date=$(git show -s --format=%ct) ++date=$(date +%Y%m%d%H%M%S) + user=$(whoami) + host=$(hostname) + host=${host%%.*} +@@ -169,7 +167,7 @@ + "") + shift + export GOBIN=$(pwd)/bin +- godep go install $* -ldflags "$ldflags" ./cmd/... ++ go install $* -ldflags "$ldflags" ./cmd/... + ;; + + clean) diff --git a/net/syncthing/files/patch-upgrade__upgrade_supported.go b/net/syncthing/files/patch-upgrade__upgrade_supported.go new file mode 100644 index 000000000000..64f6214c1ea2 --- /dev/null +++ b/net/syncthing/files/patch-upgrade__upgrade_supported.go @@ -0,0 +1,10 @@ +--- ./upgrade/upgrade_supported.go.orig 2014-08-14 02:03:33.321542734 +0000 ++++ ./upgrade/upgrade_supported.go 2014-08-14 02:03:37.807542195 +0000 +@@ -70,6 +70,7 @@ + + // Returns the latest release, including prereleases or not depending on the argument + func LatestRelease(prerelease bool) (Release, error) { ++ return Release{}, ErrVersionUnknown + resp, err := http.Get("https://api.github.com/repos/syncthing/syncthing/releases?per_page=10") + if err != nil { + return Release{}, err diff --git a/net/syncthing/files/syncthing.in b/net/syncthing/files/syncthing.in new file mode 100644 index 000000000000..7ebafd040e7e --- /dev/null +++ b/net/syncthing/files/syncthing.in @@ -0,0 +1,55 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: syncthing +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# syncthing_enable (bool): Set to NO by default. +# Set it to YES to enable syncthing. +# syncthing_user (user): Set user to run syncthing. +# Default is "syncthing". +# syncthing_group (group): Set group to run syncthing. +# Default is "syncthing". +# syncthing_dir (dir): Set dir to run syncthing in. +# Default is "/var/tmp/syncthing". + +. /etc/rc.subr + +name=syncthing +rcvar=syncthing_enable + +load_rc_config $name + +: ${syncthing_enable:="NO"} +: ${syncthing_user:="syncthing"} +: ${syncthing_group:="syncthing"} +: ${syncthing_dir:="/var/tmp/syncthing"} + +export STNORESTART=true +export HOME=${syncthing_dir} + +pidfile=/var/run/syncthing.pid +procname="%%PREFIX%%/bin/syncthing" +command="/usr/sbin/daemon" +command_args="-f -p ${pidfile} ${procname} -home=${syncthing_dir} -no-browser ${syncthing_flags}" + +start_precmd=syncthing_startprecmd + +syncthing_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${syncthing_user} -g ${syncthing_group} /dev/null ${pidfile}; + fi + + if [ ! -d ${syncthing_dir} ]; then + install -d -o ${syncthing_user} -g ${syncthing_group} ${syncthing_dir} + fi + +} + +run_rc_command "$1" diff --git a/net/syncthing/pkg-descr b/net/syncthing/pkg-descr new file mode 100644 index 000000000000..51a8d62ec139 --- /dev/null +++ b/net/syncthing/pkg-descr @@ -0,0 +1,6 @@ +Syncthing replaces proprietary sync and cloud services with something open, +trustworthy and decentralized. Your data is your data alone and you deserve to +choose where it is stored, if it is shared with some third party and how it's +transmitted over the Internet. + +WWW: http://syncthing.net/ |