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 Summary: Cassandra database binary package
10 Summary(pl.UTF-8): Binarna redystrybucja bazy danych Cassandra
15 Group: Applications/Databases
16 Source0: ftp://ftp.task.gda.pl/pub/www/apache/dist/cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz
17 # Source0-md5: 71ebbfdae273a59ca202c4019e1f74a7
18 Source1: cassandra.in.sh
19 Source3: %{name}.tmpfiles
20 Source4: %{shname}.service
21 Patch0: %{name}-jamm_path_fix.patch
22 Patch3: %{name}-pld-env.patch
24 URL: http://cassandra.apache.org/
25 BuildRequires: python-distribute
26 BuildRequires: rpm-javaprov
27 BuildRequires: rpm-pythonprov
28 BuildRequires: rpmbuild(macros) >= 1.710
29 Requires(post,preun,postun): systemd-units >= 38
32 Requires: python-modules
33 Requires: systemd-units >= 0.38
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Cassandra brings together the distributed systems technologies from
39 Dynamo and the data model from Google's BigTable. Like Dynamo,
40 Cassandra is eventually consistent. Like BigTable, Cassandra provides
41 a ColumnFamily-based data model richer than typical key/value systems.
43 %description -l pl.UTF-8
44 Cassandra łączy technologie systemów rozproszonych z Dynamo i model
45 danych z googlowskiego BigTable. Tak jak Dynamo, Cassandra jest
46 ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych
47 oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości.
50 %setup -q -n apache-cassandra-%{version}
54 %{__sed} -i -e 's#$CASSANDRA_HOME/logs#/var/log/cassandra#g' bin/cassandra
57 # current version of cqlsh supports only python 2.
59 %py_build %{?with_tests:test}
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \
65 $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \
66 $RPM_BUILD_ROOT%{systemdtmpfilesdir} $RPM_BUILD_ROOT/%{systemdunitdir}
68 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/%{shname}.service
71 cp -p bin/{cqlsh*,*sstable*,*tool} $RPM_BUILD_ROOT%{_bindir}
72 cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir}
73 cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname}
74 # use bundled libs for python-cql - from cqlsh doc
75 # cp -p %{SOURCE1} lib/cql-internal-only-1.4.2.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
76 # cp -p %{SOURCE1} lib/thrift-python-internal-only-0.9.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
77 cp -p %{SOURCE1} lib/*.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
78 cp -p conf/{*.properties,*.yaml,*.xml,cassandra-env.sh,hotspot_compiler,jvm.options,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf
79 install -d $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers
80 cp -p conf/triggers/*.txt $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers
81 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf
88 rm -rf $RPM_BUILD_ROOT
91 %groupadd -g 259 -r cassandra
92 %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra
95 %systemd_post %{shname}.service
98 %systemd_preun %{shname}.service
102 if [ "$1" = "0" ]; then
103 %userremove %{shname}
104 %groupremove %{shname}
108 %defattr(644,root,root,755)
109 %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt
110 %attr(755,root,root) %{_bindir}/cqlsh
112 %attr(755,root,root) %{_bindir}/nodetool
113 %attr(755,root,root) %{_bindir}/sstablescrub
114 %attr(755,root,root) %{_bindir}/sstableloader
115 %attr(755,root,root) %{_bindir}/sstableupgrade
116 %attr(755,root,root) %{_bindir}/sstableutil
117 %attr(755,root,root) %{_bindir}/sstableverify
118 %attr(755,root,root) %{_sbindir}/cassandra
119 %{_datadir}/%{shname}
120 %{systemdunitdir}/%{shname}.service
121 %{systemdtmpfilesdir}/%{shname}.conf
122 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}
123 %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf
124 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties
125 %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh
126 %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt
127 %attr(640,root,cassandra) /var/lib/%{shname}/conf/jvm.options
128 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml
129 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.xml
130 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/hotspot_compiler
131 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}/conf/triggers
132 %attr(640,root,cassandra) /var/lib/%{shname}/conf/triggers/*.txt
134 %attr(750,cassandra,cassandra) %dir /var/log/%{shname}
135 %attr(750,cassandra,cassandra) %dir /var/run/%{shname}
136 %{py_sitedir}/cqlshlib
137 %if "%{py_ver}" > "2.4"
138 %{py_sitedir}/cassandra_pylib-0.0.0-py*.egg-info