-
Notifications
You must be signed in to change notification settings - Fork 3
/
kafka.spec
133 lines (106 loc) · 4.34 KB
/
kafka.spec
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
%define _noarch_libdir /usr/lib
%define rel_ver 0.8.1.1
Summary: A high-throughput distributed messaging system.
Name: kafka
Version: %{rel_ver}
Release: 1
License: Apache License v2.0
Group: Applications/Databases
URL: http://incubator.apache.org/kafka/
Source0: http://www.gtlib.gatech.edu/pub/apache/kafka/%{rel_ver}/kafka-%{rel_ver}-src.tgz
Source1: kafka.init
Source2: log4j.properties
Source3: server.properties
Source4: sysconfig
BuildRoot: %{_tmppath}/%{name}-%{rel_ver}-%{release}-root
BuildRequires: java-1.7.0-openjdk-devel
Requires: java-1.7.0-openjdk
Requires: log4j
Requires(post): chkconfig initscripts
Requires(pre): chkconfig initscripts
AutoReqProv: no
%description
Apache Kafka is a distributed publish-subscribe messaging system. 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 provides 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.
The use for activity stream processing makes Kafka comparable to
Facebook's Scribe or Apache Flume (incubating), though the
architecture and primitives are very different for these systems and
make Kafka more comparable to a traditional messaging system. See our
design page for more details.
%define _kafka_noarch_libdir %{_noarch_libdir}/kafka
%prep
%setup -q -n kafka-%{rel_ver}-src
%build
./gradlew :core:build -x :core:signArchives -x :core:test
head -n -1 bin/kafka-run-class.sh > run-class.sh
echo "exec \$JAVA \$KAFKA_OPTS \$KAFKA_JMX_OPTS -cp \$CLASSPATH \$@" >> run-class.sh
mv run-class.sh bin/kafka-run-class.sh
chmod +x bin/kafka-run-class.sh
%install
rm -rf %{buildroot}
install -p -d %{buildroot}%{_kafka_noarch_libdir}
cp -r bin core lib %{buildroot}%{_kafka_noarch_libdir}
mkdir -p %{buildroot}%{_sysconfdir}/kafka
install -p -D -m 755 %{S:1} %{buildroot}%{_initrddir}/kafka
install -p -D -m 644 %{S:2} %{buildroot}%{_sysconfdir}/kafka
install -p -D -m 644 %{S:3} %{buildroot}%{_sysconfdir}/kafka
install -p -D -m 644 %{S:4} %{buildroot}%{_sysconfdir}/sysconfig/kafka
install -d %{buildroot}%{_localstatedir}/lib/kafka
install -d %{buildroot}%{_localstatedir}/log/kafka
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README.md LICENSE NOTICE
%dir %attr(0750, kafka, kafka) %{_localstatedir}/lib/kafka
%dir %attr(0750, kafka, kafka) %{_localstatedir}/log/kafka
%{_kafka_noarch_libdir}
%{_initrddir}/kafka
%config(noreplace) %{_sysconfdir}/sysconfig/kafka
%config(noreplace) %{_sysconfdir}/kafka
%pre
getent group kafka >/dev/null || groupadd -r kafka
getent passwd kafka >/dev/null || useradd -r -g kafka -d / -s /sbin/nologin kafka
mkdir -p /usr/lib/kafka/logs
chown -R kafka:kafka /usr/lib/kafka/logs
exit 0
%post
/sbin/chkconfig --add kafka
%preun
if [ $1 = 0 ] ; then
/sbin/service kafka stop >/dev/null 2>&1
/sbin/chkconfig --del kafka
fi
%postun
if [ "$1" -ge "1" ] ; then
/sbin/service kafka condrestart >/dev/null 2>&1 || :
fi
%changelog
* Wed May 14 2014 Sam Kottler <[email protected]> - 0.8.1.1-1
- Update to 0.8.1.1 and use gradle
* Sun Mar 30 2014 Sam Kottler <[email protected]> - 0.8.1-1
- Bumped to 0.8.1 since it's now available
* Sun Oct 21 2012 Sam Kottler <[email protected]> - 0.7.2-1
- Bumped package version to 0.7.2
* Thu Oct 03 2012 Sam Kottler <[email protected]> - 0.7.0-1
- Initial package creation.