summaryrefslogtreecommitdiff
path: root/mail/qgreylist/Makefile
blob: 37b8c252123ae5cf1127c8148513947954e29ed4 (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
# $NetBSD: Makefile,v 1.3 2005/07/16 01:19:13 jlam Exp $
#

DISTNAME=		qgreylist-0.2
CATEGORIES=		mail
MASTER_SITES=		${HOMEPAGE}

MAINTAINER=		schmonz@NetBSD.org
HOMEPAGE=		http://www.jonatkins.com/qgreylist/
COMMENT=		Simple greylisting for qmail

DEPENDS_QMAIL=		qmail>=1.03nb8:../../mail/qmail
DEPENDS+=		${DEPENDS_QMAIL}

WRKSRC=			${WRKDIR}/qgreylist

USE_TOOLS+=		perl:run
USE_PKGINSTALL=		yes
OWN_DIRS_PERMS=		${PKG_SYSCONFDIR}/greylist qmaild wheel 0755
NO_BUILD=		# defined

QGREYLIST_SCRIPTS=	greylist greylist-info
REPLACE_PERL=		${QGREYLIST_SCRIPTS}

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

# Detect the PKG_SYSCONFDIR of the installed qmail, so we can create
# config files there.
.if !empty(PHASES_AFTER_EXTRACT:M${PKG_PHASE})
INSTALLED_QMAIL!= ${PKG_BEST_EXISTS} ${DEPENDS_QMAIL:C/:.*$//:Q:S/\ / /g}
.  if empty(INSTALLED_QMAIL:M*_not_found_)
.    if !defined(PKG_SYSCONFDIR.qgreylist)
PKG_SYSCONFDIR.qgreylist!= \
	${PKG_INFO} -qB ${INSTALLED_QMAIL} |				\
		${SED} -n '/^PKG_SYSCONFDIR=/s|^PKG_SYSCONFDIR=[ 	]*||p'
.    endif
.  endif
.endif

SUBST_CLASSES+=		qmaildirs
SUBST_STAGE.qmaildirs=	do-configure
SUBST_FILES.qmaildirs=	${QGREYLIST_SCRIPTS}
SUBST_SED.qmaildirs=	-e 's|/var/qmail/greylist|${PKG_SYSCONFDIR}/greylist|g'
SUBST_SED.qmaildirs+=	-e 's|/var/qmail|${QMAILDIR}|g'

INSTALLATION_DIRS=	bin share/doc/qgreylist

do-install:
	for i in ${QGREYLIST_SCRIPTS}; do				\
		${INSTALL_SCRIPT} ${WRKSRC}/$${i} ${PREFIX}/bin/q$${i};	\
	done
	${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/qgreylist

.include "../../mk/bsd.pkg.mk"