diff options
author | feld <feld@FreeBSD.org> | 2016-11-02 05:02:13 +0800 |
---|---|---|
committer | feld <feld@FreeBSD.org> | 2016-11-02 05:02:13 +0800 |
commit | 70df6f3846c63e19197fe5a4f518710835301cea (patch) | |
tree | 24a764342caa5e9b9b53ad784c8eedfbdb30f04d /net-mgmt | |
parent | 8cb3c034cad3f8af883412403cca20de4974771b (diff) | |
download | freebsd-ports-gnome-70df6f3846c63e19197fe5a4f518710835301cea.tar.gz freebsd-ports-gnome-70df6f3846c63e19197fe5a4f518710835301cea.tar.zst freebsd-ports-gnome-70df6f3846c63e19197fe5a4f518710835301cea.zip |
net-mgmt/rancid3: port improvements
- Add periodic script
- Change PREFIX to LOCALBASE in port Makefile
- Inform users of periodic script via updated pkg-message
MFH: 2016Q4
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/rancid3/Makefile | 60 | ||||
-rw-r--r-- | net-mgmt/rancid3/files/200.rancid.in | 20 | ||||
-rw-r--r-- | net-mgmt/rancid3/files/pkg-message.in | 4 | ||||
-rw-r--r-- | net-mgmt/rancid3/pkg-plist | 1 |
4 files changed, 56 insertions, 29 deletions
diff --git a/net-mgmt/rancid3/Makefile b/net-mgmt/rancid3/Makefile index a77beb5e52e7..bcb328cc7f72 100644 --- a/net-mgmt/rancid3/Makefile +++ b/net-mgmt/rancid3/Makefile @@ -3,7 +3,7 @@ PORTNAME= rancid PORTVERSION= 3.5.1 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= ftp://ftp.shrubbery.net/pub/rancid/ PKGNAMESUFFIX= 3 @@ -21,12 +21,12 @@ SHEBANG_FILES= bin/* USERS= rancid GROUPS= rancid -SUB_FILES= pkg-message +SUB_FILES= pkg-message 200.rancid GNU_CONFIGURE= yes -CONFIGURE_ARGS= --localstatedir=${PREFIX}/var/${PORTNAME}/ \ - --bindir=${PREFIX}/libexec/${PORTNAME}/ \ - --sysconfdir=${PREFIX}/etc/${PORTNAME}/ +CONFIGURE_ARGS= --localstatedir=${LOCALBASE}/var/${PORTNAME}/ \ + --bindir=${LOCALBASE}/libexec/${PORTNAME}/ \ + --sysconfdir=${LOCALBASE}/etc/${PORTNAME}/ OLDCONFIG_FILE1= bin/env OLDCONFIG_FILE2= util/lg/lg.conf @@ -71,43 +71,45 @@ post-patch: ${MV} ${WRKSRC}/man/par.1 ${WRKSRC}/man/rancid-par.1 post-install: - ${LN} -s ${PREFIX}/libexec/${PORTNAME}/rancid-cvs ${STAGEDIR}${PREFIX}/bin - ${LN} -s ${PREFIX}/libexec/${PORTNAME}/rancid-run ${STAGEDIR}${PREFIX}/bin + ${MKDIR} ${STAGEDIR}${LOCALBASE}/etc/periodic/hourly + ${INSTALL_SCRIPT} ${WRKDIR}/200.rancid ${STAGEDIR}${LOCALBASE}/etc/periodic/hourly + ${LN} -s ${LOCALBASE}/libexec/${PORTNAME}/rancid-cvs ${STAGEDIR}${LOCALBASE}/bin + ${LN} -s ${LOCALBASE}/libexec/${PORTNAME}/rancid-run ${STAGEDIR}${LOCALBASE}/bin .if ${PORT_OPTIONS:MCOMWARE} - ${INSTALL_DATA} ${FILESDIR}/cmw.pm ${STAGEDIR}/${PREFIX}/lib/rancid - ${INSTALL_SCRIPT} ${FILESDIR}/cmwlogin ${STAGEDIR}/${PREFIX}/libexec/rancid + ${INSTALL_DATA} ${FILESDIR}/cmw.pm ${STAGEDIR}/${LOCALBASE}/lib/rancid + ${INSTALL_SCRIPT} ${FILESDIR}/cmwlogin ${STAGEDIR}/${LOCALBASE}/libexec/rancid .endif .for file in ${NEWCONFIG_FILES} - @ if [ -f ${PREFIX}/etc/${PORTNAME}/${file} ] ; then \ - ${ECHO} "WARNING: *** new ${file} file is installed as ${PREFIX}/rancid/${file}.sample"; \ + @ if [ -f ${LOCALBASE}/etc/${PORTNAME}/${file} ] ; then \ + ${ECHO} "WARNING: *** new ${file} file is installed as ${LOCALBASE}/rancid/${file}.sample"; \ ${ECHO} " : *** review ${file}.sample for new/deprecated switches or install in place ${file}"; \ fi .endfor - @ if [ -f ${PREFIX}/rancid/${NEWERCONFIG_FILE1} ] ; then \ - ${ECHO} "WARNING: *** ${PREFIX}/rancid/${NEWERCONFIG_FILE1} has been replaced with "; \ - ${ECHO} " : *** ${PREFIX}/etc/${PORTNAME}/rancid.conf. Merge from sample and old file "; \ + @ if [ -f ${LOCALBASE}/rancid/${NEWERCONFIG_FILE1} ] ; then \ + ${ECHO} "WARNING: *** ${LOCALBASE}/rancid/${NEWERCONFIG_FILE1} has been replaced with "; \ + ${ECHO} " : *** ${LOCALBASE}/etc/${PORTNAME}/rancid.conf. Merge from sample and old file "; \ fi - @ if [ -f ${PREFIX}/rancid/${NEWERCONFIG_FILE2} ] ; then \ - ${ECHO} "WARNING: *** ${PREFIX}/rancid/${NEWERCONFIG_FILE2} has been replaced with "; \ - ${ECHO} " : *** ${PREFIX}/etc/${PORTNAME}/lg.conf. Merge from sample and old file "; \ + @ if [ -f ${LOCALBASE}/rancid/${NEWERCONFIG_FILE2} ] ; then \ + ${ECHO} "WARNING: *** ${LOCALBASE}/rancid/${NEWERCONFIG_FILE2} has been replaced with "; \ + ${ECHO} " : *** ${LOCALBASE}/etc/${PORTNAME}/lg.conf. Merge from sample and old file "; \ fi - @ if [ -f ${PREFIX}/rancid/${NEWERCONFIG_FILE1} -o \ - -f ${PREFIX}/rancid/${NEWERCONFIG_FILE2} ] ; then \ - ${ECHO} "WARNING: *** New CVS Repository will be stored ${PREFIX}/var/${PORTNAME}/ "; \ + @ if [ -f ${LOCALBASE}/rancid/${NEWERCONFIG_FILE1} -o \ + -f ${LOCALBASE}/rancid/${NEWERCONFIG_FILE2} ] ; then \ + ${ECHO} "WARNING: *** New CVS Repository will be stored ${LOCALBASE}/var/${PORTNAME}/ "; \ ${ECHO} " : *** Copy the repository if you want to keep the history "; \ fi - @ if [ -f ${PREFIX}/rancid/${OLDCONFIG_FILE1} ] ; then \ - ${ECHO} "WARNING: *** ${PREFIX}/rancid/${OLDCONFIG_FILE1} has been replaced with "; \ - ${ECHO} " : *** ${PREFIX}/etc/${PORTNAME}/rancid.conf. Merge from sample and old file "; \ + @ if [ -f ${LOCALBASE}/rancid/${OLDCONFIG_FILE1} ] ; then \ + ${ECHO} "WARNING: *** ${LOCALBASE}/rancid/${OLDCONFIG_FILE1} has been replaced with "; \ + ${ECHO} " : *** ${LOCALBASE}/etc/${PORTNAME}/rancid.conf. Merge from sample and old file "; \ fi - @ if [ -f ${PREFIX}/rancid/${OLDCONFIG_FILE2} ] ; then \ - ${ECHO} "WARNING: *** ${PREFIX}/rancid/${OLDCONFIG_FILE2} has been replaced with "; \ - ${ECHO} " : *** ${PREFIX}/etc/${PORTNAME}/lg.conf. Merge from sample and old file "; \ + @ if [ -f ${LOCALBASE}/rancid/${OLDCONFIG_FILE2} ] ; then \ + ${ECHO} "WARNING: *** ${LOCALBASE}/rancid/${OLDCONFIG_FILE2} has been replaced with "; \ + ${ECHO} " : *** ${LOCALBASE}/etc/${PORTNAME}/lg.conf. Merge from sample and old file "; \ fi - @ if [ -f ${PREFIX}/rancid/${OLDCONFIG_FILE1} -o \ - -f ${PREFIX}/rancid/${OLDCONFIG_FILE2} ] ; then \ - ${ECHO} "WARNING: *** New CVS Repository will be stored ${PREFIX}/rancid/var "; \ + @ if [ -f ${LOCALBASE}/rancid/${OLDCONFIG_FILE1} -o \ + -f ${LOCALBASE}/rancid/${OLDCONFIG_FILE2} ] ; then \ + ${ECHO} "WARNING: *** New CVS Repository will be stored ${LOCALBASE}/rancid/var "; \ ${ECHO} " : *** Copy the repository if you want to keep the history "; \ fi diff --git a/net-mgmt/rancid3/files/200.rancid.in b/net-mgmt/rancid3/files/200.rancid.in new file mode 100644 index 000000000000..b41a2931463e --- /dev/null +++ b/net-mgmt/rancid3/files/200.rancid.in @@ -0,0 +1,20 @@ +#!/bin/sh + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ]; then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +# hourly_rancid_enable - Enable hourly rancid run (values: YES | NO) + +case "${hourly_rancid_enable-"NO"}" in + [Yy][Ee][Ss]) + /usr/bin/su -f rancid %%LOCALBASE%%/libexec/rancid/rancid-run + ;; + + *) + exit 0 + ;; +esac diff --git a/net-mgmt/rancid3/files/pkg-message.in b/net-mgmt/rancid3/files/pkg-message.in index c1f59582807f..28bcadc986e7 100644 --- a/net-mgmt/rancid3/files/pkg-message.in +++ b/net-mgmt/rancid3/files/pkg-message.in @@ -9,3 +9,7 @@ you need to install devel/cvsweb or devel/viewvc. For rancid looking-glass copy the actual CGIs (located at %%PREFIX%%/libexec/rancid/{lg.cgi lgform.cgi}) to your cgi-bin. + +Schedule rancid-run with cron at your desired interval or add +hourly_rancid_enable="YES" to /etc/periodic.conf for automatic hourly +runs. diff --git a/net-mgmt/rancid3/pkg-plist b/net-mgmt/rancid3/pkg-plist index e302bf465f3a..b617ee5abfe8 100644 --- a/net-mgmt/rancid3/pkg-plist +++ b/net-mgmt/rancid3/pkg-plist @@ -1,5 +1,6 @@ bin/rancid-cvs bin/rancid-run +etc/periodic/hourly/200.rancid lib/rancid/acos.pm lib/rancid/arbor.pm lib/rancid/ciscowlc.pm |