mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-12 03:00:28 +00:00
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
This commit is contained in:
parent
76d5b46f9b
commit
ecdb841de9
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=425092
@ -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
|
||||
|
||||
|
20
net-mgmt/rancid3/files/200.rancid.in
Normal file
20
net-mgmt/rancid3/files/200.rancid.in
Normal file
@ -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
|
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user