1 # TODO: Fix .init cassandra status does not work now.
2 # TODO: Fix .init stop routine it is now subset of PLD default one
3 # TODO: Fix of data/ cassandra created dirs/files privilages (now they are all readable)
4 # TODO: Consider adding
5 # cassandra - memlock unlimited
6 # to /etc/security/limits.conf ?
7 # TODO: C java-jna is only valid with openjdk8-jre ?
8 # cassandra running java from openjdk8-jre-8u66.b02-2.x86_64 fails with java-jna-4.2.1-1.x86_64 but without clamis JNA to work in logs
10 %define shname cassandra
11 %include /usr/lib/rpm/macros.java
12 Summary: Cassandra database binary package
13 Summary(pl.UTF-8): Binarna redystrybucja bazy danych Cassandra
18 Group: Applications/Databases
19 Source0: ftp://ftp.task.gda.pl/pub/www/apache/dist/cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz
20 # Source0-md5: e6e3676ca3a508ad827281ad9db9b45c
21 Source1: cassandra.in.sh
22 Source2: %{shname}.init
23 Source3: %{name}.tmpfiles
24 Patch0: %{name}-jamm_path_fix.patch
25 Patch1: %{name}-cqlsh_path_fix.patch
26 Patch2: %{name}-pld_logging.patch
27 URL: http://cassandra.apache.org/
28 BuildRequires: python-distribute
29 BuildRequires: rpm-javaprov
30 BuildRequires: rpm-pythonprov
31 BuildRequires: rpmbuild(macros) >= 1.710
32 Requires(post,preun): /sbin/chkconfig
34 Requires: python-modules
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 Cassandra brings together the distributed systems technologies from
42 Dynamo and the data model from Google's BigTable. Like Dynamo,
43 Cassandra is eventually consistent. Like BigTable, Cassandra provides
44 a ColumnFamily-based data model richer than typical key/value systems.
46 %description -l pl.UTF-8
47 Cassandra łączy technologie systemów rozproszonych z Dynamo i model
48 danych z googlowskiego BigTable. Tak jak Dynamo, Cassandra jest
49 ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych
50 oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości.
53 %setup -q -n apache-cassandra-%{version}
59 # current version of cqlsh supports only python 2.
61 %py_build %{?with_tests:test}
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d/,%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \
67 $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \
68 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
70 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cassandra
73 cp -p bin/{cqlsh,*sstable*,*tool,cassandra-cli} $RPM_BUILD_ROOT%{_bindir}
74 cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir}
75 cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname}
76 # use bundled libs for python-cql - from cqlsh doc
77 # cp -p %{SOURCE1} lib/cql-internal-only-1.4.2.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
78 # cp -p %{SOURCE1} lib/thrift-python-internal-only-0.9.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
79 cp -p %{SOURCE1} lib/*.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
80 cp -p conf/{*.properties,*.yaml,*.xml,cassandra-env.sh,hotspot_compiler,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf
82 install -d $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers
83 cp -p conf/triggers/*.txt $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers
84 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf
91 rm -rf $RPM_BUILD_ROOT
94 %groupadd -g 259 -r cassandra
95 %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra
98 /sbin/chkconfig --add cassandra
99 %service cassandra restart
102 if [ "$1" = "0" ]; then
103 %service cassandra stop
104 /sbin/chkconfig --del cassandra
108 %defattr(644,root,root,755)
109 %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt
110 %attr(754,root,root) /etc/rc.d/init.d/cassandra
111 %attr(755,root,root) %{_bindir}/cassandra-cli
112 %attr(755,root,root) %{_bindir}/cqlsh
113 %attr(755,root,root) %{_bindir}/nodetool
114 # %attr(755,root,root) %{_bindir}/json2sstable
115 ## %attr(755,root,root) %{_bindir}/sstable2json
116 %attr(755,root,root) %{_bindir}/sstablescrub
117 %attr(755,root,root) %{_bindir}/sstablekeys
118 %attr(755,root,root) %{_bindir}/sstableloader
119 ## %attr(755,root,root) %{_bindir}/sstablesplit
120 %attr(755,root,root) %{_bindir}/sstableupgrade
121 %attr(755,root,root) %{_sbindir}/cassandra
122 %{_datadir}/%{shname}
123 %{systemdtmpfilesdir}/%{shname}.conf
124 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}
125 %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf
126 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties
127 %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh
128 %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt
129 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml
130 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.xml
131 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/hotspot_compiler
132 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}/conf/triggers
133 %attr(640,root,cassandra) /var/lib/%{shname}/conf/triggers/*.txt
135 %attr(750,cassandra,cassandra) %dir /var/log/%{shname}
136 %attr(750,cassandra,cassandra) %dir /var/run/%{shname}
137 %{py_sitedir}/cqlshlib
138 %if "%{py_ver}" > "2.4"
139 %{py_sitedir}/cassandra_pylib-0.0.0-py*.egg-info