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

PORTNAME=   ejabberd
PORTVERSION=    15.02
CATEGORIES= net-im
MASTER_SITES=   http://www.process-one.net/downloads/${PORTNAME}/${PORTVERSION}/:p1 \
        http://distfiles.pirateparty.in/%SUBDIR%/:deps \
        ${MASTER_SITE_LOCAL:S/$/:deps/}
MASTER_SITE_SUBDIR= ashish/:deps
DISTFILES+= ${PORTNAME}-${PORTVERSION}.tgz:p1 ejabberd-deps-2.tar.xz:deps

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

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/COPYING

BUILD_DEPENDS=  erlc:${PORTSDIR}/lang/erlang \
        git:${PORTSDIR}/devel/git
RUN_DEPENDS=    erl:${PORTSDIR}/lang/erlang
LIB_DEPENDS=    libexpat.so:${PORTSDIR}/textproc/expat2 \
        libyaml.so:${PORTSDIR}/textproc/libyaml

USERS=      ejabberd
GROUPS=     ${USERS}

GNU_CONFIGURE=  yes
USES=       cpe gmake pkgconfig
USE_RC_SUBR=    ${PORTNAME}
NOPRECIOUSMAKEVARS= yes
CPE_VENDOR= process-one

OPTIONS_DEFINE= ODBC PAM DOCS JSON MYSQL PGSQL LAGER ICONV RIAK
OPTIONS_DEFAULT=    LAGER ICONV

MAKE_ENV=   PORTVERSION=${PORTVERSION}
CONFIGURE_ARGS+=--localstatedir=/var
MAKE_ARGS=  "CPPFLAGS=${CPPFLAGS}" "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}"
CPPFLAGS+=  -I${LOCALBASE}/include
CFLAGS+=    -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
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} SHAREMODE=${SHAREMODE} \
        SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP}

OPTIONS_SUB=        yes
LAGER_DESC= LAGER logger
RIAK_DESC=  Riak database support
PAM_CONFIGURE_ENABLE=   pam
ODBC_CONFIGURE_ENABLE=  odbc
LAGER_CONFIGURE_ENABLE= lager
JSON_CONFIGURE_ENABLE=  json
MYSQL_CONFIGURE_ENABLE= mysql
PGSQL_CONFIGURE_ENABLE= pgsql
RIAK_CONFIGURE_ENABLE=  riak
ICONV_CONFIGURE_ENABLE= iconv
ICONV_USES=     iconv:wchar_t
ICONV_LDFLAGS=      ${ICONV_LIB}
DOCS_MAKE_ARGS_OFF= NOPORTDOCS=yes

USE_OPENSSL=    yes

.include <bsd.port.pre.mk>

post-extract:
    @${LN} -s ${WRKDIR}/deps ${WRKSRC}/

post-patch:
    @${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},g' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g' ${WRKSRC}/deps/p1_iconv/rebar.config

post-install:
.if ${PORT_OPTIONS:MPAM}
    ${INSTALL} -m 444 ${FILESDIR}/pam_ejabberd ${STAGEDIR}${PREFIX}/etc/pam.d/ejabberd
.endif
.for _file in p1_tls_drv.so expat_erl.so p1_yaml.so esip_drv.so p1_sha.so jiffy.so ezlib_drv.so iconv.so stringprep.so
    -@[ -f ${STAGEDIR}${PREFIX}/lib/erlang/lib/ejabberd-${PORTVERSION}/priv/lib/${_file} ] && ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/erlang/lib/ejabberd-${PORTVERSION}/priv/lib/${_file}
.endfor

.include <bsd.port.post.mk>