summaryrefslogtreecommitdiff
path: root/mail/postgrey/Makefile
blob: 30fa606624bd0f578bb3fcbf728adf3288401a5a (plain)
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
# $NetBSD: Makefile,v 1.33 2012/10/08 12:19:27 asau Exp $

DISTNAME=	postgrey-1.33
PKGREVISION=	5
CATEGORIES=	mail
MASTER_SITES=	http://postgrey.schweikert.ch/pub/

MAINTAINER=	kim@tac.nyc.ny.us
HOMEPAGE=	http://postgrey.schweikert.ch/
COMMENT=	Postfix Greylist Policy Server

DEPENDS+=	p5-BerkeleyDB-[0-9]*:../../databases/p5-BerkeleyDB
DEPENDS+=	p5-Digest-SHA1-[0-9]*:../../security/p5-Digest-SHA1
DEPENDS+=	p5-IO-Multiplex-[0-9]*:../../devel/p5-IO-Multiplex
DEPENDS+=	p5-Net-Server-[0-9]*:../../net/p5-Net-Server

BDB_ACCEPTED=		db4 db5
NO_CONFIGURE=		yes
USE_TOOLS+=		perl:run

.include "../../mk/bsd.prefs.mk"

POSTGREY_USER?=		postgrey
POSTGREY_GROUP?=	postgrey
POSTGREY_DBDIR?=	${VARBASE}/db/${PKGBASE}

PKG_SYSCONFSUBDIR?=	postfix

DOCDIR=			share/doc/${PKGBASE}
EGDIR=			share/examples/${PKGBASE}

RCD_SCRIPTS=		postgrey
PKG_GROUPS=		${POSTGREY_GROUP}
PKG_USERS=		${POSTGREY_USER}:${POSTGREY_GROUP}
PKG_GROUPS_VARS+=	POSTGREY_GROUP
PKG_USERS_VARS+=	POSTGREY_USER

PKG_GECOS.${POSTGREY_USER}=	Postgrey Daemon User

BUILD_DEFS+=		POSTGREY_DBDIR VARBASE

.for i in postgrey_whitelist_clients postgrey_whitelist_recipients
CONF_FILES+=		${PREFIX}/${EGDIR}/${i} \
			${PKG_SYSCONFDIR}/${i}
.endfor

OWN_DIRS_PERMS+=	${POSTGREY_DBDIR} \
			${POSTGREY_USER} ${POSTGREY_GROUP} 0775

FILES_SUBST+=		PERL=${PERL5:Q}

SUBST_CLASSES+=		postgrey
SUBST_STAGE.postgrey=	pre-build
SUBST_FILES.postgrey=	postgrey
# Perl
SUBST_SED.postgrey=	-e 's,/usr/bin/perl,${PERL5},g'
# User
SUBST_SED.postgrey+=	-e "s,|| 'postgrey',|| '${POSTGREY_USER}',g"
SUBST_SED.postgrey+=	-e "s,default: postgrey,default: ${POSTGREY_USER},g"
SUBST_SED.postgrey+=	-e "s,C<postgrey>,C<${POSTGREY_USER}>,g"
# Group
SUBST_SED.postgrey+=	-e "s,|| 'nogroup',|| '${POSTGREY_GROUP}',g"
SUBST_SED.postgrey+=	-e "s,default: nogroup,default: ${POSTGREY_GROUP},g"
# Database
SUBST_SED.postgrey+=	-e 's,/var/spool/postfix/postgrey,${POSTGREY_DBDIR},g'
# Config
SUBST_SED.postgrey+=	-e 's,/etc/postfix,${PKG_SYSCONFDIR},g'
#
SUBST_MESSAGE.postgrey=	Fixing defaults.

INSTALLATION_DIRS=	sbin ${DOCDIR} ${EGDIR}

do-build:

do-install:
	${INSTALL_SCRIPT} ${WRKSRC}/postgrey ${DESTDIR}${PREFIX}/sbin/postgrey
.for i in COPYING Changes README
	${INSTALL_DATA} ${WRKSRC}/${i} ${DESTDIR}${PREFIX}/${DOCDIR}/${i}
.endfor
.for i in postgrey_whitelist_clients postgrey_whitelist_recipients
	${INSTALL_DATA} ${WRKSRC}/${i} ${DESTDIR}${PREFIX}/${EGDIR}/${i}
.endfor

.include "../../mk/bdb.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"