diff options
author | Steve Wills <swills@FreeBSD.org> | 2018-05-16 17:26:15 +0000 |
---|---|---|
committer | Steve Wills <swills@FreeBSD.org> | 2018-05-16 17:26:15 +0000 |
commit | e381a7a0e82a0d55d352806e5a5bda9279169077 (patch) | |
tree | 698820a9d3dc0c0632b9caa8e744d94c3bb1960d /net/syncthing | |
parent | 7fcb603e1691b2f52f572afd86813962c4118152 (diff) |
Notes
Diffstat (limited to 'net/syncthing')
-rw-r--r-- | net/syncthing/Makefile | 23 | ||||
-rw-r--r-- | net/syncthing/distinfo | 6 | ||||
-rw-r--r-- | net/syncthing/files/syncthing-discosrv.in | 68 | ||||
-rw-r--r-- | net/syncthing/files/syncthing-relaypoolsrv.in | 61 | ||||
-rw-r--r-- | net/syncthing/files/syncthing-relaysrv.in | 65 | ||||
-rw-r--r-- | net/syncthing/files/syncthing.in | 23 |
6 files changed, 229 insertions, 17 deletions
diff --git a/net/syncthing/Makefile b/net/syncthing/Makefile index 33cb40c97eab..1f844c784acc 100644 --- a/net/syncthing/Makefile +++ b/net/syncthing/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= syncthing -PORTVERSION= 0.14.46 +PORTVERSION= 0.14.47 DISTVERSIONPREFIX= v CATEGORIES= net @@ -13,8 +13,15 @@ BUILD_DEPENDS= ${LOCALBASE}/bin/go:lang/go USE_GITHUB= yes GH_SUBDIR= src/github.com/${PORTNAME}/${PORTNAME} -USE_RC_SUBR= syncthing -PLIST_FILES= bin/syncthing +USE_RC_SUBR= syncthing syncthing-discosrv syncthing-relaysrv syncthing-relaypoolsrv +BINS= stbench stcli stcompdirs stdisco stdiscosrv stevents stfileinfo \ + stfinddevice stgenfiles stindex strelaypoolsrv strelaysrv \ + stsigtool sttestutil stvanity stwatchfile syncthing + +.for x in ${BINS} +PLIST_FILES+= bin/${x} +.endfor + PORTDOCS= * USERS= syncthing @@ -22,13 +29,17 @@ GROUPS= syncthing do-build: @cd ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME} ; \ - ${SETENV} ${MAKE_ENV} go run build.go -no-upgrade=true -version v${PORTVERSION} + ${SETENV} ${MAKE_ENV} CGO_ENABLED=0 go run build.go -no-upgrade=true -version v${PORTVERSION} + @${MV} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/bin/testutil \ + ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/bin/sttestutil do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/bin/syncthing \ +.for x in ${BINS} + ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/bin/${x} \ ${STAGEDIR}${PREFIX}/bin/ +.endfor ${MKDIR} ${STAGEDIR}${DOCSDIR} -.for x in AUTHORS CONTRIBUTING.md LICENSE README.md +.for x in AUTHORS LICENSE README.md ${INSTALL_DATA} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/${x} \ ${STAGEDIR}${DOCSDIR} .endfor diff --git a/net/syncthing/distinfo b/net/syncthing/distinfo index 1f55e8bfbdad..ac6165f9845f 100644 --- a/net/syncthing/distinfo +++ b/net/syncthing/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1524505661 -SHA256 (syncthing-syncthing-v0.14.46_GH0.tar.gz) = 2a2d6472935b6b125a6f028a7fbfe27fd30a6bb0fbadc1d920b2314c9fb31ac3 -SIZE (syncthing-syncthing-v0.14.46_GH0.tar.gz) = 10200015 +TIMESTAMP = 1526399696 +SHA256 (syncthing-syncthing-v0.14.47_GH0.tar.gz) = 2c34e711ed0b0eb78f18822adc1621e204c5a6193298ad711934517949ce816d +SIZE (syncthing-syncthing-v0.14.47_GH0.tar.gz) = 10278343 diff --git a/net/syncthing/files/syncthing-discosrv.in b/net/syncthing/files/syncthing-discosrv.in new file mode 100644 index 000000000000..660c67dc5515 --- /dev/null +++ b/net/syncthing/files/syncthing-discosrv.in @@ -0,0 +1,68 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: syncthingdiscosrv +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# syncthingdiscosrv_enable (bool): Set to NO by default. +# Set it to YES to enable syncthing-discosrv. +# syncthingdiscosrv_user (user): Set user to run syncthing-discosrv. +# Default is "syncthing". +# syncthingdiscosrv_group (group): Set group to run syncthing-discosrv. +# Default is "syncthing". +# syncthingdiscosrv_dir (dir): Set dir to run syncthing-discosrv in. +# Default is "/var/db/syncthing-discosrv". +# syncthingdiscosrv_log_file (path): Syncthing log file +# Default: /var/log/syncthing-discosrv.log +# syncthingdiscosrv_key (file): Set key file to use +# Default is "${syncthingdiscosrv_dir}/syncthing.key". +# syncthingdiscosrv_cert (file): Set cert file to use +# Default is "${syncthingdiscosrv_dir}/syncthing.cert". +# syncthingdiscosrv_args (string): Extra args to pass to syncthing-discosrv +# Default is "" + +. /etc/rc.subr + +name=syncthingdiscosrv +rcvar=syncthingdiscosrv_enable + +load_rc_config $name + +: ${syncthingdiscosrv_enable:="NO"} +: ${syncthingdiscosrv_user:="syncthing"} +: ${syncthingdiscosrv_group:="syncthing"} +: ${syncthingdiscosrv_dir:="/var/db/syncthing-discosrv"} +: ${syncthingdiscosrv_log_file=/var/log/syncthing-discosrv.log} +: ${syncthingdiscosrv_key:="${syncthingdiscosrv_dir}/syncthing.key"} +: ${syncthingdiscosrv_cert:="${syncthingdiscosrv_dir}/syncthing.cert"} + +export STNORESTART=true + +pidfile=/var/run/syncthingdiscosrv.pid +procname="%%PREFIX%%/bin/stdiscosrv" +command="/usr/sbin/daemon" +command_args="-p ${pidfile} ${procname} -key ${syncthingdiscosrv_key} -cert ${syncthingdiscosrv_cert} ${syncthingdiscosrv_args} >> ${syncthingdiscosrv_log_file}" +syncthingdiscosrv_chdir=${syncthingdiscosrv_dir} + +start_precmd=syncthingdiscosrv_startprecmd + +syncthingdiscosrv_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${syncthingdiscosrv_user} -g ${syncthingdiscosrv_group} /dev/null ${pidfile}; + fi + + if [ ! -d ${syncthingdiscosrv_dir} ]; then + install -d -o ${syncthingdiscosrv_user} -g ${syncthingdiscosrv_group} ${syncthingdiscosrv_dir} + fi + if [ ! -e ${syncthingdiscosrv_log_file} ]; then + install -o ${syncthingdiscosrv_user} -g ${syncthingdiscosrv_group} /dev/null ${syncthingdiscosrv_log_file}; + fi +} + +run_rc_command "$1" diff --git a/net/syncthing/files/syncthing-relaypoolsrv.in b/net/syncthing/files/syncthing-relaypoolsrv.in new file mode 100644 index 000000000000..e9913f4038f7 --- /dev/null +++ b/net/syncthing/files/syncthing-relaypoolsrv.in @@ -0,0 +1,61 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: syncthingrelaypoolsrv +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# syncthingrelaypoolsrv_enable (bool): Set to NO by default. +# Set it to YES to enable syncthing-relaypoolsrv. +# syncthingrelaypoolsrv_user (user): Set user to run syncthing-relaypoolsrv. +# Default is "syncthing". +# syncthingrelaypoolsrv_group (group): Set group to run syncthing-relaypoolsrv. +# Default is "syncthing". +# syncthingrelaypoolsrv_dir (dir): Set dir to run syncthing-relaypoolsrv in. +# Default is "/var/db/syncthing-relaypoolsrv". +# syncthingrelaypoolsrv_log_file (path): Syncthing log file +# Default: /var/log/syncthing-relaypoolsrv.log +# syncthingrelaypoolsrv_args (string): Extra args to pass to syncthing-relaypoolsrv +# Default is "" + +. /etc/rc.subr + +name=syncthingrelaypoolsrv +rcvar=syncthingrelaypoolsrv_enable + +load_rc_config $name + +: ${syncthingrelaypoolsrv_enable:="NO"} +: ${syncthingrelaypoolsrv_user:="syncthing"} +: ${syncthingrelaypoolsrv_group:="syncthing"} +: ${syncthingrelaypoolsrv_dir:="/var/db/syncthing-relaypoolsrv"} +: ${syncthingrelaypoolsrv_log_file=/var/log/syncthing-relaypoolsrv.log} + +export STNORESTART=true + +pidfile=/var/run/syncthingrelaypoolsrv.pid +procname="%%PREFIX%%/bin/strelaypoolsrv" +command="/usr/sbin/daemon" +command_args="-c -p ${pidfile} ${procname} -keys ${syncthingrelaypoolsrv_dir} ${syncthingrelaypoolsrv_args} >> ${syncthingrelaypoolsrv_log_file} 2>&1" + +start_precmd=syncthingrelaypoolsrv_startprecmd + +syncthingrelaypoolsrv_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${syncthingrelaypoolsrv_user} -g ${syncthingrelaypoolsrv_group} /dev/null ${pidfile}; + fi + + if [ ! -d ${syncthingrelaypoolsrv_dir} ]; then + install -d -o ${syncthingrelaypoolsrv_user} -g ${syncthingrelaypoolsrv_group} ${syncthingrelaypoolsrv_dir} + fi + if [ ! -e ${syncthingrelaypoolsrv_log_file} ]; then + install -o ${syncthingrelaypoolsrv_user} -g ${syncthingrelaypoolsrv_group} /dev/null ${syncthingrelaypoolsrv_log_file}; + fi +} + +run_rc_command "$1" diff --git a/net/syncthing/files/syncthing-relaysrv.in b/net/syncthing/files/syncthing-relaysrv.in new file mode 100644 index 000000000000..fabdf2d11595 --- /dev/null +++ b/net/syncthing/files/syncthing-relaysrv.in @@ -0,0 +1,65 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: syncthingrelaysrv +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# syncthingrelaysrv_enable (bool): Set to NO by default. +# Set it to YES to enable syncthing-relaysrv. +# syncthingrelaysrv_user (user): Set user to run syncthing-relaysrv. +# Default is "syncthing". +# syncthingrelaysrv_group (group): Set group to run syncthing-relaysrv. +# Default is "syncthing". +# syncthingrelaysrv_dir (dir): Set dir to run syncthing-relaysrv in. +# Default is "/var/db/syncthing-relaysrv". +# syncthingrelaysrv_log_file (path): Syncthing log file +# Default: /var/log/syncthing-relaysrv.log +# syncthingrelaysrv_key (file): Set key file to use +# Default is "${syncthingrelaysrv_dir}/syncthing.key". +# syncthingrelaysrv_cert (file): Set cert file to use +# Default is "${syncthingrelaysrv_dir}/syncthing.cert". +# syncthingrelaysrv_args (string): Extra args to pass to syncthing-relaysrv +# Default is "" + +. /etc/rc.subr + +name=syncthingrelaysrv +rcvar=syncthingrelaysrv_enable + +load_rc_config $name + +: ${syncthingrelaysrv_enable:="NO"} +: ${syncthingrelaysrv_user:="syncthing"} +: ${syncthingrelaysrv_group:="syncthing"} +: ${syncthingrelaysrv_dir:="/var/db/syncthing-relaysrv"} +: ${syncthingrelaysrv_log_file=/var/log/syncthing-relaysrv.log} + +export STNORESTART=true + +pidfile=/var/run/syncthingrelaysrv.pid +procname="%%PREFIX%%/bin/strelaysrv" +command="/usr/sbin/daemon" +command_args="-c -p ${pidfile} ${procname} -keys ${syncthingrelaysrv_dir} ${syncthingrelaysrv_args} >> ${syncthingrelaysrv_log_file} 2>&1" + +start_precmd=syncthingrelaysrv_startprecmd + +syncthingrelaysrv_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${syncthingrelaysrv_user} -g ${syncthingrelaysrv_group} /dev/null ${pidfile}; + fi + + if [ ! -d ${syncthingrelaysrv_dir} ]; then + install -d -o ${syncthingrelaysrv_user} -g ${syncthingrelaysrv_group} ${syncthingrelaysrv_dir} + fi + if [ ! -e ${syncthingrelaysrv_log_file} ]; then + install -o ${syncthingrelaysrv_user} -g ${syncthingrelaysrv_group} /dev/null ${syncthingrelaysrv_log_file}; + fi +} + +run_rc_command "$1" diff --git a/net/syncthing/files/syncthing.in b/net/syncthing/files/syncthing.in index f6de2daa9ebb..db894f057f8c 100644 --- a/net/syncthing/files/syncthing.in +++ b/net/syncthing/files/syncthing.in @@ -3,7 +3,7 @@ # $FreeBSD$ # # PROVIDE: syncthing -# REQUIRE: LOGIN +# REQUIRE: DAEMON # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf @@ -11,12 +11,15 @@ # # syncthing_enable (bool): Set to NO by default. # Set it to YES to enable syncthing. +# syncthing_home (path): Directory where syncthing configuration +# data is stored. +# Default: %%PREFIX%%/etc/syncthing +# syncthing_log_file (path): Syncthing log file +# Default: /var/log/syncthing.log # 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/db/syncthing". . /etc/rc.subr @@ -26,14 +29,15 @@ rcvar=syncthing_enable load_rc_config $name : ${syncthing_enable:="NO"} +: ${syncthing_home=%%PREFIX%%/etc/syncthing} +: ${syncthing_log_file=/var/log/syncthing.log} : ${syncthing_user:="syncthing"} -: ${syncthing_group:="syncthing"} -: ${syncthing_dir:="/var/db/syncthing"} +: ${syncthing_group=${syncthing_group:-$syncthing_user}} 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_args}" +command_args="-cf -p ${pidfile} ${procname} ${syncthing_home:+-home=${syncthing_home}} ${syncthing_log_file:+-logfile=${syncthing_log_file}} -no-browser ${syncthing_args}" start_precmd=syncthing_startprecmd @@ -43,10 +47,13 @@ syncthing_startprecmd() 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} + if [ ! -d ${syncthing_home} ]; then + install -d -o ${syncthing_user} -g ${syncthing_group} ${syncthing_home} fi + if [ ! -e ${syncthing_log_file} ]; then + install -o ${syncthing_user} -g ${syncthing_group} /dev/null ${syncthing_log_file}; + fi } run_rc_command "$1" |