summaryrefslogtreecommitdiff
path: root/chat/ejabberd/Makefile
blob: f3aa7ae0c3a3d6d18b35922d76064d72655394f5 (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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# $NetBSD: Makefile,v 1.29 2012/09/30 21:38:04 tron Exp $

DISTNAME=	ejabberd-2.1.11
CATEGORIES=	chat
MASTER_SITES=	http://www.process-one.net/downloads/ejabberd/${PKGVERSION_NOREV}/
EXTRACT_SUFX=	.tgz

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.ejabberd.im/
COMMENT=	Free and Open Source distributed fault-tolerant Jabber server
LICENSE=	gnu-gpl-v2

PKG_DESTDIR_SUPPORT=	user-destdir

CONFLICTS+=	jabberd-[0-9]*

GNU_CONFIGURE=	yes
USE_TOOLS+=	gmake

WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}
# much prefer to be explicit about the configure settings rather than
# depending on the defaults to continue to be sane or same between versions
CONFIGURE_ARGS+=	--enable-odbc
CONFIGURE_ARGS+=	--enable-mod_irc
CONFIGURE_ARGS+=	--enable-mod_muc
CONFIGURE_ARGS+=	--enable-eldap
CONFIGURE_ARGS+=	--enable-web
CONFIGURE_ARGS+=	--enable-tls
CONFIGURE_ARGS+=	--enable-ejabberd_zlib
CONFIGURE_ARGS+=	--with-openssl=${BUILDLINK_PREFIX.openssl}
CONFIGURE_ARGS+=	--with-zlib=${BUILDLINK_PREFIX.zlib}
CONFIGURE_ARGS+=	--with-expat=${BUILDLINK_PREFIX.expat}
CONFIGURE_ARGS+=	--with-libiconv=${BUILDLINK_PREFIX.iconv}
CONFIGURE_ARGS+=	--with-erlang=${BUILDLINK_PREFIX.erlang}
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFBASEDIR}

CONFIGURE_DIRS+=	src
BUILD_DIRS+=		src

MAKE_ENV=		PKGVERSION=${PKGVERSION}
PLIST_SUBST+=		DISTNAME=${DISTNAME} PKGBASE=${PKGBASE}

FILES_SUBST+=		DISTNAME=${DISTNAME} PKGBASE=${PKGBASE}
FILES_SUBST+=		PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
FILES_SUBST+=		EGDIR=${EGDIR}

RCD_SCRIPTS=		ejabberd

BUILD_DEFS+=		EJABBERD_USER EJABBERD_GROUP EJABBERD_LOGDIR
BUILD_DEFS+=		EJABBERD_PIDDIR EJABBERD_DB EJABBERD_TRANSDIR
BUILD_DEFS+=		EJABBERD_EXDIR
BUILD_DEFS+=		VARBASE
PKG_SYSCONFSUBDIR=	ejabberd

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

EJABBERD_USER?=		ejabberd
EJABBERD_GROUP?=	ejabberd
EJABBERD_PIDDIR?=	${VARBASE}/run/ejabberd
EJABBERD_LOGDIR?=	${VARBASE}/log/ejabberd
EJABBERD_DB?=		${VARBASE}/spool/ejabberd
EJABBERD_EXDIR=		share/examples/ejabberd

OWN_DIRS+=		${EJABBERD_PIDDIR}
OWN_DIRS+=		${EJABBERD_LOGDIR}
OWN_DIRS+=		${EJABBERD_DB}
OWN_DIRS_PERMS+=	${EJABBERD_PIDDIR} ${EJABBERD_USER} ${EJABBERD_GROUP} 0770
OWN_DIRS_PERMS+=	${EJABBERD_LOGDIR} ${EJABBERD_USER} ${EJABBERD_GROUP} 0770
OWN_DIRS_PERMS+=	${EJABBERD_DB} ${EJABBERD_USER} ${EJABBERD_GROUP} 0770

FILES_SUBST+=		JABBERD_USER=${EJABBERD_USER}
FILES_SUBST+=		JABBERD_LOGDIR=${EJABBERD_LOGDIR}

PLIST_SUBST+=		EJABBERD_EXDIR=${EJABBERD_EXDIR}

PKG_GROUPS+=		${EJABBERD_GROUP}
PKG_USERS+=		${EJABBERD_USER}:${EJABBERD_GROUP}
PKG_GECOS.${EJABBERD_USER}=	ejabberd user
PKG_HOME.${EJABBERD_USER}=	${EJABBERD_DB}

EGDIR=			${PREFIX}/${EJABBERD_EXDIR}

INSTALLATION_DIRS+=	${PREFIX}/share/doc/${PKGBASE}
INSTALLATION_DIRS+=	${EGDIR}

CONF_FILES=		${EGDIR}/ejabberd.cfg ${PKG_SYSCONFDIR}/ejabberd.cfg
CONF_FILES+=		${EGDIR}/ejabberdctl.cfg ${PKG_SYSCONFDIR}/ejabberdctl.cfg
CONF_FILES+=		${EGDIR}/inetrc ${PKG_SYSCONFDIR}/inetrc

REPLACE_SH=		src/ejabberdctl.template tools/captcha.sh

post-patch:
	${RM} -f ${WRKSRC}/doc/guide.tex.orig

post-install:
	${INSTALL_DATA} ${WRKSRC}/doc/dev.html ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
	${INSTALL_DATA} ${WRKSRC}/doc/features.html ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
	${INSTALL_DATA} ${WRKSRC}/doc/guide.html ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}

SUBST_CLASSES+=		paths
SUBST_MESSAGE.paths=	Localizing paths
SUBST_STAGE.paths=	pre-configure
SUBST_FILES.paths=	src/Makefile.in
SUBST_FILES.paths+=	src/ejabberd.cfg.example
SUBST_FILES.paths+=	src/ejabberdctl.template
SUBST_FILES.paths+=	doc/guide.tex
SUBST_SED.paths+=	-e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
SUBST_SED.paths+=	-e 's,@JABBERD_LOGDIR@,${EJABBERD_LOGDIR},g'
SUBST_SED.paths+=	-e 's,@EJABBERD_DBDIR@,${EJABBERD_DB},g'
SUBST_SED.paths+=	-e 's,@EJABBERD_LOGDIR@,${EJABBERD_LOGDIR},g'
SUBST_SED.paths+=	-e 's,@EJABBERD_PIDDIR@,${EJABBERD_PIDDIR},g'
SUBST_SED.paths+=	-e 's,@EJABBERD_DB@,${EJABBERD_DB},g'
SUBST_SED.paths+=	-e 's,@PREFIX@,${PREFIX},g'
SUBST_SED.paths+=	-e 's,@DISTNAME@,${DISTNAME},g'
SUBST_SED.paths+=	-e 's,@EJABBERD_VARDIR@,${VARBASE},g'

.include "../../converters/libiconv/buildlink3.mk"
.include "../../lang/erlang/buildlink3.mk"
.include "../../textproc/expat/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"