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