Gentoo Archives: gentoo-commits

From: Patrick Lauer <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/kafka-bin/files/, net-misc/kafka-bin/
Date: Mon, 26 Sep 2016 12:15:14
Message-Id: 1474892089.2a2d1d4feca8c3732151697caf947e42a1c6223f.patrick@gentoo
1 commit: 2a2d1d4feca8c3732151697caf947e42a1c6223f
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 26 12:12:24 2016 +0000
4 Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 26 12:14:49 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a2d1d4f
7
8 net-misc/kafka-bin: Initial commit
9
10 Based on ebuilds from lmiphay overlay, updated and tested in adjust overlay
11
12 Package-Manager: portage-2.3.0
13
14 net-misc/kafka-bin/Manifest | 1 +
15 net-misc/kafka-bin/files/kafka-zookeeper.init.d | 20 ++++++++
16 net-misc/kafka-bin/files/kafka.init.d | 19 ++++++++
17 net-misc/kafka-bin/kafka-bin-0.10.0.1.ebuild | 62 +++++++++++++++++++++++++
18 net-misc/kafka-bin/metadata.xml | 10 ++++
19 5 files changed, 112 insertions(+)
20
21 diff --git a/net-misc/kafka-bin/Manifest b/net-misc/kafka-bin/Manifest
22 new file mode 100644
23 index 00000000..1e0d2a4
24 --- /dev/null
25 +++ b/net-misc/kafka-bin/Manifest
26 @@ -0,0 +1 @@
27 +DIST kafka_2.11-0.10.0.1.tgz 31831257 SHA256 2d73625aeddd827c9e92eefb3c727a78455725fbca4361c221eaa05ae1fab02d SHA512 ab89c1d0cf4e05e823f45629e7bc5778173fd7420ebfa259f566071c6b474b08abf808508c7fd6fcca2233b20e76cbf6a235563709bfa019455386f80f0b5d71 WHIRLPOOL 5928d39afdaa4b7cc3839b2555229d42ecc9b3ccd6c76cb2dfd1a7fd4f2fcb2ac9abd055b7c698b5d82232df10e10d4c2f2fd525e880a9c0ed78550e2cf2d28e
28
29 diff --git a/net-misc/kafka-bin/files/kafka-zookeeper.init.d b/net-misc/kafka-bin/files/kafka-zookeeper.init.d
30 new file mode 100644
31 index 00000000..b5c87fa
32 --- /dev/null
33 +++ b/net-misc/kafka-bin/files/kafka-zookeeper.init.d
34 @@ -0,0 +1,20 @@
35 +#!/sbin/openrc-run
36 +# Copyright 1999-2016 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +# $Header: $
39 +
40 +description="Zookeeper for Kafka distributed messaging system"
41 +
42 +logfile="/var/log/kafka-zookeeper.log"
43 +
44 +command="/opt/kafka/bin/zookeeper-server-start.sh"
45 +command_args="/etc/kafka/zookeeper.properties"
46 +start_stop_daemon_args="--chdir /opt/kafka --stdout $logfile --stderr $logfile"
47 +
48 +command_background=yes
49 +pidfile=/run/kafka-zookeeper.pid
50 +
51 +depend() {
52 + need net
53 + after bootmisc
54 +}
55
56 diff --git a/net-misc/kafka-bin/files/kafka.init.d b/net-misc/kafka-bin/files/kafka.init.d
57 new file mode 100644
58 index 00000000..38943b6
59 --- /dev/null
60 +++ b/net-misc/kafka-bin/files/kafka.init.d
61 @@ -0,0 +1,19 @@
62 +#!/sbin/openrc-run
63 +# Copyright 1999-2016 Gentoo Foundation
64 +# Distributed under the terms of the GNU General Public License v2
65 +# $Header: $
66 +
67 +description="Kafka distributed messaging system"
68 +
69 +logfile="/var/log/kafka/kafka.log"
70 +
71 +command="/opt/kafka/bin/kafka-server-start.sh"
72 +command_args="/etc/kafka/server.properties"
73 +start_stop_daemon_args="--user kafka --chdir /opt/kafka --stdout $logfile --stderr $logfile"
74 +
75 +command_background=yes
76 +pidfile=/run/kafka.pid
77 +
78 +depend() {
79 + after zookeeper kafka-zookeeper
80 +}
81
82 diff --git a/net-misc/kafka-bin/kafka-bin-0.10.0.1.ebuild b/net-misc/kafka-bin/kafka-bin-0.10.0.1.ebuild
83 new file mode 100644
84 index 00000000..7dcdb9e
85 --- /dev/null
86 +++ b/net-misc/kafka-bin/kafka-bin-0.10.0.1.ebuild
87 @@ -0,0 +1,62 @@
88 +# Copyright 1999-2016 Gentoo Foundation
89 +# Distributed under the terms of the GNU General Public License v2
90 +# $Header: $
91 +
92 +EAPI=5
93 +
94 +inherit eutils user
95 +
96 +DESCRIPTION="A high-throughput distributed messaging system"
97 +HOMEPAGE="http://kafka.apache.org/"
98 +
99 +# pick recommended scala version
100 +SCALA_VERSION=2.11
101 +MY_PN="kafka"
102 +MY_P="${MY_PN}_${SCALA_VERSION}-${PV}"
103 +SRC_URI="mirror://apache/kafka/${PV}/${MY_P}.tgz"
104 +
105 +RESTRICT="mirror"
106 +
107 +LICENSE="Apache-2.0"
108 +SLOT="0"
109 +KEYWORDS="~amd64 ~x86"
110 +IUSE="internal-zookeeper"
111 +
112 +RDEPEND="
113 + || ( virtual/jre:1.8 virtual/jre:1.7 )
114 +"
115 +DEPEND="${RDEPEND}"
116 +
117 +S="${WORKDIR}/${MY_P}"
118 +INSTALL_DIR="/opt/${MY_PN}"
119 +
120 +pkg_setup() {
121 + enewgroup kafka
122 + enewuser kafka -1 /bin/sh /var/lib/kafka kafka
123 +}
124 +
125 +src_prepare() {
126 + sed -i -e 's:/tmp/zookeeper:/var/lib/kafka/zookeeper:' "config/zookeeper.properties"
127 + sed -i -e 's:/tmp/kafka-logs:/var/lib/kafka/logs:' "config/server.properties"
128 +}
129 +
130 +src_install() {
131 + insinto /etc/kafka
132 + doins config/zookeeper.properties config/server.properties
133 + if use "internal-zookeeper"; then
134 + keepdir /var/lib/kafka/zookeeper
135 + newinitd "${FILESDIR}/${MY_PN}-zookeeper.init.d" "${MY_PN}-zookeeper"
136 + fi
137 +
138 + keepdir /var/lib/kafka
139 + fowners -R kafka:kafka /var/lib/kafka
140 +
141 + keepdir /var/log/kafka
142 + fowners -R kafka:kafka /var/log/kafka
143 +
144 + newinitd "${FILESDIR}/${MY_PN}.init.d" "${MY_PN}"
145 +
146 + dodir "${INSTALL_DIR}"
147 + cp -pRP bin config libs "${ED}/${INSTALL_DIR}" || die
148 + fowners -R kafka:kafka "${INSTALL_DIR}"
149 +}
150
151 diff --git a/net-misc/kafka-bin/metadata.xml b/net-misc/kafka-bin/metadata.xml
152 new file mode 100644
153 index 00000000..0cd4216
154 --- /dev/null
155 +++ b/net-misc/kafka-bin/metadata.xml
156 @@ -0,0 +1,10 @@
157 +<?xml version="1.0" encoding="UTF-8"?>
158 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
159 +<pkgmetadata>
160 + <maintainer type="person">
161 + <email>patrick@g.o</email>
162 + </maintainer>
163 + <use>
164 + <flag name="internal-zookeeper">Use bundled local zookeeper instance</flag>
165 + </use>
166 +</pkgmetadata>