summaryrefslogtreecommitdiffstats
path: root/net-mgmt/ipplan/Makefile
blob: 393e02d245ef9c3092c439692836db25eb0ea53a (plain)
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
# Created by: Maxim Tuliuk <mt@primats.org.ua>
# $FreeBSD$

PORTNAME=	ipplan
PORTVERSION=	4.92b
CATEGORIES=	net-mgmt
MASTER_SITES=	SF/iptrack/${PORTNAME}/Release%204.92

MAINTAINER=	miwi@FreeBSD.org
COMMENT=	IP address management and tracking

RUN_DEPENDS=	nmap:${PORTSDIR}/security/nmap

USES=		perl5
USE_PERL5=	run
USE_PHP=	gettext pcre xml zlib

NO_BUILD=	yes
WRKSRC=		${WRKDIR}/${PORTNAME}
IPPLANDIR?=	share/${PORTNAME}
CONFIG=		config.php
SUB_FILES=	pkg-message
PLIST_SUB=	IPPLANDIR=${IPPLANDIR}
SUB_LIST+=	IPPLANDIR=${IPPLANDIR}

.if !defined(WITHOUT_MYSQL)
USE_PHP+=	mysql
.endif

.if defined(WITH_PGSQL)
USE_PHP+=	pgsql
.endif

.if defined(WITH_SNMP)
USE_PHP+=	snmp
.endif

NO_STAGE=	yes
.include <bsd.port.pre.mk>

post-patch:
	@${REINPLACE_CMD} -e "s|/usr/bin/perl|${PERL}|" \
		-e "s|/usr/bin/xsltproc|${LOCALBASE}/bin/xsltproc|" \
		${WRKSRC}/contrib/process-exports.pl
	@${REINPLACE_CMD} -e "s|/usr/local/bin/php|${LOCALBASE}/bin/php|" \
		${WRKSRC}/contrib/ipplan-poller.php
	@${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|" \
		${WRKSRC}/config.php
	@${FIND} ${WRKSRC} -name '*.orig' -delete -o -name '*.bak' -delete

pre-install:
	@${MV} ${WRKSRC}/${CONFIG} ${WRKSRC}/${CONFIG}.sample

do-install:
	@${MKDIR} ${PREFIX}/${IPPLANDIR}
	@cd ${WRKSRC} && ${FIND} * | \
	${CPIO} -dlmp -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/${IPPLANDIR}

post-install:
.if !exists(${PREFIX}/${IPPLANDIR}/${CONFIG})
	@${INSTALL_DATA} ${WRKSRC}/${CONFIG}.sample \
	${PREFIX}/${IPPLANDIR}/${CONFIG}
.endif
	@${MKDIR} -m 700 /var/spool/ipplan/uploads \
		/var/spool/ipplan/exportdns
	@${CHOWN} -R www:www /var/spool/ipplan
.if defined(WITH_PGSQL)
	@${REINPLACE_CMD} -e 's|INSTALL|INSTALL-POSTGRESQL|g' ${PKGMESSAGE}
.endif
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud