summaryrefslogtreecommitdiff
path: root/mail/automx/Makefile
blob: 2d46e5e2a32bc015efdc639346ca4ab2e65bd505 (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
# $FreeBSD$

PORTNAME=	automx
PORTVERSION=	0.9
CATEGORIES=	mail
MASTER_SITES=	http://www.automx.org/download/

MAINTAINER=	crees@FreeBSD.org
COMMENT=	Handles mail account profile requests from mail clients

LICENSE=	GPLv3

RUN_DEPENDS=	${LOCALBASE}/${APACHEMODDIR}/mod_wsgi.so:${PORTSDIR}/www/mod_wsgi \
		${PYTHON_PKGNAMEPREFIX}lxml>=0:${PORTSDIR}/devel/py-lxml \
		bash:${PORTSDIR}/shells/bash \
		wget:${PORTSDIR}/ftp/wget

USE_APACHE_RUN=	22+
USE_PYTHON=	2.6+
NO_BUILD=	yes
PORTDATA=	*
PORTDOCS=	*

MAN1=		${PORTNAME}-test.1
MAN5=		${PORTNAME}.conf.5 ${PORTNAME}_ldap.5 ${PORTNAME}_sql.5

PKGMESSAGE=	${WRKDIR}/pkg-message

.include <bsd.port.options.mk>

post-patch:
	${REINPLACE_CMD} -e '1s,/bin/bash,${LOCALBASE}/bin/bash,' \
		${WRKSRC}/src/automx-test
# Generate pkg-message from INSTALL file; include lines from Section 5 onwards
	line=$$(${SED} -ne '/^5. Web Server/=' ${WRKSRC}/INSTALL) && \
		${SED} -ne "$$line,\$$p" ${WRKSRC}/INSTALL > ${PKGMESSAGE}

do-install:
	${MKDIR} ${DATADIR}
	(cd ${WRKSRC}/src && ${COPYTREE_SHARE} ${PORTNAME} ${PYTHONPREFIX_SITELIBDIR})
	${INSTALL_DATA} ${WRKSRC}/src/automx_wsgi.py ${DATADIR}
	${INSTALL_SCRIPT} ${WRKSRC}/src/automx-test ${PREFIX}/bin
	${INSTALL_DATA} ${WRKSRC}/src/automx.conf \
		${PREFIX}/etc/automx.conf.sample
.for s in 1 5
.  for m in ${MAN$s}
	${INSTALL_MAN} ${WRKSRC}/doc/man/man$s/$m ${MAN$sPREFIX}/man/man$s
.  endfor
.endfor
.if ${PORT_OPTIONS:MDOCS}
	${MKDIR} ${DOCSDIR}
	(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} "[^m]*" ${DOCSDIR})
.endif

post-install:
	[ -f ${PREFIX}/etc/${PORTNAME}.conf ] || \
	    ${CP} -p ${PREFIX}/etc/${PORTNAME}.conf.sample \
		${PREFIX}/etc/${PORTNAME}.conf
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>