1 # TODO: Fix of data/ cassandra created dirs/files privilages (now they are all readable)
2 # TODO: Consider adding
3 # cassandra - memlock unlimited
4 # to /etc/security/limits.conf ?
5 # TODO: C java-jna is only valid with openjdk8-jre ?
6 # 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
8 %define shname cassandra
9 %include /usr/lib/rpm/macros.java
10 Summary: Cassandra database binary package
11 Summary(pl.UTF-8): Binarna redystrybucja bazy danych Cassandra
16 Group: Applications/Databases
17 Source0: ftp://ftp.task.gda.pl/pub/www/apache/dist/cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz
18 # Source0-md5: 71ebbfdae273a59ca202c4019e1f74a7
19 Source1: cassandra.in.sh
20 Source3: %{name}.tmpfiles
21 Source4: %{shname}.service
22 Patch0: %{name}-jamm_path_fix.patch
23 Patch3: %{name}-pld-env.patch
25 URL: http://cassandra.apache.org/
26 BuildRequires: python-distribute
27 BuildRequires: rpm-javaprov
28 BuildRequires: rpm-pythonprov
29 BuildRequires: rpmbuild(macros) >= 1.710
30 Requires(post,preun,postun): systemd-units >= 38
33 Requires: python-modules
34 Requires: systemd-units >= 0.38
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 Cassandra brings together the distributed systems technologies from
40 Dynamo and the data model from Google's BigTable. Like Dynamo,
41 Cassandra is eventually consistent. Like BigTable, Cassandra provides
42 a ColumnFamily-based data model richer than typical key/value systems.
44 %description -l pl.UTF-8
45 Cassandra łączy technologie systemów rozproszonych z Dynamo i model
46 danych z googlowskiego BigTable. Tak jak Dynamo, Cassandra jest
47 ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych
48 oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości.
51 %setup -q -n apache-cassandra-%{version}
55 %{__sed} -i -e 's#$CASSANDRA_HOME/logs#/var/log/cassandra#g' bin/cassandra
58 # current version of cqlsh supports only python 2.
60 %py_build %{?with_tests:test}
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \
66 $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \
67 $RPM_BUILD_ROOT%{systemdtmpfilesdir} $RPM_BUILD_ROOT/%{systemdunitdir}
69 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/%{shname}.service
72 cp -p bin/{cqlsh*,*sstable*,*tool} $RPM_BUILD_ROOT%{_bindir}
73 cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir}
74 cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname}
75 # use bundled libs for python-cql - from cqlsh doc
76 # cp -p %{SOURCE1} lib/cql-internal-only-1.4.2.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
77 # cp -p %{SOURCE1} lib/thrift-python-internal-only-0.9.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
78 cp -p %{SOURCE1} lib/*.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
79 cp -p conf/{*.properties,*.yaml,*.xml,cassandra-env.sh,hotspot_compiler,jvm.options,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf
80 install -d $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers
81 cp -p conf/triggers/*.txt $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers
82 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf
89 rm -rf $RPM_BUILD_ROOT
92 %groupadd -g 259 -r cassandra
93 %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra
96 %systemd_post %{shname}.service
99 %systemd_preun %{shname}.service
103 if [ "$1" = "0" ]; then
104 %userremove %{shname}
105 %groupremove %{shname}
109 %defattr(644,root,root,755)
110 %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt
111 %attr(755,root,root) %{_bindir}/cqlsh
113 %attr(755,root,root) %{_bindir}/nodetool
114 %attr(755,root,root) %{_bindir}/sstablescrub
115 %attr(755,root,root) %{_bindir}/sstableloader
116 %attr(755,root,root) %{_bindir}/sstableupgrade
117 %attr(755,root,root) %{_bindir}/sstableutil
118 %attr(755,root,root) %{_bindir}/sstableverify
119 %attr(755,root,root) %{_sbindir}/cassandra
120 %{_datadir}/%{shname}
121 %{systemdunitdir}/%{shname}.service
122 %{systemdtmpfilesdir}/%{shname}.conf
123 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}
124 %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf
125 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties
126 %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh
127 %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt
128 %attr(640,root,cassandra) /var/lib/%{shname}/conf/jvm.options
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