summaryrefslogtreecommitdiffstats
path: root/security/antivir-milter/Makefile
blob: 5d63d1ddbc8a4326f9a8b89ef226e411c6c37506 (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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# New ports collection makefile for:	antivir-milter
# Date created:				21 September 2003
# Whom:					marius@alchemy.franken.de
#
# $FreeBSD$

PORTNAME=	antivir-milter
PORTVERSION=	1.1.2p1
DISTVERSIONPREFIX=	prof-
DISTVERSION=	${PORTVERSION:C/p/-/}
CATEGORIES=	security mail
MASTER_SITES=	http://dl.antivir.de/down/unix/packages/

MAINTAINER=	marius@FreeBSD.org
COMMENT=	AntiVir Milter mail virusscanner for Sendmail

RESTRICTED=	H+BEDV Datentechnik GmbH forbids any redistribution
NO_PACKAGE=	${RESTRICTED}
NO_CDROM=	${RESTRICTED}

ONLY_FOR_ARCHS=	i386
NO_BUILD=	yes
USE_REINPLACE=	yes
# When the avmilter binary is stripped its self-check fails.
STRIP=
PKGMESSAGE=	${WRKDIR}/pkg-message

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 400000
IGNORE=		requires FreeBSD 4.0 or higher
.endif

.if (!exists(/usr/lib/libmilter.a)) && (!exists(${LOCALBASE}/lib/libmilter.a))
IGNORE=		requires Sendmail 8.12
.endif

.if ${OSVERSION} >= 503001
BINSRC=		${WRKSRC}/bin/freebsd5
.if ${OSVERSION} > 600004
LIB_DEPENDS=	c.5:${PORTSDIR}/misc/compat5x
.endif
.else
BINSRC=		${WRKSRC}/bin/freebsd
.endif

post-extract:
	@${CP} ${FILESDIR}/avq.sh ${WRKSRC}/script/avq

post-patch:
.for i in doc/MANUAL doc/RELEASE_NOTES etc/antivir.conf etc/avmilter.conf \
	pgp/README script/avq script/avupdater script/rc.avmilter
	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g; \
		s|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/${i}
.endfor
	@${SED} 's|%%PREFIX%%|${PREFIX}|g' ${PKGDIR}/pkg-message > \
		${WRKDIR}/pkg-message
	@${SED} 's|%%PREFIX%%|${PREFIX}|g' ${FILESDIR}/antivirupdater.sh > \
		${WRKDIR}/antivirupdater.sh
	@${SED} 's|%%PREFIX%%|${PREFIX}|g' ${FILESDIR}/avqrm.sh > \
		${WRKDIR}/avqrm.sh

do-install:
	@${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 ${PREFIX}/AntiVir
	@${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 ${BINSRC}/antivir \
		${PREFIX}/AntiVir/antivir-dist_avmilter
.if !exists(${PREFIX}/AntiVir/antivir)
	@${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 ${BINSRC}/antivir \
		${PREFIX}/AntiVir
.endif
.for i in antivir0.vdf antivir1.vdf antivir2.vdf antivir3.vdf
	@${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${WRKSRC}/vdf/${i} \
		${PREFIX}/AntiVir/${i}-dist_avmilter
.if !exists(${PREFIX}/AntiVir/${i})
	@${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${WRKSRC}/vdf/${i} \
		${PREFIX}/AntiVir
.endif
.endfor
	@${INSTALL_SCRIPT} ${WRKSRC}/script/avq ${PREFIX}/bin
	@${INSTALL} -d ${PREFIX}/etc/avmilter
.for i in avmilter.conf avmilter.ignore avmilter.scan avmilter.warn
	@${INSTALL_DATA} ${WRKSRC}/etc/${i} ${PREFIX}/etc/avmilter/${i}.sample
.if !exists(${PREFIX}/etc/avmilter/${i})
	@${INSTALL_DATA} ${WRKSRC}/etc/${i} ${PREFIX}/etc/avmilter
.endif
.endfor
	@${INSTALL_DATA} ${WRKSRC}/etc/antivir.conf \
		${PREFIX}/etc/antivir.conf.sample
.if !exists(${PREFIX}/etc/antivir.conf)
	@${INSTALL_DATA} ${WRKSRC}/etc/antivir.conf ${PREFIX}/etc
.endif
	@${LN} -sf ${PREFIX}/etc/antivir.conf /etc
	@${INSTALL_PROGRAM} ${BINSRC}/avmilter.bin ${PREFIX}/sbin
	@${INSTALL_SCRIPT} ${WRKDIR}/antivirupdater.sh \
		${PREFIX}/sbin/antivirupdater
	@${INSTALL_SCRIPT} ${WRKDIR}/avqrm.sh ${PREFIX}/bin/avqrm
	@${INSTALL_SCRIPT} ${WRKSRC}/script/avupdater \
		${PREFIX}/etc/rc.d/avupdater.sh-dist_avmilter
	@${INSTALL_SCRIPT} ${WRKSRC}/script/rc.avmilter \
		${PREFIX}/etc/rc.d/avmilter.sh
	@${INSTALL} -d -o smmsp -g smmsp -m 700 /var/spool/avmilter
.for i in incoming outgoing rejected
	@${INSTALL} -d -o smmsp -g smmsp -m 700 /var/spool/avmilter/${i}
.endfor
	@${INSTALL} -d ${EXAMPLESDIR}
.for i in de en es hu it nl
	@${INSTALL} -d ${EXAMPLESDIR}/templates/${i}
.for j in patho-administrator patho-recipient patho-sender virus-administrator \
	virus-recipient virus-sender
	@${INSTALL_DATA} ${WRKSRC}/templates/${i}/${j} \
		${EXAMPLESDIR}/templates/${i}
.endfor
.endfor
.if !defined(NOPORTDOCS)
	@${INSTALL} -d ${DOCSDIR}
.for i in LICENSE LICENSE.DE
	@${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.for i in CHANGELOG MANUAL RELEASE_NOTES avmilter_de.pdf avmilter_en.pdf
	@${INSTALL_DATA} ${WRKSRC}/doc/${i} ${DOCSDIR}
.endfor
	@${INSTALL_DATA} ${WRKSRC}/pgp/README ${DOCSDIR}/README.gpg
	@${INSTALL_DATA} ${WRKSRC}/pgp/antivir.gpg ${DOCSDIR}
.endif

post-install:
	@${CAT} ${WRKDIR}/pkg-message

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