aboutsummaryrefslogtreecommitdiffstats
path: root/net-im/ejabberd/Makefile
blob: 2eb74feea482fc7caac0592e2471d3736c75079e (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
# Created by: Alexander Timoshenko <gonzo@univ.kiev.ua>
# $FreeBSD$

PORTNAME=   ejabberd
PORTVERSION=    2.1.13
CATEGORIES= net-im
MASTER_SITES=   http://www.process-one.net/downloads/ejabberd/${PORTVERSION}/
EXTRACT_SUFX=   .tgz

MAINTAINER= ashish@FreeBSD.org
COMMENT=    Free and Open Source distributed fault-tolerant Jabber server

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKDIR}/${PORTNAME}-${PORTVERSION}/COPYING

BUILD_DEPENDS=  erlc:${PORTSDIR}/lang/erlang
RUN_DEPENDS=    erl:${PORTSDIR}/lang/erlang
LIB_DEPENDS=    expat.6:${PORTSDIR}/textproc/expat2

USERS=      ejabberd
GROUPS=     ${USERS}

GNU_CONFIGURE=  yes
USES=       iconv gmake pkgconfig
USE_RC_SUBR=    ${PORTNAME}
NOPRECIOUSMAKEVARS= yes

OPTIONS_DEFINE= ODBC PAM

MAKE_ENV=   PORTVERSION=${PORTVERSION}
CONFIGURE_ARGS+=--localstatedir=/var --with-openssl=${OPENSSLBASE}
PKGMESSAGE= ${WRKDIR}/pkg-message
PKGINSTALL= ${WRKDIR}/pkg-install
PLIST_SUB=  PORTNAME=${PORTNAME} PORTVERSION=${PORTVERSION}
SUB_FILES=  pkg-message pkg-install
SUB_LIST=   PORTNAME=${PORTNAME} PORTVERSION=${PORTVERSION} \
        USERS=${USERS} GROUPS=${GROUPS}
WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}/src

NO_STAGE=   yes
.include <bsd.port.pre.mk>

USE_OPENSSL=    yes

.include "${PORTSDIR}/Mk/bsd.openssl.mk"

.if ${PORT_OPTIONS:MODBC}
CONFIGURE_ARGS+=--enable-odbc
PLIST_SUB+= ODBC=""
.else
PLIST_SUB+= ODBC="@comment "
.endif

.if ${PORT_OPTIONS:MPAM}
CONFIGURE_ARGS+=--enable-pam
PLIST_SUB+= PAM=""
.else
PLIST_SUB+= PAM="@comment "
.endif

.if ! ${PORT_OPTIONS:MDOCS}
MAKE_ARGS+= NOPORTDOCS=${NOPORTDOCS}
.endif

post-patch:
    @${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},g' ${WRKSRC}/configure

post-install:
    @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
    @${FIND} ${PREFIX}/lib/erlang/lib/${DISTNAME} -type f -print0 | ${XARGS} -0 ${CHMOD} ${SHAREMODE}
    @${FIND} ${PREFIX}/lib/erlang/lib/${DISTNAME} -type f -print0 | ${XARGS} -0 ${CHOWN} ${SHAREOWN}:${SHAREGRP}

.if ${PORT_OPTIONS:MPAM}
    ${CHMOD} 4750 ${PREFIX}/lib/erlang/lib/${DISTNAME}/priv/bin/epam
    ${CHOWN} root:ejabberd ${PREFIX}/lib/erlang/lib/${DISTNAME}/priv/bin/epam
    ${INSTALL} -m 444 ${FILESDIR}/pam_ejabberd ${PREFIX}/etc/pam.d/ejabberd
.endif

    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>