1 # $NetBSD: Makefile,v 1.30 2012/03/09 15:02:40 fhajny Exp $
3 DISTNAME= postgrey-1.33
6 MASTER_SITES= http://postgrey.schweikert.ch/pub/
8 MAINTAINER= kim@tac.nyc.ny.us
9 HOMEPAGE= http://postgrey.schweikert.ch/
10 COMMENT= Postfix Greylist Policy Server
12 DEPENDS+= p5-BerkeleyDB-[0-9]*:../../databases/p5-BerkeleyDB
13 DEPENDS+= p5-Digest-SHA1-[0-9]*:../../security/p5-Digest-SHA1
14 DEPENDS+= p5-IO-Multiplex-[0-9]*:../../devel/p5-IO-Multiplex
15 DEPENDS+= p5-Net-Server-[0-9]*:../../net/p5-Net-Server
17 PKG_DESTDIR_SUPPORT= user-destdir
23 .include "../../mk/bsd.prefs.mk"
25 POSTGREY_USER?= postgrey
26 POSTGREY_GROUP?= postgrey
27 POSTGREY_DBDIR?= ${VARBASE}/db/${PKGBASE}
29 PKG_SYSCONFSUBDIR?= postfix
31 DOCDIR= share/doc/${PKGBASE}
32 EGDIR= share/examples/${PKGBASE}
35 PKG_GROUPS= ${POSTGREY_GROUP}
36 PKG_USERS= ${POSTGREY_USER}:${POSTGREY_GROUP}
37 PKG_GROUPS_VARS+= POSTGREY_GROUP
38 PKG_USERS_VARS+= POSTGREY_USER
40 PKG_GECOS.${POSTGREY_USER}= Postgrey Daemon User
42 BUILD_DEFS+= POSTGREY_DBDIR VARBASE
44 .for i in postgrey_whitelist_clients postgrey_whitelist_recipients
45 CONF_FILES+= ${PREFIX}/${EGDIR}/${i} \
46 ${PKG_SYSCONFDIR}/${i}
49 OWN_DIRS_PERMS+= ${POSTGREY_DBDIR} \
50 ${POSTGREY_USER} ${POSTGREY_GROUP} 0775
52 FILES_SUBST+= PERL=${PERL5:Q}
54 SUBST_CLASSES+= postgrey
55 SUBST_STAGE.postgrey= pre-build
56 SUBST_FILES.postgrey= postgrey
58 SUBST_SED.postgrey= -e 's,/usr/bin/perl,${PERL5},g'
60 SUBST_SED.postgrey+= -e "s,|| 'postgrey',|| '${POSTGREY_USER}',g"
61 SUBST_SED.postgrey+= -e "s,default: postgrey,default: ${POSTGREY_USER},g"
62 SUBST_SED.postgrey+= -e "s,C<postgrey>,C<${POSTGREY_USER}>,g"
64 SUBST_SED.postgrey+= -e "s,|| 'nogroup',|| '${POSTGREY_GROUP}',g"
65 SUBST_SED.postgrey+= -e "s,default: nogroup,default: ${POSTGREY_GROUP},g"
67 SUBST_SED.postgrey+= -e 's,/var/spool/postfix/postgrey,${POSTGREY_DBDIR},g'
69 SUBST_SED.postgrey+= -e 's,/etc/postfix,${PKG_SYSCONFDIR},g'
71 SUBST_MESSAGE.postgrey= Fixing defaults.
73 INSTALLATION_DIRS= sbin ${DOCDIR} ${EGDIR}
78 ${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${DESTDIR}${PREFIX}/sbin/postgrey
79 .for i in COPYING Changes README
80 ${INSTALL_DATA} ${WRKSRC}/${i} ${DESTDIR}${PREFIX}/${DOCDIR}/${i}
82 .for i in postgrey_whitelist_clients postgrey_whitelist_recipients
83 ${INSTALL_DATA} ${WRKSRC}/${i} ${DESTDIR}${PREFIX}/${EGDIR}/${i}
86 .include "../../mk/bdb.buildlink3.mk"
87 .include "../../mk/bsd.pkg.mk"