This repository has been archived by the owner on Jan 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
kafka.spec.in
96 lines (72 loc) · 3.27 KB
/
kafka.spec.in
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
Summary: Kafka is a distributed publish/subscribe messaging system
Name: kafka
Version: ##RPMVERSION##
Release: ##RPMRELEASE##%{?dist}
Group: Applications/Internet
License: Apache (v2)
Source0: kafka-%{version}.tar.gz
Source1: kafka.init
Source2: zookeeper.init
URL: http://kafka.apache.org
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Distribution: Niels Basjes
Vendor: Niels Basjes
Packager: Niels Basjes <[email protected]>
Requires: java >= 1.6
Requires(pre): shadow-utils
Requires: zookeeper >= 3.3.4
%description
It is designed to support the following
Persistent messaging with O(1) disk structures that provide constant time performance even with many TB of stored messages.
High-throughput: even with very modest hardware Kafka can support hundreds of thousands of messages per second.
Explicit support for partitioning messages over Kafka servers and distributing consumption over a cluster of consumer machines while maintaining per-partition ordering semantics.
Support for parallel data load into Hadoop.
Kafka is aimed at providing a publish-subscribe solution that can handle all activity stream data and processing on a consumer-scale web site. This kind of activity (page views, searches, and other user actions) are a key ingredient in many of the social feature on the modern web. This data is typically handled by "logging" and ad hoc log aggregation solutions due to the throughput requirements. This kind of ad hoc solution is a viable solution to providing logging data to an offline analysis system like Hadoop, but is very limiting for building real-time processing. Kafka aims to unify offline and online processing by providing a mechanism for parallel load into Hadoop as well as the ability to partition real-time consumption over a cluster of machines.
See our web site for more details on the project. (http://kafka.apache.org/)
%pre
# Create user and group
getent group kafka >/dev/null || groupadd -r kafka
getent passwd kafka >/dev/null || \
useradd -r -g kafka -d /opt/kafka -s /bin/bash \
-c "Kafka Account" kafka
exit 0
%post
alternatives --install /opt/kafka kafkahome /opt/%{name}-%{version} ##INTEGERVERSION##
%preun
service kafka stop
%postun
alternatives --remove kafkahome /opt/%{name}-%{version}
%prep
%setup
#%patch0 -p1
#%patch1 -p1
%build
# Build package
gradle downloadWrapper
./gradlew -PscalaVersion=2.10.4 releaseTarGz
%install
# Clean out any previous builds not on slash
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%{__mkdir_p} %{buildroot}/opt/%{name}-%{version}
%{__cp} -R * %{buildroot}/opt/%{name}-%{version}
%{__mkdir_p} %{buildroot}/var/log/kafka
%{__mkdir_p} %{buildroot}/etc/rc.d/init.d
install -m 755 %{S:1} %{buildroot}/etc/rc.d/init.d/kafka
# Simply create this oneliner in the spec file
%{__mkdir_p} %{buildroot}/etc/profile.d/
echo 'export PATH=${PATH}:/opt/kafka/bin' > %{buildroot}/etc/profile.d/kafka.sh
%files
%defattr(-,kafka,kafka)
%config /opt/%{name}-%{version}/config
/opt/%{name}-%{version}
/var/log/kafka
/etc/rc.d/init.d/kafka
/etc/profile.d/kafka.sh
%clean
#used to cleanup things outside the build area and possibly inside.
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%changelog
* Mon Sep 16 2013 Niels Basjes <[email protected]>
- Refactoring the scripting
* Fri Mar 15 2013 Mark Poole <[email protected]>
- First build