aboutsummaryrefslogtreecommitdiffstats
path: root/mail/postfixadmin/Makefile
blob: fe7e15b03155ac2fefa4f541642f4c9aa6f34e0a (plain) (blame)
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
86
87
88
89
90
91
92
# Created by: Rob Evers <rob@debank.tv>
# $FreeBSD$

PORTNAME=   postfixadmin
PORTVERSION=    2.3.6
CATEGORIES= mail www
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}

MAINTAINER= tabmow@freenode.net
COMMENT=    PHP web-based management tool for Postfix virtual domains and users

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/GPL-LICENSE.TXT

WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
NO_BUILD=   yes

SUB_FILES+= pkg-message

OPTIONS_SINGLE= DB
OPTIONS_SINGLE_DB=  MYSQL MYSQLI PGSQL
MYSQLI_DESC=    MySQL 4.1+ back-end (use mysqli PHP extension)

OPTIONS_DEFAULT=    MYSQL

.include <bsd.port.options.mk>

USE_PHP=    pcre session mbstring spl xmlrpc

.if ${PORT_OPTIONS:MMYSQL}
USE_PHP+=   mysql
.endif

.if ${PORT_OPTIONS:MMYSQLI}
USE_PHP+=   mysqli
.endif

.if ${PORT_OPTIONS:MPGSQL}
USE_PHP+=   pgsql
.endif

post-patch:
    @${FIND} ${WRKSRC} -name '*.orig' -delete

pre-install:
    @${RM} -rf ${WRKSRC}/ADDITIONS/squirrelmail-plugin

do-install:
    @${MKDIR} ${PREFIX}/www/postfixadmin/VIRTUAL_VACATION
    @${MKDIR} ${PREFIX}/www/postfixadmin/ADDITIONS
    @${MKDIR} ${PREFIX}/www/postfixadmin/ADDITIONS/cyrus
    @${MKDIR} ${PREFIX}/www/postfixadmin/css
    @${MKDIR} ${PREFIX}/www/postfixadmin/admin
    @${MKDIR} ${PREFIX}/www/postfixadmin/images
    @${MKDIR} ${PREFIX}/www/postfixadmin/languages
    @${MKDIR} ${PREFIX}/www/postfixadmin/model
    @${MKDIR} ${PREFIX}/www/postfixadmin/templates
    @${MKDIR} ${PREFIX}/www/postfixadmin/users
    (cd ${WRKSRC}/ && \
    ${COPYTREE_SHARE} \*.php ${PREFIX}/www/postfixadmin "! -name config.inc.php")
    @${CP} ${WRKSRC}/config.inc.php ${PREFIX}/www/postfixadmin/config.inc.php.sample
    @${CP} -n ${WRKSRC}/config.inc.php ${PREFIX}/www/postfixadmin/config.inc.php
    @${INSTALL_DATA} ${WRKSRC}/*.txt ${PREFIX}/www/postfixadmin
    @${INSTALL_DATA} ${WRKSRC}/*.TXT ${PREFIX}/www/postfixadmin
    @${INSTALL_DATA} ${WRKSRC}/css/* ${PREFIX}/www/postfixadmin/css
    @${INSTALL_DATA} ${WRKSRC}/admin/* ${PREFIX}/www/postfixadmin/admin
    @${INSTALL_DATA} ${WRKSRC}/images/* ${PREFIX}/www/postfixadmin/images
    @${INSTALL_DATA} ${WRKSRC}/languages/* ${PREFIX}/www/postfixadmin/languages
    @${INSTALL_DATA} ${WRKSRC}/model/* ${PREFIX}/www/postfixadmin/model
    @${INSTALL_DATA} ${WRKSRC}/templates/* ${PREFIX}/www/postfixadmin/templates
    @${INSTALL_DATA} ${WRKSRC}/users/* ${PREFIX}/www/postfixadmin/users
    @${CP} -R ${WRKSRC}/VIRTUAL_VACATION/* ${PREFIX}/www/postfixadmin/VIRTUAL_VACATION
    (cd ${WRKSRC}/ADDITIONS/ && \
    ${COPYTREE_SHARE} \* ${PREFIX}/www/postfixadmin/ADDITIONS/ "! -name squirrelmail-plugin")

.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${DOCSDIR}
    (cd ${WRKSRC}/DOCUMENTS && ${COPYTREE_SHARE} \* ${DOCSDIR})
.endif

post-install:
    @if [ ! -f ${PREFIX}/www/postfixadmin/config.inc.php ]; then \
        ${CP} -p ${PREFIX}/www/postfixadmin/config.inc.php.sample ${PREFIX}/www/postfixadmin/config.inc.php ; \
    fi
    @${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/www/postfixadmin
    @${CHMOD} 640 ${PREFIX}/www/postfixadmin/*.php ${PREFIX}/www/postfixadmin/css/*.css
    @${CHMOD} 640 ${PREFIX}/www/postfixadmin/admin/*.php
    @${CHMOD} 640 ${PREFIX}/www/postfixadmin/users/*.php
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>