aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/rancid3/Makefile
blob: 99aa19adf2dbd2389781c7d31f9e7adc75005cfd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Created by: Janos.Mohacsi@bsd.hu
# $FreeBSD$

PORTNAME=	rancid
PORTVERSION=	3.1
PORTREVISION=	1
CATEGORIES=	net-mgmt
MASTER_SITES=	ftp://ftp.shrubbery.net/pub/rancid/
PKGNAMESUFFIX=	3

MAINTAINER=	feld@FreeBSD.org
COMMENT=	Really Awesome New Cisco confIg Differ

LIB_DEPENDS=	libexpect.so:${PORTSDIR}/lang/expect
RUN_DEPENDS=	p5-LockFile-Simple>=0:${PORTSDIR}/devel/p5-LockFile-Simple

USES=		gmake perl5 shebangfix
perl_OLD_CMD=	@PERLV_PATH@
SHEBANG_FILES=	bin/*

USERS=		rancid
GROUPS=		rancid

SUB_FILES=	pkg-message
GNU_CONFIGURE=	yes

CONFIGURE_ARGS=	--localstatedir=${PREFIX}/var/${PORTNAME}/ \
		--bindir=${PREFIX}/libexec/${PORTNAME}/ \
		--sysconfdir=${PREFIX}/etc/${PORTNAME}/

OLDCONFIG_FILE1=	bin/env
OLDCONFIG_FILE2=	util/lg/lg.conf
NEWERCONFIG_FILES1=	etc/rancid.conf
NEWERCONFIG_FILES2=	etc/lg.conf
NEWCONFIG_FILES=	rancid.conf lg.conf

OPTIONS_DEFINE=		SVN
OPTIONS_DEFAULT=

SVN_DESC=		Use Subversion instead of CVS

CONFLICTS=	rancid-[0-9]*

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSVN}
CONFIGURE_ARGS+=	--with-svn
BUILD_DEPENDS+=		svn:${PORTSDIR}/devel/subversion
.else
CONFIGURE_ARGS+=	--without-svn
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000
RUN_DEPENDS+=	cvs>0:${PORTSDIR}/devel/cvs
.endif
.endif

pre-everything::
	@ ${ECHO} "Make sure your rancid repository is quiet before upgrading; disable rancid cron jobs"

post-patch:
	${REINPLACE_CMD} "s|par.1|rancid-par.1|" ${WRKSRC}/man/Makefile.in ${WRKSRC}/man/Makefile.am
	${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
.if !defined(BATCH)
	@ ${ECHO}
	@ ${CAT} ${PKGMESSAGE}
	@ ${ECHO}
.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"; \
	${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 "; \
	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 "; \
	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}/ "; \
	${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 "; \
	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 "; \
	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 "; \
	${ECHO} "       : *** Copy the repository if you want to keep the history "; \
	fi

.include <bsd.port.mk>