blob: e301e2746c4c50275392e22183ee8a0e4d6213bb (
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
# New ports collection makefile for: clamav-devel
# Date created: 13 June 2003
# Whom: Rob Evers <rob@debank.tv>
#
# $FreeBSD$
#
PORTNAME= clamav
PORTVERSION= 20040826
CATEGORIES= security
MASTER_SITES= http://www.clamav.net/snapshot/
PKGNAMESUFFIX= -devel
DISTNAME= ${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}
MAINTAINER= rob@debank.tv
COMMENT= Command line virus scanner written entirely in C
LIB_DEPENDS= gmp.6:${PORTSDIR}/math/libgmp4
RUN_DEPENDS= lha:${PORTSDIR}/archivers/lha \
unarj:${PORTSDIR}/archivers/unarj \
unrar:${PORTSDIR}/archivers/unrar \
zoo:${PORTSDIR}/archivers/zoo \
arc:${PORTSDIR}/archivers/arc \
unzip:${PORTSDIR}/archivers/unzip
OPTIONS= MILTER "Compile the milter interface" off
USE_REINPLACE= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
USE_AUTOCONF_VER=259
USE_AUTOMAKE_VER=19
USE_LIBTOOL_VER=15
LIBTOOLFILES= acinclude.m4
INSTALLS_SHLIB= yes
USE_RC_SUBR= yes
CONFIGURE_ARGS= --with-dbdir=${DATADIR} \
--disable-clamuko \
--disable-clamav \
--enable-bigstack \
--disable-dependency-tracking
CPPFLAGS+= -I${LOCALBASE}/include
CFLAGS+= ${PTHREAD_CFLAGS} -I${LOCALBASE}/include
LDFLAGS+= ${PTHREAD_LIBS} -L${LOCALBASE}/lib
CONFIGURE_ENV+= CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}"
MAN1= clamscan.1 freshclam.1 sigtool.1 clamdscan.1
MAN5= clamav.conf.5 freshclam.conf.5
MAN8= clamd.8 clamav-milter.8
CONFLICTS= clamav-0.*
CLAMAVUSER?= clamav
CLAMAVGROUP?= clamav
CLAMAV_CLAMD_SOCKET?= /var/run/clamav/clamd
CLAMAV_MILTER_SOCKET?= /var/run/clamav/clmilter.sock
DOCSDIR?= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%DATADIR%%|${DATADIR}|g' \
-e 's|%%CLAMAVUSER%%|${CLAMAVUSER}|g' \
-e 's|%%CLAMAVGROUP%%|${CLAMAVGROUP}|g' \
-e 's|%%CLAMAV_CLAMD_SOCKET%%|${CLAMAV_CLAMD_SOCKET}|g' \
-e 's|%%CLAMAV_MILTER_SOCKET%%|${CLAMAV_MILTER_SOCKET}|g'
SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \
-e 's|^\#?(LogFile) .*$$|\1 /var/log/clamav/clamd.log|' \
-e 's|^\#?(PidFile) .*$$|\1 /var/run/clamav/clamd.pid|' \
-e 's|^\#?(LocalSocket) .*$$|\1 ${CLAMAV_CLAMD_SOCKET}|' \
-e 's|^\#?(User) .*$$|\1 ${CLAMAVUSER}|' \
-e 's|^\#?(AllowSupplementaryGroups)$$|\1|' \
-e 's|^\#?(ScanMail)$$|\1|' \
-e 's|^\#?(Checks)$$|\#\1|' \
-e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DATADIR}|' \
-e 's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' \
-e 's|^\#?(UpdateLogFile) .*$$|\1 /var/log/clamav/freshclam.log|' \
-e 's|^\#?(FixStaleSocket)$$|\1|'
PLIST_SUB+= CLAMAVUSER=${CLAMAVUSER} \
CLAMAVGROUP=${CLAMAVGROUP}
RC_DIR= ${PREFIX}/etc/rc.d
RC_SUFX= .sh
SED_SCRIPT+= -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
-e 's|%%RC_DIR%%|${RC_DIR}|g' \
-e 's|%%RC_SUFX%%|${RC_SUFX}|g'
PLIST_SUB+= RC_DIR=${RC_DIR} \
RC_SUFX=${RC_SUFX}
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 501001
# compiles only with libcipher
LDFLAGS+= -lcipher
.endif
.if defined(WITH_MILTER)
.if !exists(/usr/lib/libmilter.a)
BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
.endif
CONFIGURE_ARGS+= --enable-milter
PLIST_SUB+= CLAMAV-MILTER=""
.else
PLIST_SUB+= CLAMAV-MILTER="@comment "
.endif
post-patch:
@${REINPLACE_CMD} -e 's|/usr/lib/sendmail|/usr/sbin/sendmail|g' \
${WRKSRC}/clamav-milter/clamav-milter.c
@${REINPLACE_CMD} -e 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \
${WRKSRC}/Makefile.am
@cd ${WRKSRC} && ${ACLOCAL}
post-build:
@${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamav.conf \
> ${BUILD_WRKSRC}/etc/clamav.conf.default
@${CP} ${BUILD_WRKSRC}/etc/clamav.conf.default \
${BUILD_WRKSRC}/etc/clamav.conf
@${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/freshclam.conf \
> ${BUILD_WRKSRC}/etc/freshclam.conf.default
@${CP} ${BUILD_WRKSRC}/etc/freshclam.conf.default \
${BUILD_WRKSRC}/etc/freshclam.conf
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \
> ${WRKDIR}/clamav-clamd.sh
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \
> ${WRKDIR}/clamav-milter.sh
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-freshclam.sh \
> ${WRKDIR}/clamav-freshclam.sh
pre-install:
@${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/docs/*pdf ${DOCSDIR}
.endif
post-install:
@[ -f ${PREFIX}/etc/clamav.conf ] || \
${CP} ${BUILD_WRKSRC}/etc/clamav.conf.default \
${PREFIX}/etc/clamav.conf
@[ -f ${PREFIX}/etc/clamav.conf.default ] || \
${CP} ${BUILD_WRKSRC}/etc/clamav.conf.default \
${PREFIX}/etc/clamav.conf.default
@[ -f ${PREFIX}/etc/freshclam.conf ] || \
${CP} ${BUILD_WRKSRC}/etc/freshclam.conf.default \
${PREFIX}/etc/freshclam.conf
@[ -f ${PREFIX}/etc/freshclam.conf.default ] || \
${CP} ${BUILD_WRKSRC}/etc/freshclam.conf.default \
${PREFIX}/etc/freshclam.conf.default
@${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DATADIR}
@${INSTALL_SCRIPT} ${WRKDIR}/clamav-clamd.sh \
${RC_DIR}/clamav-clamd${RC_SUFX}
@${INSTALL_SCRIPT} ${WRKDIR}/clamav-freshclam.sh \
${RC_DIR}/clamav-freshclam${RC_SUFX}
.if defined(WITH_MILTER)
@${INSTALL_SCRIPT} ${WRKDIR}/clamav-milter.sh \
${RC_DIR}/clamav-milter${RC_SUFX}
.endif
.include <bsd.port.post.mk>
|