1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-26 09:46:09 +00:00

- Fix 'integer constant is too large for "long" type' warning [1]

- Convert one patch to REINPLACE_CMD
- Force to use ${PREFIX}/lib/libmilter.a if it's installed
- Fix sendmail binary detection using --with-sendmail instead SENDMAIL envvar
- Add EXPERIMENTAL OPTION to build with --enable-experimental
- Remove DESTDIR/TARGETDIR since it's useless for now
- Bump PORTREVISION

Submitted by:	stas@ at #bsdports [1]
Thanks to:	stas@ and simon@ [1]
This commit is contained in:
Renato Botelho 2007-02-18 16:12:37 +00:00
parent 4799d7acc7
commit 2f5188f16a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=185452
3 changed files with 34 additions and 45 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= clamav
PORTVERSION= 0.90
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= SF
@ -23,7 +23,8 @@ RUN_DEPENDS= lha:${PORTSDIR}/archivers/lha \
OPTIONS= MILTER "Compile the milter interface" Off \
LDAP "libmilter was built with LDAP" Off \
CURL "Support URL downloading" Off \
STDERR "Print logs to stderr instead of stdout" Off
STDERR "Print logs to stderr instead of stdout" Off \
EXPERIMENTAL "Build experimental code" Off
USE_AUTOTOOLS= libtool:15
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@ -37,9 +38,11 @@ LOGDIR= /var/log/clamav
RUNDIR= /var/run/clamav
PLIST_SUB+= DBDIR=${DBDIR} LOGDIR=${LOGDIR} RUNDIR=${RUNDIR}
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS= --with-dbdir=${DBDIR} \
--with-zlib=/usr \
--mandir=${MANPREFIX:S/^${DESTDIR}//}/man \
--mandir=${MANPREFIX}/man \
--disable-zlib-vcheck \
--disable-clamuko \
--disable-clamav \
@ -52,8 +55,6 @@ CPPFLAGS+= -I${LOCALBASE}/include \
LDFLAGS+= -L${LOCALBASE}/lib \
${PTHREAD_LIBS}
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}"
MAN1= clamconf.1 \
clamscan.1 \
freshclam.1 \
@ -73,8 +74,7 @@ CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd
CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock
SUB_FILES= pkg-install pkg-deinstall
SUB_LIST+= DESTDIR=${DESTDIR} \
DBDIR=${DBDIR} \
SUB_LIST+= DBDIR=${DBDIR} \
LOGDIR=${LOGDIR} \
RUNDIR=${RUNDIR} \
CLAMAVUSER=${CLAMAVUSER} \
@ -109,11 +109,11 @@ USE_RC_SUBR+= clamav-milter
USE_OPENLDAP= yes
LDFLAGS+= -lldap
.endif
.if !exists(/usr/lib/libmilter.a)
.if !exists(/usr/lib/libmilter.a) || exists(${LOCALBASE}/lib/libmilter.a)
BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
CONFIGURE_ENV+= SENDMAIL="${LOCALBASE}/sbin/sendmail"
CONFIGURE_ARGS+= --with-sendmail=${LOCALBASE}/sbin/sendmail
.else
CONFIGURE_ENV+= SENDMAIL="/usr/sbin/sendmail"
CONFIGURE_ARGS+= --with-sendmail=/usr/sbin/sendmail
.endif
CONFIGURE_ARGS+= --enable-milter
PLIST_SUB+= CLAMAV-MILTER=""
@ -132,27 +132,33 @@ CONFIGURE_ARGS+= --without-libcurl
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-shared_output.c
.endif
.if defined(WITH_EXPERIMENTAL)
CONFIGURE_ARGS+= --enable-experimental
.endif
post-patch:
@${REINPLACE_CMD} -e 's|-pthread -lc_r|${PTHREAD_LIBS}|g' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
@${REINPLACE_CMD} -e 's,unarj,arj,g' \
${WRKSRC}/docs/man/clamscan.1
@${REINPLACE_CMD} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamd.conf
@${REINPLACE_CMD} ${SED_CONF} ${BUILD_WRKSRC}/etc/freshclam.conf
${WRKSRC}/${CONFIGURE_SCRIPT}
@${REINPLACE_CMD} -E 's,^(pkgconfigdir = ).*$$,\1$$(prefix)/libdata/pkgconfig,g' \
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|0x100000000|0x100000000ULL|g' \
${WRKSRC}/libclamav/unrar/unrar.c
@${REINPLACE_CMD} ${SED_CONF} \
${WRKSRC}/etc/clamd.conf \
${WRKSRC}/etc/freshclam.conf
pre-install:
@${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
.for c in clamd freshclam
@[ -f ${TARGETDIR}/etc/${c}.conf ] || \
${CP} ${TARGETDIR}/etc/${c}.conf.default ${TARGETDIR}/etc/${c}.conf
@[ -f ${PREFIX}/etc/${c}.conf ] || \
${CP} ${PREFIX}/etc/${c}.conf.default ${PREFIX}/etc/${c}.conf
.endfor
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}/html
@${INSTALL_DATA} ${INSTALL_WRKSRC}/NEWS ${INSTALL_WRKSRC}/ChangeLog ${DOCSDIR}
@${INSTALL_DATA} ${INSTALL_WRKSRC}/docs/html/* ${DOCSDIR}/html
@${INSTALL_DATA} ${WRKSRC}/NEWS ${WRKSRC}/ChangeLog ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/docs/html/* ${DOCSDIR}/html
.endif
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

View File

@ -1,11 +0,0 @@
--- Makefile.in.orig Wed Oct 13 15:26:26 2004
+++ Makefile.in Wed Oct 13 15:26:43 2004
@@ -210,7 +210,7 @@
SUBDIRS = libclamav clamscan clamd clamdscan freshclam sigtool database docs etc clamav-milter
EXTRA_DIST = FAQ contrib test examples BUGS shared libclamav.pc.in UPGRADE
bin_SCRIPTS = clamav-config
-pkgconfigdir = $(libdir)/pkgconfig
+pkgconfigdir = $(prefix)/libdata/pkgconfig
pkgconfig_DATA = libclamav.pc
all: clamav-config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $FreeBSD: /tmp/pcvs/ports/security/clamav/files/pkg-install.in,v 1.3 2007-02-16 00:19:32 garga Exp $
# $FreeBSD: /tmp/pcvs/ports/security/clamav/files/pkg-install.in,v 1.4 2007-02-18 16:12:37 garga Exp $
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
@ -12,15 +12,9 @@ DBDIR=%%DBDIR%%
LOGDIR=%%LOGDIR%%
RUNDIR=%%RUNDIR%%
if [ -n "%%DESTDIR%%" ]; then
PW="/usr/sbin/chroot %%DESTDIR%% pw"
CHOWN="/usr/sbin/chroot %%DESTDIR%% chown"
MKDIR="/usr/sbin/chroot %%DESTDIR%% mkdir -p"
else
PW="pw"
CHOWN="chown"
MKDIR="mkdir -p"
fi
PW="pw"
CHOWN="chown"
MKDIR="mkdir -p"
if [ "$2" = "PRE-INSTALL" ]; then
@ -48,13 +42,13 @@ if [ "$2" = "PRE-INSTALL" ]; then
elif [ "$2" = "POST-INSTALL" ]; then
[ ! -d "${DESTDIR}${DBDIR}" ] && (${MKDIR} ${DBDIR} || exit 1)
[ ! -d "${DBDIR}" ] && (${MKDIR} ${DBDIR} || exit 1)
${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DBDIR} || exit 1
[ ! -d "${DESTDIR}${LOGDIR}" ] && (${MKDIR} ${LOGDIR} || exit 1)
[ ! -d "${LOGDIR}" ] && (${MKDIR} ${LOGDIR} || exit 1)
${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${LOGDIR} || exit 1
[ ! -d "${DESTDIR}${RUNDIR}" ] && (${MKDIR} ${RUNDIR} || exit 1)
[ ! -d "${RUNDIR}" ] && (${MKDIR} ${RUNDIR} || exit 1)
${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${RUNDIR} || exit 1
fi