aboutsummaryrefslogtreecommitdiffstats
path: root/devel/zookeeper/Makefile
blob: ba6f8d4ce8a206cae45cb994d1e2f14c78e133f9 (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
# $FreeBSD$

PORTNAME=   zookeeper
PORTVERSION=    3.4.7
PORTREVISION=   1
CATEGORIES= devel java
MASTER_SITES=   ${MASTER_SITE_APACHE}
MASTER_SITE_SUBDIR= ${PORTNAME}/current

MAINTAINER= skreuzer@FreeBSD.org
COMMENT=    Coordination Service for Distributed Applications

RUN_DEPENDS=    slf4j>=1.7.5:devel/slf4j \
        netty>=3.5.5:java/netty \
        jline>=0.9.94:devel/jline \
        log4j>=1.2.16:devel/log4j \
        libzookeeper>=3.4.7:devel/libzookeeper

USERS=  zookeeper
GROUPS= zookeeper

ZOOKEEPER_JAR=  ${WRKSRC}/${PORTNAME}-${PORTVERSION}.jar

ZOOKEEPER_DBDIR?=   /var/db/zookeeper
ZOOKEEPER_LOGDIR?=  /var/log/zookeeper

SUB_FILES=  zookeeper zkCli.sh zkServer.sh
SUB_LIST=   JAVA=${JAVA} \
        JAVALIBDIR=${JAVALIBDIR} \
        ETCDIR=${ETCDIR} \
        ZOOKEEPER_USER=${USERS} \
        ZOOKEEPER_GROUP=${GROUPS} \
        ZOOKEEPER_LOGDIR=${ZOOKEEPER_LOGDIR}

PLIST_SUB+= PORTVERSION=${PORTVERSION} \
        ZOOKEEPER_DBDIR=${ZOOKEEPER_DBDIR} \
        ZOOKEEPER_LOGDIR=${ZOOKEEPER_LOGDIR} \
        JAVALIBDIR=${JAVALIBDIR}

NO_BUILD=   yes
NO_ARCH=    yes
USE_JAVA=   yes
JAVA_VERSION=   1.7
JAVA_VENDOR=    openjdk
JAVA_RUN=   yes
USE_RC_SUBR=    zookeeper

PORTDOCS=   *

post-extract:
    @${REINPLACE_CMD} "/dataDir/s|=.*|=${ZOOKEEPER_DBDIR}|" ${WRKDIR}/${DISTNAME}/conf/zoo_sample.cfg
    @${RM} ${WRKDIR}/${DISTNAME}/conf/zoo_sample.cfg.bak

do-install:
    ${CP} -Rp ${WRKDIR}/${DISTNAME}/conf/ ${STAGEDIR}${ETCDIR}
    ${INSTALL_DATA} ${ZOOKEEPER_JAR} ${STAGEDIR}${JAVALIBDIR}
    (cd ${STAGEDIR}/${JAVAJARDIR} && ${LN} -nfs \
        ${PORTNAME}-${PORTVERSION}.jar ${PORTNAME}.jar)

    ${INSTALL_SCRIPT} ${WRKDIR}/zkCli.sh ${STAGEDIR}${PREFIX}/bin/
    ${INSTALL_SCRIPT} ${WRKDIR}/zkServer.sh ${STAGEDIR}${PREFIX}/bin/

    ${MKDIR} ${STAGEDIR}${ZOOKEEPER_LOGDIR}
    ${MKDIR} ${STAGEDIR}${ZOOKEEPER_DBDIR}

do-install-DOCS-on:
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    @(cd ${WRKDIR}/${DISTNAME}/docs && \
    ${TAR} -cf - . | ${TAR} -xf - -C ${STAGEDIR}${DOCSDIR})

.include <bsd.port.mk>