net/syncthing-discosrv: add rc script, sync distinfo

This commit is contained in:
Steve Wills 2014-09-29 01:06:00 +00:00
parent 4b00bf9444
commit 07803f29e4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=369507
3 changed files with 65 additions and 5 deletions

View file

@ -3,6 +3,7 @@
PORTNAME= syncthing-discosrv
PORTVERSION= 0.0.0.2014081401
PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/archive/${GH_TAGNAME}.tar.gz?dummy=/:group1 \
https://codeload.github.com/juju/ratelimit/legacy.tar.gz/f9f36d1?dummy=/:group2 \
@ -26,13 +27,17 @@ BUILD_DEPENDS= ${LOCALBASE}/bin/go:${PORTSDIR}/lang/go
GH_ACCOUNT= syncthing
GH_PROJECT= discosrv
GH_COMMIT= f2b3bb0
GH_COMMIT= f2b3bb063f83f24d6c6e10013ea467d5967eb0cf
GH_TAGNAME= ${GH_COMMIT}
WRKSRC= ${WRKDIR}/discosrv-f2b3bb063f83f24d6c6e10013ea467d5967eb0cf
WRKSRC= ${WRKDIR}/discosrv-${GH_COMMIT}
PLIST_FILES= bin/syncthing-discosrv
USE_RC_SUBR= syncthing-discosrv
USERS= syncthing
GROUPS= syncthing
post-patch:
cd ${WRKSRC} ; \
${MKDIR} src/github.com/juju ; \
@ -55,7 +60,7 @@ post-patch:
do-build:
cd ${WRKSRC} ; ${SETENV} GOPATH=${WRKSRC} go build
${MV} ${WRKSRC}/discosrv-f2b3bb063f83f24d6c6e10013ea467d5967eb0cf ${WRKSRC}/syncthing-discosrv
${MV} ${WRKSRC}/discosrv-${GH_COMMIT} ${WRKSRC}/syncthing-discosrv
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/syncthing-discosrv ${STAGEDIR}${PREFIX}/bin/

View file

@ -6,8 +6,8 @@ SHA256 (syncthing-0.9.4.tar.gz) = e1cfbc3055ca26662d9f3664bd236357f84f6523360cc2
SIZE (syncthing-0.9.4.tar.gz) = 1814400
SHA256 (calmh-xdr-e1714bb.tar.gz) = 354133594fc70dac499a44ffd6d857f1f730345f8db3d07def4e38daec5ec791
SIZE (calmh-xdr-e1714bb.tar.gz) = 9250
SHA256 (text.go-d65bffbc88a1.tar.gz) = 5b87e4dddc48c363bf190982a0d229ed5c9b57793ae4ec68004dc1c2f2a31309
SIZE (text.go-d65bffbc88a1.tar.gz) = 3231005
SHA256 (text.go-d65bffbc88a1.tar.gz) = c78ad1d2bbd296ccddba7c86e4250f66490a3479c068a78a520fd42d68e0aa9d
SIZE (text.go-d65bffbc88a1.tar.gz) = 3234551
SHA256 (bkaradzic-go-lz4-77e2ba8.tar.gz) = 8d6a3f73bb2e21a64292d14af1a8466707c14f71b70d48fde317746cd2ac8d0e
SIZE (bkaradzic-go-lz4-77e2ba8.tar.gz) = 232876
SHA256 (golang-groupcache-8b25adc.tar.gz) = 458f35584a960462eec4b50e9068ff6095034c27db2a53cbe22e3e3e9e3fa35d

View file

@ -0,0 +1,55 @@
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: syncthingdiscosrv
# REQUIRE: LOGIN
# 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/tmp/syncthing".
. /etc/rc.subr
name=syncthingdiscosrv
rcvar=syncthingdiscosrv_enable
load_rc_config $name
: ${syncthingdiscosrv_enable:="NO"}
: ${syncthingdiscosrv_user:="syncthing"}
: ${syncthingdiscosrv_group:="syncthing"}
: ${syncthingdiscosrv_dir:="/var/tmp/syncthing"}
export STNORESTART=true
export HOME=${syncthingdiscosrv_dir}
pidfile=/var/run/syncthingdiscosrv.pid
procname="%%PREFIX%%/bin/syncthing-discosrv"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} ${procname} ${syncthingdiscosrv_flags}"
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
}
run_rc_command "$1"