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: 9f6c940e4201575804d07a2e103d1d61
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 Patch2: %{name}-pld_logging.patch
25 URL: http://cassandra.apache.org/
26 BuildRequires: python-distribute
27 BuildRequires: rpm-javaprov
28 BuildRequires: rpm-pythonprov
29 BuildRequires: rpmbuild(macros) >= 1.300
30 Requires(post,preun): /sbin/chkconfig
32 Requires: python-modules
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}
57 # current version of cqlsh supports only python 2.
59 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d/,%{_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}
68 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cassandra
71 cp -p bin/{cqlsh,*sstable*,*tool,cassandra-cli} $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,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
85 %{__python} setup.py \
86 build --build-base build-2 \
87 install --skip-build \
89 --root=$RPM_BUILD_ROOT
93 rm -rf $RPM_BUILD_ROOT
96 %groupadd -g 259 -r cassandra
97 %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra
100 /sbin/chkconfig --add cassandra
101 %service cassandra restart
104 if [ "$1" = "0" ]; then
105 %service cassandra stop
106 /sbin/chkconfig --del cassandra
110 %defattr(644,root,root,755)
111 %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt
112 %attr(754,root,root) /etc/rc.d/init.d/cassandra
113 %attr(755,root,root) %{_bindir}/cassandra-cli
114 %attr(755,root,root) %{_bindir}/cqlsh
115 %attr(755,root,root) %{_bindir}/nodetool
116 # %attr(755,root,root) %{_bindir}/json2sstable
117 ## %attr(755,root,root) %{_bindir}/sstable2json
118 %attr(755,root,root) %{_bindir}/sstablescrub
119 %attr(755,root,root) %{_bindir}/sstablekeys
120 %attr(755,root,root) %{_bindir}/sstableloader
121 ## %attr(755,root,root) %{_bindir}/sstablesplit
122 %attr(755,root,root) %{_bindir}/sstableupgrade
123 %attr(755,root,root) %{_sbindir}/cassandra
124 %{_datadir}/%{shname}
125 %{systemdtmpfilesdir}/%{shname}.conf
126 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}
127 %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf
128 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties
129 %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh
130 %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt
131 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml
132 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.xml
133 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/hotspot_compiler
134 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}/conf/triggers
135 %attr(640,root,cassandra) /var/lib/%{shname}/conf/triggers/*.txt
137 %attr(750,cassandra,cassandra) %dir /var/log/%{shname}
138 %attr(750,cassandra,cassandra) %dir /var/run/%{shname}
139 %{py_sitescriptdir}/cqlshlib
140 %if "%{py_ver}" > "2.4"
141 %{py_sitescriptdir}/cassandra_pylib-0.0.0-py*.egg-info