aboutsummaryrefslogtreecommitdiffstats
path: root/net/cvsync
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2004-05-11 20:13:26 +0800
committerhrs <hrs@FreeBSD.org>2004-05-11 20:13:26 +0800
commita48cbfdd5b089ed30a317d2c42f85ebd6f463f7d (patch)
tree77bdf53d3e5b84aa5578da814f1c59b4f6e55d40 /net/cvsync
parentb5a9e72ecf1549fcb14988c6307be6f47b8614ca (diff)
downloadfreebsd-ports-gnome-a48cbfdd5b089ed30a317d2c42f85ebd6f463f7d.tar.gz
freebsd-ports-gnome-a48cbfdd5b089ed30a317d2c42f85ebd6f463f7d.tar.zst
freebsd-ports-gnome-a48cbfdd5b089ed30a317d2c42f85ebd6f463f7d.zip
Add USE_RC_SUBR=yes and rcNG-style startup script.
Approved by: linimon (mentor)
Diffstat (limited to 'net/cvsync')
-rw-r--r--net/cvsync/Makefile11
-rw-r--r--net/cvsync/files/cvsyncd.sh44
-rw-r--r--net/cvsync/pkg-plist1
3 files changed, 56 insertions, 0 deletions
diff --git a/net/cvsync/Makefile b/net/cvsync/Makefile
index 54b144ff2ac9..9643e6477d08 100644
--- a/net/cvsync/Makefile
+++ b/net/cvsync/Makefile
@@ -7,6 +7,7 @@
PORTNAME= cvsync
PORTVERSION= 0.24.15
+PORTREVISION= 1
CATEGORIES= net ipv6
MASTER_SITES= ftp://ftp.cvsync.org/pub/cvsync/ \
ftp://ftp.allbsd.org/pub/cvsync/
@@ -15,12 +16,15 @@ MAINTAINER= hrs@FreeBSD.org
COMMENT= A portable CVS repository synchronization utility
USE_GMAKE= yes
+USE_RC_SUBR= yes
MAN1= cvscan.1 cvsup2cvsync.1 cvsync.1 cvsync2cvsup.1 cvsyncd.1 \
rcscan.1 rcscmp.1
DOCS= doc/COPYRIGHT doc/ChangeLog doc/FAQ doc/TODO
EXAMPLES= samples/cvsync.conf samples/cvsyncd-FreeBSD.conf \
samples/cvsyncd-NetBSD.conf samples/cvsyncd-OpenBSD.conf
+STARTUPDIR= etc/rc.d
+STARTUPFILES= cvsyncd.sh
MAKE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" PTHREAD_LIBS="${PTHREAD_LIBS}"
MAKE_FLAGS= OSVER="${OSVERSION}"
@@ -29,8 +33,15 @@ MAKE_FLAGS= OSVER="${OSVERSION}"
USE_OPENSSL= yes
MAKE_FLAGS+= HASH_TYPE=openssl
.endif
+PLIST_SUB= STARTUPDIR=${STARTUPDIR}
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
post-install:
+.for file in ${STARTUPFILES}
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/${file} > ${WRKDIR}/${file}
+ ${INSTALL_SCRIPT} ${WRKDIR}/${file} ${PREFIX}/${STARTUPDIR}/${file}
+.endfor
@${MKDIR} ${EXAMPLESDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${EXAMPLESDIR}
.if !defined(NOPORTDOCS)
diff --git a/net/cvsync/files/cvsyncd.sh b/net/cvsync/files/cvsyncd.sh
new file mode 100644
index 000000000000..e90e52fd55c0
--- /dev/null
+++ b/net/cvsync/files/cvsyncd.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: cvsyncd
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD
+#
+cvsyncd_enable="NO"
+cvsyncd_pidfile="/var/run/cvsyncd.pid"
+cvsyncd_conffile="%%PREFIX%%/etc/cvsyncd.conf"
+cvsyncd_flags=""
+
+. %%RC_SUBR%%
+
+name=cvsyncd
+rcvar=`set_rcvar`
+command=%%PREFIX%%/bin/${name}
+
+load_rc_config ${name}
+
+case "${cvsyncd_flags}" in
+*-p\ *)
+ echo "Warning: \$cvsyncd_flags includes -p option." \
+ "Please use \$cvsyncd_pidfile instead."
+ ;;
+*)
+ cvsyncd_flags="-p ${cvsyncd_pidfile} ${cvsyncd_flags}" ;;
+esac
+
+case "${cvsyncd_flags}" in
+*-c\ *)
+ echo "Warning: \$cvsyncd_flags includes -c option." \
+ "Please use \$cvsyncd_conffile instead."
+ ;;
+*)
+ cvsyncd_flags="-c ${cvsyncd_conffile} ${cvsyncd_flags}" ;;
+esac
+
+pidfile=${cvsyncd_pidfile}
+required_files=${cvsyncd_conffile}
+
+run_rc_command "$1"
+
diff --git a/net/cvsync/pkg-plist b/net/cvsync/pkg-plist
index 24c2747558f6..e96cc0be1118 100644
--- a/net/cvsync/pkg-plist
+++ b/net/cvsync/pkg-plist
@@ -15,4 +15,5 @@ bin/rcscmp
%%EXAMPLESDIR%%/cvsyncd-FreeBSD.conf
%%EXAMPLESDIR%%/cvsyncd-NetBSD.conf
%%EXAMPLESDIR%%/cvsyncd-OpenBSD.conf
+%%STARTUPDIR%%/cvsyncd.sh
@dirrm %%EXAMPLESDIR%%