Index: head/net/syncthing/Makefile =================================================================== --- head/net/syncthing/Makefile (revision 470133) +++ head/net/syncthing/Makefile (revision 470134) @@ -1,36 +1,47 @@ # Created by: Steve Wills # $FreeBSD$ PORTNAME= syncthing -PORTVERSION= 0.14.46 +PORTVERSION= 0.14.47 DISTVERSIONPREFIX= v CATEGORIES= net MAINTAINER= swills@FreeBSD.org COMMENT= Encrypted file sync tool 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 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 .include Index: head/net/syncthing/distinfo =================================================================== --- head/net/syncthing/distinfo (revision 470133) +++ head/net/syncthing/distinfo (revision 470134) @@ -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 Index: head/net/syncthing/files/syncthing-discosrv.in =================================================================== --- head/net/syncthing/files/syncthing-discosrv.in (nonexistent) +++ head/net/syncthing/files/syncthing-discosrv.in (revision 470134) @@ -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" Property changes on: head/net/syncthing/files/syncthing-discosrv.in ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/net/syncthing/files/syncthing-relaypoolsrv.in =================================================================== --- head/net/syncthing/files/syncthing-relaypoolsrv.in (nonexistent) +++ head/net/syncthing/files/syncthing-relaypoolsrv.in (revision 470134) @@ -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" Property changes on: head/net/syncthing/files/syncthing-relaypoolsrv.in ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/net/syncthing/files/syncthing-relaysrv.in =================================================================== --- head/net/syncthing/files/syncthing-relaysrv.in (nonexistent) +++ head/net/syncthing/files/syncthing-relaysrv.in (revision 470134) @@ -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" Property changes on: head/net/syncthing/files/syncthing-relaysrv.in ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/net/syncthing/files/syncthing.in =================================================================== --- head/net/syncthing/files/syncthing.in (revision 470133) +++ head/net/syncthing/files/syncthing.in (revision 470134) @@ -1,52 +1,59 @@ #!/bin/sh # $FreeBSD$ # # PROVIDE: syncthing -# REQUIRE: LOGIN +# REQUIRE: DAEMON # 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_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 name=syncthing 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 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} + 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"