aboutsummaryrefslogtreecommitdiffstats
path: root/net/kafka/Makefile
blob: 58aecb7edbd3cf071a9d60faf6534671fe70a81f (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
102
103
104
105
# $FreeBSD$

PORTNAME=   kafka
PORTVERSION=    1.0.0
CATEGORIES= net java
MASTER_SITES=   APACHE/${PORTNAME}/${PORTVERSION}
DISTNAME=   ${PORTNAME}_2.12-${PORTVERSION}

MAINTAINER= timp87@gmail.com
COMMENT=    Distributed streaming platform

LICENSE=    APACHE20
LICENSE_FILE=   ${WRKSRC}/LICENSE

RUN_DEPENDS=    bash:shells/bash

USES=       tar:tgz shebangfix

SHEBANG_FILES=  bin/*.sh

OPTIONS_DEFINE= DOCS

USERS=      kafka
GROUPS=     kafka

DATADIR=    ${JAVASHAREDIR}/${PORTNAME}
KAFKA_DATADIR=  /var/db/${PORTNAME}
KAFKA_LOGDIR=   /var/log/${PORTNAME}
KAFKA_RUNDIR=   /var/run/${PORTNAME}
KAFKA_BINS= connect-distributed.sh connect-standalone.sh kafka-acls.sh \
        kafka-broker-api-versions.sh kafka-configs.sh \
        kafka-console-consumer.sh kafka-console-producer.sh \
        kafka-consumer-groups.sh kafka-consumer-perf-test.sh \
        kafka-delete-records.sh kafka-log-dirs.sh \
        kafka-mirror-maker.sh kafka-preferred-replica-election.sh \
        kafka-producer-perf-test.sh kafka-reassign-partitions.sh \
        kafka-replay-log-producer.sh kafka-replica-verification.sh \
        kafka-run-class.sh kafka-server-start.sh kafka-server-stop.sh \
        kafka-simple-consumer-shell.sh \
        kafka-streams-application-reset.sh kafka-topics.sh \
        kafka-verifiable-consumer.sh kafka-verifiable-producer.sh \
        trogdor.sh zookeeper-security-migration.sh
KAFKA_CONFIGS=  connect-console-sink.properties \
        connect-console-source.properties \
        connect-distributed.properties connect-file-sink.properties \
        connect-file-source.properties connect-log4j.properties \
        connect-standalone.properties consumer.properties \
        log4j.properties producer.properties server.properties \
        tools-log4j.properties

SUB_FILES=  kafka
SUB_LIST=   JAVA=${JAVA} \
        ETCDIR=${ETCDIR} \
        USERS=${USERS} \
        GROUPS=${GROUPS} \
        KAFKA_RUNDIR=${KAFKA_RUNDIR} \
        KAFKA_LOGDIR=${KAFKA_LOGDIR}

PLIST_SUB=  PORTVERSION=${PORTVERSION} \
        USERS=${USERS} \
        GROUPS=${GROUPS} \
        KAFKA_DATADIR=${KAFKA_DATADIR} \
        KAFKA_RUNDIR=${KAFKA_RUNDIR} \
        KAFKA_LOGDIR=${KAFKA_LOGDIR} \
        ETCDIR=${ETCDIR}

NO_BUILD=   yes
NO_ARCH=    yes
USE_JAVA=   yes
JAVA_VERSION=   1.8+
#JAVA_VENDOR=   openjdk
JAVA_RUN=   yes
USE_RC_SUBR=    kafka

post-patch:
    @${REINPLACE_CMD} "s|JAVA=\"java\"|JAVA=\"${JAVA}\"|" ${WRKSRC}/bin/kafka-run-class.sh
    @${REINPLACE_CMD} "/LOG_DIR=/s|\$$base_dir/logs|${KAFKA_LOGDIR}|" ${WRKSRC}/bin/kafka-run-class.sh
    @${REINPLACE_CMD} "s|\$$base_dir.*/config|${ETCDIR}|" ${WRKSRC}/bin/*.sh
    @${REINPLACE_CMD} "s|ps ax|ps axww|" ${WRKSRC}/bin/kafka-server-stop.sh
    @${REINPLACE_CMD} "/log.dirs/s|=.*|=${KAFKA_DATADIR}|" ${WRKSRC}/config/server.properties

do-install:
    ${MKDIR} ${STAGEDIR}${ETCDIR}
    ${MKDIR} ${STAGEDIR}${KAFKA_DATADIR}
    ${MKDIR} ${STAGEDIR}${KAFKA_LOGDIR}
    ${MKDIR} ${STAGEDIR}${KAFKA_RUNDIR}
    ${MKDIR} ${STAGEDIR}${DATADIR}/bin
.for f in ${KAFKA_BINS}
    ${INSTALL_SCRIPT} ${WRKSRC}/bin/${f} ${STAGEDIR}${DATADIR}/bin/
.endfor
    (cd ${WRKSRC} && ${COPYTREE_SHARE} libs ${STAGEDIR}${DATADIR} "-not ( \
        -name kafka_*-javadoc\.jar -or -name kafka_*-scaladoc\.jar -or \
        -name kafka_*-sources\.jar -or -name kafka_*-test\.jar -or \
        -name *\.asc \
        )" \
    )
.for f in ${KAFKA_CONFIGS}
    ${INSTALL_DATA} ${WRKSRC}/config/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
.endfor

do-install-DOCS-on:
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${EXTRACT_CMD} -xf ${WRKSRC}/site-docs/${PORTNAME}_2.12-${PORTVERSION}-site-docs.tgz -C ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>