]>
Commit | Line | Data |
---|---|---|
4e6d3cb2 | 1 | # TODO: Fix .init cassandra status does not work now. |
16c24e02 MK |
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) | |
f60c3231 | 4 | # TODO: Consider adding |
4e6d3cb2 | 5 | # cassandra - memlock unlimited |
16c24e02 | 6 | # to /etc/security/limits.conf ? |
3f05bde6 | 7 | |
4e6d3cb2 | 8 | %define shname cassandra |
f60c3231 | 9 | %include /usr/lib/rpm/macros.java |
087ae4ed | 10 | Summary: Cassandra database binary package |
4e6d3cb2 | 11 | Summary(pl.UTF-8): Binarna redystrybucja bazy danych Cassandra |
087ae4ed | 12 | Name: cassandra-bin |
b4f49f9b | 13 | Version: 1.1.12 |
b5445178 | 14 | Release: 1 |
3f05bde6 MK |
15 | License: ASF |
16 | Group: Applications/Databases | |
b4f49f9b | 17 | Source0: ftp://ftp.task.gda.pl/pub/www/apache/dist/cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz |
087ae4ed MK |
18 | Source1: cassandra.in.sh |
19 | Source2: %{shname}.init | |
687fc4b6 | 20 | Source3: %{name}.tmpfiles |
40af29a9 | 21 | Patch0: %{name}-jamm_path_fix.patch |
3f05bde6 MK |
22 | URL: http://cassandra.apache.org/ |
23 | BuildRequires: rpm-javaprov | |
24 | BuildRequires: rpmbuild(macros) >= 1.300 | |
f60c3231 ER |
25 | Requires(post,preun): /sbin/chkconfig |
26 | Requires: rc-scripts | |
dd8de5bc | 27 | Suggests: java-jna |
3f05bde6 MK |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
087ae4ed MK |
32 | Cassandra brings together the distributed systems technologies from |
33 | Dynamo and the data model from Google's BigTable. Like Dynamo, | |
34 | Cassandra is eventually consistent. Like BigTable, Cassandra provides | |
35 | a ColumnFamily-based data model richer than typical key/value systems. | |
3f05bde6 MK |
36 | |
37 | %description -l pl.UTF-8 | |
4e6d3cb2 TP |
38 | Cassandra łączy technologie systemów rozproszonych z Dynamo i model |
39 | danych z googlowskiego BigTable. Tak jak Dynamo, Cassandra jest | |
087ae4ed | 40 | ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych |
4e6d3cb2 | 41 | oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości. |
3f05bde6 MK |
42 | |
43 | %prep | |
b51a24b8 | 44 | %setup -q -n apache-cassandra-%{version} |
40af29a9 | 45 | %patch0 -p1 |
3f05bde6 | 46 | |
3f05bde6 MK |
47 | %install |
48 | rm -rf $RPM_BUILD_ROOT | |
4e6d3cb2 | 49 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d/,%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \ |
687fc4b6 | 50 | $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \ |
b4f49f9b | 51 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} |
4e6d3cb2 | 52 | |
3f05bde6 | 53 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cassandra |
7d92ab98 | 54 | cp -p bin/{*sstable*,*tool,cassandra-cli} $RPM_BUILD_ROOT%{_bindir} |
4e6d3cb2 TP |
55 | cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir} |
56 | cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
57 | cp -p conf/{*.properties,cassandra-env.sh,cassandra.yaml,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf | |
3f05bde6 | 58 | |
b4f49f9b | 59 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf |
687fc4b6 | 60 | |
3f05bde6 MK |
61 | %clean |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
64 | %pre | |
3f05bde6 MK |
65 | %groupadd -g 259 -r cassandra |
66 | %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra | |
67 | ||
f60c3231 ER |
68 | %post |
69 | /sbin/chkconfig --add cassandra | |
70 | %service cassandra restart | |
71 | ||
3f05bde6 MK |
72 | %preun |
73 | if [ "$1" = "0" ]; then | |
f60c3231 ER |
74 | %service cassandra stop |
75 | /sbin/chkconfig --del cassandra | |
3f05bde6 MK |
76 | fi |
77 | ||
3f05bde6 MK |
78 | %files |
79 | %defattr(644,root,root,755) | |
80 | %doc CHANGES.txt LICENSE.txt README.txt NEWS.txt NOTICE.txt | |
81 | %attr(754,root,root) /etc/rc.d/init.d/cassandra | |
82 | %attr(755,root,root) %{_bindir}/cassandra-cli | |
83 | %attr(755,root,root) %{_bindir}/nodetool | |
3f05bde6 MK |
84 | %attr(755,root,root) %{_bindir}/json2sstable |
85 | %attr(755,root,root) %{_bindir}/sstable2json | |
b4f49f9b | 86 | %attr(755,root,root) %{_bindir}/sstablescrub |
3f05bde6 | 87 | %attr(755,root,root) %{_bindir}/sstablekeys |
b4f49f9b | 88 | %attr(755,root,root) %{_bindir}/sstableloader |
3f05bde6 | 89 | %attr(755,root,root) %{_sbindir}/cassandra |
087ae4ed | 90 | %{_datadir}/%{shname} |
b4f49f9b | 91 | %{systemdtmpfilesdir}/%{shname}.conf |
3f05bde6 MK |
92 | %attr(750,cassandra,cassandra) %dir /var/lib/%{shname} |
93 | %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf | |
087ae4ed MK |
94 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties |
95 | %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh | |
3f05bde6 | 96 | %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt |
087ae4ed | 97 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml |
3f05bde6 | 98 | %attr(750,cassandra,cassandra) %dir /var/log/%{shname} |
4e6d3cb2 | 99 | %attr(750,cassandra,cassandra) %dir /var/run/%{shname} |