aboutsummaryrefslogtreecommitdiff
path: root/security/openfwtk/Makefile
blob: fb4dbfc5ad3fd653c7fd9de1d6de5b33175da345 (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
# Created by: Anton Karpov <toxa@toxahost.ru>
# $FreeBSD$

PORTNAME=	openfwtk
PORTVERSION=	2.0
PORTREVISION=	1
CATEGORIES=	security
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/Release%20${PORTVERSION}
DISTNAME=	${PORTNAME}${PORTVERSION}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Application proxy toolkit which inherits the ideology of TIS fwtk

LICENSE=	BSD

OPTIONS_DEFINE=	GUI
GUI_DESC=	Install fw-watch GUI (require TCL/TK!)

WRKSRC=		${WRKDIR}/fwtk
WRKSRC_WATCH=	${WRKDIR}/fw_watch
WRKSRC_MILTER=	${WRKDIR}/libci_milter

MAKE_JOBS_UNSAFE=yes

SUB_FILES=	pkg-message
MANCOMPRESSED=	no

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

.if ${PORT_OPTIONS:MGUI}
USE_TK_WRAPPER=	yes
PLIST_SUB+=	WATCH=""
.else
PLIST_SUB+=	WATCH="@comment "
.endif

.include <bsd.port.pre.mk>

.if ${OSVERSION} > 900007
BROKEN=		fails to build with new utmpx
.endif

post-patch:
.for conf in auth/authadduser.sh reports/summ_resources.sh \
	reports/daily_report reports/frequentcheck \
	reports/frequentcheck.sh squid-gw/squid-gw.restart
	@${REINPLACE_CMD} -e \
		's|/etc/openfwtk.conf|${PREFIX}/etc/openfwtk.conf|g' ${WRKSRC}/${conf}
.endfor
.for wish in fileselect.tcl fw_watch
	@${REINPLACE_CMD} -e \
		's|/usr/bin/|${LOCALBASE}/bin/|g' ${WRKSRC_WATCH}/${wish}
.endfor
	@${REINPLACE_CMD} -e \
		'/^CC/s|=.*|= ${CC}|g ; \
		 /^COPT/s|=.*|= ${CFLAGS}|g' ${WRKSRC_MILTER}/Makefile
	@${REINPLACE_CMD} -e \
		'/^CC/s|=.*|= ${CC}|g ; \
		 /^COPT/s|-std=c99|${CFLAGS}|g' ${WRKSRC}/configs/FreeBSD

pre-build:
	@(cd ${WRKSRC_MILTER}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})

pre-install:
	@${MKDIR} ${ETCDIR}

post-install:
.if ${PORT_OPTIONS:MGUI}
	@${MKDIR} ${PREFIX}/share/fw_watch
.for data in fileselect.tcl fw_watch newsb.tcl searchbox.tcl taputils.tcl
	${INSTALL_DATA} ${WRKSRC_WATCH}/${data} ${PREFIX}/share/fw_watch
.endfor
.endif
	${ECHO_CMD} "root@`hostname`" > ${ETCDIR}/admin
	@${CAT} ${PKGMESSAGE}

.include "Makefile.man"
.include <bsd.port.post.mk>