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 ?
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: 5c3a1dd76f5261900e3f165f3e964815
19 Source1: cassandra.in.sh
20 Source2: %{shname}.init
21 Source3: %{name}.tmpfiles
22 Patch0: %{name}-jamm_path_fix.patch
23 Patch1: %{name}-cqlsh_path_fix.patch
24 URL: http://cassandra.apache.org/
25 BuildRequires: python-distribute
26 BuildRequires: rpm-javaprov
27 BuildRequires: rpm-pythonprov
28 BuildRequires: rpmbuild(macros) >= 1.300
29 Requires(post,preun): /sbin/chkconfig
31 Requires: python-modules
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}
55 # current version of cqlsh supports only python 2.
57 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
61 rm -rf $RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d/,%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \
63 $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \
64 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
66 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cassandra
69 cp -p bin/{cqlsh,*sstable*,*tool,cassandra-cli} $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 conf/{*.properties,cassandra-env.sh,cassandra.yaml,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf
77 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf
80 %{__python} setup.py \
81 build --build-base build-2 \
82 install --skip-build \
84 --root=$RPM_BUILD_ROOT
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 /sbin/chkconfig --add cassandra
96 %service cassandra restart
99 if [ "$1" = "0" ]; then
100 %service cassandra stop
101 /sbin/chkconfig --del cassandra
105 %defattr(644,root,root,755)
106 %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt
107 %attr(754,root,root) /etc/rc.d/init.d/cassandra
108 %attr(755,root,root) %{_bindir}/cassandra-cli
109 %attr(755,root,root) %{_bindir}/cqlsh
110 %attr(755,root,root) %{_bindir}/nodetool
111 %attr(755,root,root) %{_bindir}/json2sstable
112 %attr(755,root,root) %{_bindir}/sstable2json
113 %attr(755,root,root) %{_bindir}/sstablescrub
114 %attr(755,root,root) %{_bindir}/sstablekeys
115 %attr(755,root,root) %{_bindir}/sstableloader
116 %attr(755,root,root) %{_bindir}/sstablesplit
117 %attr(755,root,root) %{_bindir}/sstableupgrade
118 %attr(755,root,root) %{_sbindir}/cassandra
119 %{_datadir}/%{shname}
120 %{systemdtmpfilesdir}/%{shname}.conf
121 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}
122 %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf
123 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties
124 %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh
125 %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt
126 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml
127 %attr(750,cassandra,cassandra) %dir /var/log/%{shname}
128 %attr(750,cassandra,cassandra) %dir /var/run/%{shname}
129 %{py_sitescriptdir}/cqlshlib
130 %if "%{py_ver}" > "2.4"
131 %{py_sitescriptdir}/cassandra_pylib-0.0.0-py*.egg-info