2005-04-14 07:32:37 +02:00
|
|
|
# $NetBSD: Makefile,v 1.28 2005/04/14 05:32:37 xtraeme Exp $
|
2004-06-20 21:41:23 +02:00
|
|
|
|
2005-04-14 06:59:14 +02:00
|
|
|
DISTNAME= dspam-3.4.4
|
2004-06-20 21:41:23 +02:00
|
|
|
CATEGORIES= mail
|
|
|
|
MASTER_SITES= http://www.nuclearelephant.com/projects/dspam/sources/
|
|
|
|
|
|
|
|
MAINTAINER= xtraeme@NetBSD.org
|
|
|
|
HOMEPAGE= http://www.nuclearelephant.com/projects/dspam/
|
2004-08-30 21:18:18 +02:00
|
|
|
COMMENT= Extremely scalable, statistical-hybrid anti-spam filter
|
2004-06-20 21:41:23 +02:00
|
|
|
|
2004-11-17 14:26:17 +01:00
|
|
|
GNU_CONFIGURE= yes
|
2004-06-20 21:41:23 +02:00
|
|
|
USE_LIBTOOL= yes
|
|
|
|
|
2004-08-06 23:24:13 +02:00
|
|
|
USE_PERL5= yes
|
|
|
|
REPLACE_PERL= tools/dspam_genaliases.in \
|
|
|
|
tools/dspam_corpus.in \
|
2004-10-28 12:12:47 +02:00
|
|
|
cgi/*.cgi cgi/configure.pl.in
|
2004-06-20 21:41:23 +02:00
|
|
|
|
|
|
|
PKGCONFIG_OVERRIDE+= dspam.pc.in
|
|
|
|
|
2005-03-21 22:35:52 +01:00
|
|
|
SUBST_CLASSES+= cgi cgi2
|
2004-06-20 21:41:23 +02:00
|
|
|
SUBST_STAGE.cgi= post-patch
|
2005-03-21 22:35:52 +01:00
|
|
|
SUBST_FILES.cgi= cgi/dspam.cgi cgi/admin.cgi \
|
|
|
|
cgi/templates/nav_performance.html \
|
|
|
|
cgi/configure.pl.in
|
|
|
|
SUBST_SED.cgi= -e "s|/usr/local/bin/dspam|${PREFIX}/bin/dspam|g" \
|
2004-08-06 23:24:13 +02:00
|
|
|
-e "s|/var/dspam|${DSPAM_HOME}|g" \
|
|
|
|
-e "s|/usr/local|${PREFIX}|g" \
|
2004-10-28 12:12:47 +02:00
|
|
|
-e "s|-deaf|${DSPAM_PSFLAGS}|g" \
|
|
|
|
-e "s|yourdomain.com|${DSPAM_DOMAIN}|g"
|
2004-10-22 07:43:28 +02:00
|
|
|
SUBST_MESSAGE.cgi= "Fixing paths and default options."
|
2005-03-21 22:35:52 +01:00
|
|
|
SUBST_STAGE.cgi2= post-patch
|
|
|
|
SUBST_FILES.cgi2= cgi/dspam.cgi cgi/admin.cgi cgi/admingraph.cgi \
|
|
|
|
cgi/graph.cgi
|
|
|
|
SUBST_SED.cgi2= -e "s|./admins|${PKG_SYSCONFDIR}/cgi-admins|" \
|
|
|
|
-e "s|\$$FILE = \"./default.prefs\";|\$$FILE = \"${PKG_SYSCONFDIR}/cgi-default.prefs\";|" \
|
|
|
|
-e "s|configure.pl|${PKG_SYSCONFDIR}/configure.pl|"
|
2004-06-20 21:41:23 +02:00
|
|
|
|
|
|
|
BUILD_DEFS+= DSPAM_HOME
|
|
|
|
BUILD_DEFS+= DSPAM_SIGNATURE_LIFE
|
|
|
|
BUILD_DEFS+= DSPAM_USER DSPAM_GROUP
|
|
|
|
BUILD_DEFS+= DSPAM_BINMODE
|
2004-10-22 07:43:28 +02:00
|
|
|
BUILD_DEFS+= DSPAM_LOGDIR
|
2004-10-28 12:12:47 +02:00
|
|
|
BUILD_DEFS+= DSPAM_DOMAIN
|
2005-03-21 22:35:52 +01:00
|
|
|
BUILD_DEFS+= DSPAM_PIDDIR
|
2004-06-20 21:41:23 +02:00
|
|
|
|
2004-08-06 23:24:13 +02:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
2004-06-20 21:41:23 +02:00
|
|
|
|
|
|
|
DSPAM_HOME?= ${VARBASE}/dspam
|
2004-08-06 23:24:13 +02:00
|
|
|
DSPAM_SIGNATURE_LIFE?= 14
|
2004-06-20 21:41:23 +02:00
|
|
|
|
|
|
|
DSPAM_BINMODE?= 4511
|
|
|
|
DSPAM_USER?= dspam
|
|
|
|
DSPAM_GROUP?= dspam
|
2004-10-22 07:43:28 +02:00
|
|
|
DSPAM_LOGDIR?= ${DSPAM_HOME}/log
|
2004-10-28 12:12:47 +02:00
|
|
|
DSPAM_DOMAIN?= yourdomain.com
|
2005-03-21 22:35:52 +01:00
|
|
|
DSPAM_PIDDIR?= ${VARBASE}/run/dspam
|
2004-06-20 21:41:23 +02:00
|
|
|
|
|
|
|
CONFIGURE_ARGS+= --with-signature-life=${DSPAM_SIGNATURE_LIFE}
|
2004-08-09 22:14:21 +02:00
|
|
|
CONFIGURE_ARGS+= --with-dspam-home=${DSPAM_HOME} \
|
|
|
|
--with-dspam-home-owner=${DSPAM_USER} \
|
2004-06-20 21:41:23 +02:00
|
|
|
--with-dspam-home-group=${DSPAM_GROUP} \
|
|
|
|
--with-dspam-owner=${DSPAM_USER} \
|
|
|
|
--with-dspam-group=${DSPAM_GROUP} \
|
2004-10-22 07:43:28 +02:00
|
|
|
--with-dspam-mode=${DSPAM_BINMODE} \
|
2005-03-21 22:35:52 +01:00
|
|
|
--with-logdir=${DSPAM_LOGDIR} \
|
2005-04-14 07:32:37 +02:00
|
|
|
--sysconfdir=${PKG_SYSCONFDIR}
|
2004-06-20 21:41:23 +02:00
|
|
|
|
2004-08-06 23:24:13 +02:00
|
|
|
.include "options.mk"
|
|
|
|
.include "../../devel/pkgconfig/buildlink3.mk"
|
|
|
|
.include "../../mk/pthread.buildlink3.mk"
|
2004-06-20 21:41:23 +02:00
|
|
|
|
2004-08-06 23:24:13 +02:00
|
|
|
DOCDIR= ${PREFIX}/share/doc/dspam
|
|
|
|
DATADIR= ${PREFIX}/share/dspam
|
2004-10-22 07:43:28 +02:00
|
|
|
EGDIR= ${PREFIX}/share/examples/dspam
|
2004-06-20 21:41:23 +02:00
|
|
|
|
2004-08-07 08:12:20 +02:00
|
|
|
USE_PKGINSTALL= yes
|
2005-03-21 22:35:52 +01:00
|
|
|
RCD_SCRIPTS= dspam
|
|
|
|
|
|
|
|
PKG_SYSCONFSUBDIR= dspam
|
|
|
|
|
2004-10-28 12:12:47 +02:00
|
|
|
CONF_FILES_PERMS= ${EGDIR}/dspam.conf ${PKG_SYSCONFDIR}/dspam.conf \
|
|
|
|
${BINOWN} ${DSPAM_GROUP} 0640
|
2005-03-21 22:35:52 +01:00
|
|
|
CONF_FILES_PERMS+= ${EGDIR}/cgi-admins ${PKG_SYSCONFDIR}/cgi-admins \
|
|
|
|
www www 0640
|
|
|
|
CONF_FILES_PERMS+= ${EGDIR}/cgi-default.prefs \
|
|
|
|
${PKG_SYSCONFDIR}/cgi-default.prefs www www 0640
|
|
|
|
CONF_FILES_PERMS+= ${EGDIR}/configure.pl ${PKG_SYSCONFDIR}/configure.pl \
|
|
|
|
www www 0640
|
2004-10-22 07:43:28 +02:00
|
|
|
|
2004-08-07 08:12:20 +02:00
|
|
|
PKG_GROUPS= ${DSPAM_GROUP}
|
|
|
|
PKG_USERS= ${DSPAM_USER}:${DSPAM_GROUP}
|
|
|
|
SPECIAL_PERMS= ${PREFIX}/bin/dspam ${DSPAM_USER} ${DSPAM_GROUP} \
|
|
|
|
${DSPAM_BINMODE}
|
2004-10-28 08:03:18 +02:00
|
|
|
OWN_DIRS_PERMS= ${DSPAM_HOME} ${DSPAM_USER} ${DSPAM_GROUP} 0775
|
|
|
|
OWN_DIRS_PERMS+= ${DSPAM_LOGDIR} ${DSPAM_USER} ${DSPAM_GROUP} 0775
|
2005-03-21 22:35:52 +01:00
|
|
|
OWN_DIRS_PERMS+= ${DSPAM_PIDDIR} ${DSPAM_USER} ${DSPAM_GROUP} 0700
|
|
|
|
|
|
|
|
FILES_SUBST+= DSPAM_USER=${DSPAM_USER}
|
|
|
|
FILES_SUBST+= DSPAM_GROUP=${DSPAM_GROUP}
|
|
|
|
FILES_SUBST+= DSPAM_PIDDIR=${DSPAM_PIDDIR}
|
2004-08-07 08:12:20 +02:00
|
|
|
|
2004-10-22 07:43:28 +02:00
|
|
|
SUBST_CLASSES+= conf
|
|
|
|
SUBST_STAGE.conf= pre-install
|
2005-03-21 22:35:52 +01:00
|
|
|
SUBST_FILES.conf= src/dspam.conf.in
|
2004-10-22 07:43:28 +02:00
|
|
|
SUBST_SED.conf= -e "s,@dspam_home@,${DSPAM_HOME},g" \
|
|
|
|
-e "s,@delivery_agent@,${DSPAM_DELIVERY_AGENT_BIN},g"
|
|
|
|
SUBST_MESSAGE.conf= "Fixing configuration file."
|
|
|
|
|
2004-06-20 21:41:23 +02:00
|
|
|
post-install:
|
2004-08-06 23:24:13 +02:00
|
|
|
${INSTALL_DATA_DIR} ${DOCDIR}
|
2005-03-21 22:35:52 +01:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/README ${DOCDIR}
|
2004-08-06 23:24:13 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/RELEASE.NOTES ${DOCDIR}
|
2005-03-21 22:35:52 +01:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/doc/*.txt ${DOCDIR}
|
2004-08-06 23:24:13 +02:00
|
|
|
${INSTALL_DATA_DIR} ${DATADIR}
|
2004-10-22 07:43:28 +02:00
|
|
|
${INSTALL_DATA_DIR} ${EGDIR}
|
2005-03-21 22:35:52 +01:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/src/dspam.conf.in ${EGDIR}/dspam.conf
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/cgi/admins ${EGDIR}/cgi-admins
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/cgi/default.prefs ${EGDIR}/cgi-default.prefs
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/cgi/configure.pl ${EGDIR}/configure.pl
|
|
|
|
|
2004-06-20 21:41:23 +02:00
|
|
|
.for d in txt cgi
|
2004-08-06 23:24:13 +02:00
|
|
|
${INSTALL_DATA_DIR} ${DATADIR}/${d}
|
|
|
|
cd ${WRKSRC}/${d} && ${PAX} -rwppm '-s|.*/Makefile.*$$||' \
|
2005-03-21 22:35:52 +01:00
|
|
|
'-s|./admins.*$$||' '-s|./default.prefs.*$$||' \
|
|
|
|
'-s|./configure.pl.*$$||' . ${DATADIR}/${d}
|
2004-06-20 21:41:23 +02:00
|
|
|
.endfor
|
|
|
|
.undef d
|
2005-04-14 07:32:37 +02:00
|
|
|
.for drv in mysql pgsql
|
2004-10-22 07:43:28 +02:00
|
|
|
. if !empty(DSPAM_STORAGE_DRIVER:M${drv})
|
|
|
|
${INSTALL_DATA_DIR} ${DATADIR}/${drv}
|
2005-03-21 22:35:52 +01:00
|
|
|
cd ${WRKSRC}/src/tools.${drv}_drv && \
|
|
|
|
${PAX} -rwppm '-s|.*/Makefile.*$$||' . ${DATADIR}/${drv}
|
2004-10-22 07:43:28 +02:00
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
.undef drv
|
2005-04-14 07:32:37 +02:00
|
|
|
.if !empty(DSPAM_STORAGE_DRIVER:Msqlite*)
|
|
|
|
${INSTALL_DATA_DIR} ${DATADIR}/sqlite
|
|
|
|
cd ${WRKSRC}/src/tools.sqlite_drv && \
|
|
|
|
${PAX} -rwppm '-s|.*/Makefile.*$$||' . ${DATADIR}/sqlite
|
|
|
|
.endif
|
2004-06-20 21:41:23 +02:00
|
|
|
|
|
|
|
.include "../../mk/bsd.pkg.mk"
|