aboutsummaryrefslogtreecommitdiffstats
path: root/net-im/openfire/Makefile
blob: e85f575988b7c459500ad52bdf7664c345a3d8ef (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
93
94
95
96
97
98
99
100
101
# Created by: Nikolay Pavlov <qpadla@gmail.com>
# $FreeBSD$

PORTNAME=   openfire
PORTVERSION=    3.9.3
PORTEPOCH=  1
CATEGORIES= net-im java
MASTER_SITES=   http://download.igniterealtime.org/openfire/
DISTNAME=   ${PORTNAME}_src_${PORTVERSION:S/./_/g}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Enterprise instant messaging server

LICENSE=    APACHE20

RUN_DEPENDS=    ${JAVAJARDIR}/slf4j-api.jar:${PORTSDIR}/devel/slf4j

OPTIONS_DEFINE= DOCS PLUGINS
OPTIONS_DEFAULT=PLUGINS
PLUGINS_DESC=   Install bundled plugins

USES=       dos2unix zip
DOS2UNIX_FILES= src/java/org/jivesoftware/openfire/server/ServerDialback.java
USE_LDCONFIG=   yes
USE_ANT=    yes
USE_JAVA=   yes
JAVA_VERSION=   1.6 1.7

ALL_TARGET= openfire
USE_RC_SUBR=    openfire
SUB_FILES+= pkg-message

WRKSRC=     ${WRKDIR}/${PORTNAME}_src
BUILD_WRKSRC=   ${WRKSRC}/build
INSTALL_WRKSRC= ${WRKSRC}/target/openfire
DATADIR=    ${JAVASHAREDIR}/${PORTNAME}
PORTDOCS=   *
VARLOG=     /var/log/openfire
VARDB=      /var/db/openfire
USERS=      openfire
GROUPS=     ${USERS}
PLIST_SUB+= VARLOG=${VARLOG} \
        VARDB=${VARDB}

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MPLUGINS}
ALL_TARGET+=    plugins
PLIST_SUB+= PLUGINS=""
.else
PLIST_SUB+= PLUGINS="@comment "
.endif

post-patch:
    (cd ${WRKSRC} && ${MV} \
        ./src/plugins/jingleNodes/src/i18n/jingleNodes_i18n.properties \
        ./src/plugins/jingleNodes/src/i18n/jinglenodes_i18n.properties)

do-install:
    @${MKDIR} ${STAGEDIR}${DATADIR}/lib
    @${MKDIR} ${STAGEDIR}${ETCDIR}
    @${MKDIR} ${STAGEDIR}${VARDB}
    @${MKDIR} ${STAGEDIR}${VARLOG}

    (cd ${INSTALL_WRKSRC}/lib && ${INSTALL} -m 744 *.jar ${STAGEDIR}${DATADIR}/lib)
    (cd ${INSTALL_WRKSRC}/lib && ${INSTALL} -m 744 log4j.xml ${STAGEDIR}${DATADIR}/lib)

    (cd ${INSTALL_WRKSRC}/resources && ${FIND} . \! -path ./security\* \
    | ${CPIO} -pvdmu -R ${SHAREOWN}:${SHAREGRP} ${STAGEDIR}${DATADIR}/resources)

#   always install admin interface
    (cd ${INSTALL_WRKSRC}/plugins/admin && ${FIND} . \
    | ${CPIO} -pvdmu -R ${SHAREOWN}:${SHAREGRP} ${STAGEDIR}${DATADIR}/plugins/admin)

.if ${PORT_OPTIONS:MPLUGINS}
    (cd ${INSTALL_WRKSRC}/plugins && ${FIND} . \
    | ${CPIO} -pvdmu -R ${SHAREOWN}:${SHAREGRP} ${STAGEDIR}${DATADIR}/plugins)
.endif

.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    (cd ${WRKSRC} && ${INSTALL_DATA} LICENSE.html README.html changelog.html \
        ${STAGEDIR}${DOCSDIR})

    (cd ${WRKSRC}/documentation/docs && ${FIND} . \! -path ./javadoc\* \
    | ${CPIO} -pdmu -R ${SHAREOWN}:${SHAREGRP} ${STAGEDIR}${DOCSDIR} > /dev/null 2>&1 )
.endif
    ${LN} -sf ${ETCDIR} ${STAGEDIR}${DATADIR}/conf
    ${LN} -sf ${ETCDIR} ${STAGEDIR}${DATADIR}/resources/security
    ${LN} -sf ${VARDB} ${STAGEDIR}${DATADIR}/embedded-db
    ${LN} -sf ${VARLOG} ${STAGEDIR}${DATADIR}/logs
    ${INSTALL_DATA} ${INSTALL_WRKSRC}/conf/openfire.xml \
        ${STAGEDIR}${ETCDIR}/openfire.xml.sample
    ${INSTALL} -m 600 ${INSTALL_WRKSRC}/resources/security/truststore \
        ${STAGEDIR}${ETCDIR}/truststore.sample
    ${INSTALL} -m 600 ${INSTALL_WRKSRC}/resources/security/keystore \
        ${STAGEDIR}${ETCDIR}/keystore.sample
    ${INSTALL_DATA} ${INSTALL_WRKSRC}/conf/security.xml \
        ${STAGEDIR}${ETCDIR}/security.xml.sample

.include <bsd.port.mk>