Index: branches/2018Q2/sysutils/zrepl/Makefile =================================================================== --- branches/2018Q2/sysutils/zrepl/Makefile (revision 468628) +++ branches/2018Q2/sysutils/zrepl/Makefile (revision 468629) @@ -1,52 +1,61 @@ # Created by: Nikolai Lifanov and Ben Woods # $FreeBSD$ PORTNAME= zrepl PORTVERSION= 0.0.2 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= woodsb02@FreeBSD.org COMMENT= ZFS dataset replication tool LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE USES= go USE_RC_SUBR= zrepl SUB_FILES= pkg-message USE_GITHUB= yes GH_SUBDIR= src/github.com/zrepl/zrepl GH_TUPLE= davecgh:go-spew:v1.1.0:go_spew/src/github.com/davecgh/go-spew \ ftrvxmtrx:fd:c6d8003:fd/src/github.com/ftrvxmtrx/fd \ go-logfmt:logfmt:v0.3.0:go_logfmt/src/github.com/go-logfmt/logfmt \ go-yaml:yaml:eb3733d:go_yaml/src/github.com/go-yaml/yaml \ inconshreveable:mousetrap:v1.0:mousetrap/src/github.com/inconshreveable/mousetrap \ jinzhu:copier:db4671f:copier/src/github.com/jinzhu/copier \ kr:logfmt:b84e30a:logfmt/src/github.com/kr/logfmt \ kr:pretty:cfb55aa:pretty/src/github.com/kr/pretty \ kr:text:7cafcd8:text/src/github.com/kr/text \ mitchellh:mapstructure:d0303fe:mapstructure/src/github.com/mitchellh/mapstructure \ pkg:errors:v0.8.0:errors/src/github.com/pkg/errors \ pmezard:go-difflib:v1.0.0:go_difflib/src/github.com/pmezard/go-difflib \ spf13:cobra:b787445:cobra/src/github.com/spf13/cobra \ spf13:pflag:v1.0.0:pflag/src/github.com/spf13/pflag \ stretchr:testify:v1.1.4:testify/src/github.com/stretchr/testify GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT} +.include + +.if ${OPSYS} == "FreeBSD" && ((${OSVERSION} >= 1100513 && ${OSVERSION} < 1200000) || ${OSVERSION} >= 1200015) +SUB_LIST+= DAEMON_LOGGING="-S -l \$${zrepl_facility} -s \$${zrepl_priority} -T \$${name}" +.else +SUB_LIST+= DAEMON_LOGGING="" +.endif + post-extract: ${LN} -sf ${WRKSRC}/src ${WRKDIR} do-install: ${INSTALL_PROGRAM} ${WRKDIR}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d \ ${STAGEDIR}${PREFIX}/etc/syslog.d \ ${STAGEDIR}${PREFIX}/etc/zrepl ${INSTALL_DATA} ${FILESDIR}/newsyslog-zrepl.conf ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/zrepl.conf.sample ${INSTALL_DATA} ${FILESDIR}/syslog-zrepl.conf.sample ${STAGEDIR}${PREFIX}/etc/syslog.d/zrepl.conf.sample ${INSTALL_DATA} ${FILESDIR}/zrepl.yml.sample ${STAGEDIR}${PREFIX}/etc/zrepl/zrepl.yml.sample -.include +.include Index: branches/2018Q2/sysutils/zrepl/files/zrepl.in =================================================================== --- branches/2018Q2/sysutils/zrepl/files/zrepl.in (revision 468628) +++ branches/2018Q2/sysutils/zrepl/files/zrepl.in (revision 468629) @@ -1,59 +1,70 @@ #!/bin/sh # $FreeBSD$ # # PROVIDE: zrepl # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # -# zrepl_enable: Set to YES to enable the zrepl service. +# zrepl_enable (bool): Set to YES to enable the zrepl service. # Default: NO -# zrepl_config: File containing zrepl configuration details. +# zrepl_config (str): File containing zrepl configuration details. # Default: %%PREFIX%%/etc/zrepl/zrepl.yml -# zrepl_user: The user account used to run the zrepl daemon. +# zrepl_user (str): The user account used to run the zrepl daemon. # Do not specifically set this to an empty string as this # will cause the daemon to run as root. # Default: root -# zrepl_group: The group account used to run the zrepl daemon. +# zrepl_group (str): The group account used to run the zrepl daemon. # Do not specifically set this to an empty string as this # will cause the daemon to run with group wheel. # Default: wheel +# zrepl_flags (str): Extra flags passed to zrepl +# Default: "" +# zrepl_facility (str): Syslog facility to use +# Default: local0 +# zrepl_priority (str): Syslog priority to use +# Default: alert . /etc/rc.subr name=zrepl rcvar=${name}_enable load_rc_config $name : ${zrepl_enable:="NO"} : ${zrepl_config:="%%PREFIX%%/etc/zrepl/zrepl.yml"} : ${zrepl_user:="root"} : ${zrepl_group:="wheel"} +: ${zrepl_flags:=""} +: ${zrepl_facility:="local0"} +: ${zrepl_priority:="alert"} +: ${zrepl_options:="${zrepl_flags} --config ${zrepl_config} daemon"} pidfile="/var/run/zrepl/daemon.pid" command="/usr/sbin/daemon" procname="%%PREFIX%%/bin/zrepl" -command_args="-p ${pidfile} -S -l local0 -s alert -T zrepl ${procname} --config ${zrepl_config} daemon" +command_args="-p ${pidfile} %%DAEMON_LOGGING%% ${procname} ${zrepl_options}" start_precmd=zrepl_precmd +stop_postcmd=zrepl_postcmd + zrepl_precmd() { if [ ! -d "/var/run/zrepl/stdinserver" ]; then install -d -g ${zrepl_group} -o ${zrepl_user} -m 0700 -- "/var/run/zrepl"; install -d -g ${zrepl_group} -o ${zrepl_user} -m 0700 -- "/var/run/zrepl/stdinserver"; fi if [ ! -e "${pidfile}" ]; then install -g ${zrepl_group} -o ${zrepl_user} -- /dev/null "${pidfile}"; fi } -stop_postcmd=zrepl_postcmd zrepl_postcmd() { rm -f -- "${pidfile}" } run_rc_command "$1" Index: branches/2018Q2 =================================================================== --- branches/2018Q2 (revision 468628) +++ branches/2018Q2 (revision 468629) Property changes on: branches/2018Q2 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r468402