diff options
author | Alexander Leidinger <netchild@FreeBSD.org> | 2003-12-08 14:06:49 +0000 |
---|---|---|
committer | Alexander Leidinger <netchild@FreeBSD.org> | 2003-12-08 14:06:49 +0000 |
commit | 71b93e612e86c1b84511567fc9b56892829fa50c (patch) | |
tree | 244f795a9cb38ad68623b566a979d921224dbf90 /security/clamav/Makefile | |
parent | first remove patches. raize IssueZilla as far as possible (diff) |
BEWARE: As rcoder(8) isn't present on FreeBSD 4 but clamd must be
be started before clamav-milter the startup-script for clamd
must alphabetically arranged before the startup-script for
clamav-milter. It was decided to use the clamd statup-scrtipt
from security/clamav-devel (clamav-clamd.sh), so users running
an older version of security/clamav have to change
'clamd_enable="YES"' to 'clamav_clamd_enable="YES"' in
/etc/rc.conf. On the other hand this changes makes it easier
to switch between security/clamav and security/clamav-devel.
- Respect PTHREAD_CFLAGS.
- Use USE_LIBTOOL_VER=14 as the libtool shipping with clamav 0.65
erroneously links against libc _and_ libc_r on FreeBSD 4.
- Don't link against libcipher on FreeBSD < 501100, clamav doesn't
depend on it. The linker warnings suggesting that it is required
were triggered by linking against both, libc and libc_r.
- Unconditionally depend on math/libgmp4. Otherwise, if libgmp4 is
already installed on a FreeBSD 4-STABLE system compilation of
security/clamav fails, as the headers of libgmp4 are used but the
base libgmp is used for linking.
- Fix generation of clamav-milter.8 when building with WITH_MILTER
(part of new files/patch-clamav-milter::Makefile.in).
- Don't USE_GETOPT_LONG when compiling with WITH_MILTER, clamav
uses its own getopt_long() regardless if a devel/libgnugetopt is
installed or the version in the base of FreeBSD 5 is present.
- Allow compilation of WITH_MILTER with mail/sendmail.
- Install a startup-script (taken from security/clamav-devel with some
fixes in comments) for clamav-milter when compiled with WITH_MILTER.
- In pkg-descr remove the note that clamav-milter doesn't build on
FreeBSD 4 with base gcc, it builds fine there. Mention that
clamav-milter can be optionally used (taken from pkg-descr of
security/clamav-devel).
- Fix compilation when an older version of security/clamav is installed.
If there's an older version of libclamav installed clamav 0.65 will
link against it instead of the newly built one. This is not a problem
if the installed version is compatible with the new one as libclamav
gets linked dynamically and the installed version will be replaced
with the new one. However, if the older version is incompatible
linking of clamav 0.65 fails. This problem was discovered by
Jan-Peter Koopmann Jan-Peter.Koopmann@seceidos.de and the fix
(most of the new patches in the files directory) confirmed working.
- In clamav-milter replace the path to the used sendmail executable with
the location of the mailwrapper(8) (/usr/sbin/sendmail). Obtained
from security/clamav-devel.
PR: 59948
Submitted by: Marius Strobl <marius@alchemy.franken.de>
Approved by: maintainer
Diffstat (limited to 'security/clamav/Makefile')
-rw-r--r-- | security/clamav/Makefile | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/security/clamav/Makefile b/security/clamav/Makefile index 4ec7b82f0247..fcfd0e4de443 100644 --- a/security/clamav/Makefile +++ b/security/clamav/Makefile @@ -7,7 +7,7 @@ PORTNAME= clamav PORTVERSION= 0.65 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= clamav @@ -15,6 +15,7 @@ MASTER_SITE_SUBDIR= clamav MAINTAINER= markun@onohara.to 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 \ @@ -26,27 +27,29 @@ USE_REINPLACE= yes USE_GMAKE= yes GNU_CONFIGURE= yes CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL} -#USE_LIBTOOL_VER=14 +USE_LIBTOOL_VER=14 INSTALLS_SHLIB= yes PKGINSTALL= ${WRKDIR}/pkg-install CONFIGURE_ARGS= --with-dbdir=${DATADIR} \ --disable-clamav --enable-bigstack -CFLAGS+= -I${LOCALBASE}/include -LDFLAGS+= ${PTHREAD_LIBS} +CFLAGS+= ${PTHREAD_CFLAGS} -I${LOCALBASE}/include +LDFLAGS+= ${PTHREAD_LIBS} -L${LOCALBASE}/lib CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" MAN1= clamscan.1 freshclam.1 sigtool.1 clamdscan.1 MAN5= clamav.conf.5 MAN8= clamd.8 clamav-milter.8 -CLAMD_SOCKET?= /var/run/clamav/clamd +CLAMAV_CLAMD_SOCKE?= /var/run/clamav/clamd +CLAMAV_MILTER_SOCKET?= /var/run/clmilter.sock CONFLICTS= clamav-devel-* SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \ -e 's|%%DATADIR%%|${DATADIR}|g' \ - -e 's|%%CLAMD_SOCKET%%|${CLAMD_SOCKET}|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|' \ @@ -67,20 +70,11 @@ SED_SCRIPT+= -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \ PLIST_SUB+= RC_DIR=${RC_DIR} \ RC_SUFX=${RC_SUFX} -.if ${OSVERSION} < 501100 -# compiles only with optimizer -CFLAGS+= -O -LDFLAGS+= -lcipher -.endif - -.if ${OSVERSION} > 500023 -# Approximate time libgmp was removed from the base system -LDFLAGS+= -L${LOCALBASE}/lib -LIB_DEPENDS= gmp.6:${PORTSDIR}/math/libgmp4 -.endif - .if defined(WITH_MILTER) -USE_GETOPT_LONG= yes +.if exists(${LOCALBASE}/lib/libmilter.a) +CPPFLAGS+= -I${LOCALBASE}/include +CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" +.endif CONFIGURE_ARGS+= --enable-milter PLIST_SUB+= CLAMAV-MILTER="" .else @@ -88,8 +82,10 @@ PLIST_SUB+= CLAMAV-MILTER="@comment " .endif post-patch: - @${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|g' \ + @${REINPLACE_CMD} -e 's|-pthread -lc_r|${PTHREAD_LIBS}|g' \ ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} + @${REINPLACE_CMD} -e 's|/usr/lib/sendmail|/usr/sbin/sendmail|g' \ + ${WRKSRC}/clamav-milter/clamav-milter.c pre-configure: @${REINPLACE_CMD} -e 's|clamav.conf|&.default|' \ @@ -104,18 +100,25 @@ post-build: @${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamav.conf \ >${BUILD_WRKSRC}/etc/clamav.conf.default @${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL} - @${SED} ${SED_SCRIPT} ${FILESDIR}/clamd.sh >${WRKDIR}/clamd.sh + @${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \ + >${WRKDIR}/clamav-clamd.sh + @${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \ + >${WRKDIR}/clamav-milter.sh pre-install: @${SETENV} PKG_PREFIX=${PREFIX} \ ${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL post-install: - @${INSTALL_SCRIPT} ${WRKDIR}/clamd.sh ${RC_DIR}/clamd${RC_SUFX} + @${INSTALL_SCRIPT} ${WRKDIR}/clamav-clamd.sh ${RC_DIR}/clamd${RC_SUFX} @${CHOWN} -R clamav:clamav ${DATADIR} @[ -f ${PREFIX}/etc/clamav.conf ] || \ ${CP} ${PREFIX}/etc/clamav.conf.default ${PREFIX}/etc/clamav.conf @${SETENV} PKG_PREFIX=${PREFIX} \ ${SH} ${PKGINSTALL} ${PREFIX} POST-INSTALL +.if defined(WITH_MILTER) + @${INSTALL_SCRIPT} ${WRKDIR}/clamav-milter.sh \ + ${RC_DIR}/clamav-milter${RC_SUFX} +.endif .include <bsd.port.post.mk> |