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: https://dlcdn.apache.org/cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz
17 # Source0-md5: f2f148d0c7af65375caedb074dde93d1
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
23 URL: http://cassandra.apache.org/
24 BuildRequires: python-distribute
25 BuildRequires: rpm-javaprov
26 BuildRequires: rpm-pythonprov
27 BuildRequires: rpmbuild(macros) >= 1.710
28 Requires(post,preun,postun): systemd-units >= 38
31 Requires: python-modules
32 Requires: systemd-units >= 0.38
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 Cassandra brings together the distributed systems technologies from
38 Dynamo and the data model from Google's BigTable. Like Dynamo,
39 Cassandra is eventually consistent. Like BigTable, Cassandra provides
40 a ColumnFamily-based data model richer than typical key/value systems.
42 %description -l pl.UTF-8
43 Cassandra łączy technologie systemów rozproszonych z Dynamo i model
44 danych z googlowskiego BigTable. Tak jak Dynamo, Cassandra jest
45 ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych
46 oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości.
49 %setup -q -n apache-cassandra-%{version}
53 %{__sed} -i -e 's#$CASSANDRA_HOME/logs#/var/log/cassandra#g' bin/cassandra
56 # current version of cqlsh supports only python 2.
58 %py3_build %{?with_tests:test}
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \
64 $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \
65 $RPM_BUILD_ROOT%{systemdtmpfilesdir} $RPM_BUILD_ROOT/%{systemdunitdir}
67 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/%{shname}.service
69 cp -p bin/{cqlsh*,*sstable*,*tool} $RPM_BUILD_ROOT%{_bindir}
70 cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir}
71 cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname}
72 # use bundled libs for python-cql - from cqlsh doc
73 # cp -p %{SOURCE1} lib/cql-internal-only-1.4.2.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
74 # cp -p %{SOURCE1} lib/thrift-python-internal-only-0.9.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
75 cp -p %{SOURCE1} lib/*.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
76 cp -p conf/{*.properties,*.yaml,*.xml,cassandra-env.sh,hotspot_compiler,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf
77 install -d $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers
78 cp -p conf/triggers/*.txt $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers
79 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf
86 rm -rf $RPM_BUILD_ROOT
89 %groupadd -g 259 -r cassandra
90 %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra
93 %systemd_post %{shname}.service
96 %systemd_preun %{shname}.service
100 if [ "$1" = "0" ]; then
101 %userremove %{shname}
102 %groupremove %{shname}
106 %defattr(644,root,root,755)
107 %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt
108 %attr(755,root,root) %{_bindir}/cqlsh
110 %attr(755,root,root) %{_bindir}/nodetool
111 %attr(755,root,root) %{_bindir}/sstablescrub
112 %attr(755,root,root) %{_bindir}/sstableloader
113 %attr(755,root,root) %{_bindir}/sstableupgrade
114 %attr(755,root,root) %{_bindir}/sstableutil
115 %attr(755,root,root) %{_bindir}/sstableverify
116 %attr(755,root,root) %{_sbindir}/cassandra
117 %{_datadir}/%{shname}
118 %{systemdunitdir}/%{shname}.service
119 %{systemdtmpfilesdir}/%{shname}.conf
120 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}
121 %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf
122 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties
123 %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh
124 %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt
125 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml
126 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.xml
127 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/hotspot_compiler
128 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}/conf/triggers
129 %attr(640,root,cassandra) /var/lib/%{shname}/conf/triggers/*.txt
131 %attr(750,cassandra,cassandra) %dir /var/log/%{shname}
132 %attr(750,cassandra,cassandra) %dir /var/run/%{shname}
133 %{py3_sitedir}/cqlshlib
134 %{py3_sitedir}/cassandra_pylib-0.0.0-py*.egg-info