]>
Commit | Line | Data |
---|---|---|
3f05bde6 | 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 |
16c24e02 MK |
5 | # cassandra - memlock unlimited |
6 | # to /etc/security/limits.conf ? | |
3f05bde6 | 7 | |
3f05bde6 | 8 | %define shname cassandra |
f60c3231 | 9 | %include /usr/lib/rpm/macros.java |
087ae4ed MK |
10 | Summary: Cassandra database binary package |
11 | Summary(pl.UTF-8): Baza danych Cassandra wersja binarna. | |
12 | Name: cassandra-bin | |
1d458944 | 13 | Version: 0.7.4 |
fc4db3ec | 14 | Release: 1 |
3f05bde6 MK |
15 | License: ASF |
16 | Group: Applications/Databases | |
0dc347f9 | 17 | Source0: http://ftp.tpnet.pl/vol/d1/apache//cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz |
1d458944 | 18 | # Source0-md5: ee0d7ac9b73dedb0a5dca1c34499c2d5 |
087ae4ed MK |
19 | Source1: cassandra.in.sh |
20 | Source2: %{shname}.init | |
3f05bde6 MK |
21 | URL: http://cassandra.apache.org/ |
22 | BuildRequires: rpm-javaprov | |
23 | BuildRequires: rpmbuild(macros) >= 1.300 | |
f60c3231 ER |
24 | Requires(post,preun): /sbin/chkconfig |
25 | Requires: rc-scripts | |
dd8de5bc | 26 | Suggests: java-jna |
3f05bde6 MK |
27 | BuildArch: noarch |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
087ae4ed MK |
31 | Cassandra brings together the distributed systems technologies from |
32 | Dynamo and the data model from Google's BigTable. Like Dynamo, | |
33 | Cassandra is eventually consistent. Like BigTable, Cassandra provides | |
34 | a ColumnFamily-based data model richer than typical key/value systems. | |
3f05bde6 MK |
35 | |
36 | %description -l pl.UTF-8 | |
087ae4ed | 37 | Cassandra łaczy technologie systemów rozproszonych z Dynamo i model |
fc4db3ec | 38 | danych z Googlowskiego BigTable. Tak jak Dynamo, Cassandra jest |
087ae4ed MK |
39 | ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych |
40 | oparty na ColumnFamily bogatszy niż typowwe systemy klucza i wartości. | |
3f05bde6 MK |
41 | |
42 | %prep | |
b51a24b8 | 43 | %setup -q -n apache-cassandra-%{version} |
3f05bde6 | 44 | |
3f05bde6 MK |
45 | %install |
46 | rm -rf $RPM_BUILD_ROOT | |
47 | install -d $RPM_BUILD_ROOT%{_javadir} | |
087ae4ed MK |
48 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{shname}/ |
49 | install -d $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
50 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/ | |
51 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
52 | cp -p lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
53 | install -d $RPM_BUILD_ROOT%{_sbindir} | |
54 | cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir} | |
55 | install -d $RPM_BUILD_ROOT%{_bindir} | |
56 | cp -p bin/cassandra-cli $RPM_BUILD_ROOT%{_bindir} | |
57 | cp -p bin/nodetool $RPM_BUILD_ROOT%{_bindir} | |
58 | cp -p bin/clustertool $RPM_BUILD_ROOT%{_bindir} | |
59 | cp -p bin/json2sstable $RPM_BUILD_ROOT%{_bindir} | |
60 | cp -p bin/sstable2json $RPM_BUILD_ROOT%{_bindir} | |
61 | cp -p bin/schematool $RPM_BUILD_ROOT%{_bindir} | |
62 | cp -p bin/config-converter $RPM_BUILD_ROOT%{_bindir} | |
63 | cp -p bin/sstablekeys $RPM_BUILD_ROOT%{_bindir} | |
3f05bde6 | 64 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cassandra |
087ae4ed MK |
65 | install -d $RPM_BUILD_ROOT/var/lib/%{shname}/commitlog |
66 | install -d $RPM_BUILD_ROOT/var/lib/%{shname}/data | |
67 | install -d $RPM_BUILD_ROOT/var/lib/%{shname}/saved_caches | |
68 | install -d $RPM_BUILD_ROOT/var/lib/%{shname}/conf | |
3f05bde6 MK |
69 | cp -p conf/log4j-server.properties $RPM_BUILD_ROOT/var/lib/%{shname}/conf |
70 | cp -p conf/cassandra.yaml $RPM_BUILD_ROOT/var/lib/%{shname}/conf | |
71 | cp -p conf/cassandra-env.sh $RPM_BUILD_ROOT/var/lib/%{shname}/conf | |
72 | cp -p conf/access.properties $RPM_BUILD_ROOT/var/lib/%{shname}/conf | |
73 | cp -p conf/passwd.properties $RPM_BUILD_ROOT/var/lib/%{shname}/conf | |
74 | cp -p conf/cassandra-topology.properties $RPM_BUILD_ROOT/var/lib/%{shname}/conf | |
75 | cp -p conf/README.txt $RPM_BUILD_ROOT/var/lib/%{shname}/conf | |
087ae4ed MK |
76 | install -d $RPM_BUILD_ROOT/var/run/%{shname} |
77 | install -d $RPM_BUILD_ROOT/var/log/%{shname} | |
3f05bde6 MK |
78 | |
79 | %clean | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %pre | |
3f05bde6 MK |
83 | %groupadd -g 259 -r cassandra |
84 | %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra | |
85 | ||
f60c3231 ER |
86 | %post |
87 | /sbin/chkconfig --add cassandra | |
88 | %service cassandra restart | |
89 | ||
3f05bde6 MK |
90 | %preun |
91 | if [ "$1" = "0" ]; then | |
f60c3231 ER |
92 | %service cassandra stop |
93 | /sbin/chkconfig --del cassandra | |
3f05bde6 MK |
94 | fi |
95 | ||
3f05bde6 MK |
96 | %files |
97 | %defattr(644,root,root,755) | |
98 | %doc CHANGES.txt LICENSE.txt README.txt NEWS.txt NOTICE.txt | |
99 | %attr(754,root,root) /etc/rc.d/init.d/cassandra | |
100 | %attr(755,root,root) %{_bindir}/cassandra-cli | |
101 | %attr(755,root,root) %{_bindir}/nodetool | |
102 | %attr(755,root,root) %{_bindir}/clustertool | |
103 | %attr(755,root,root) %{_bindir}/json2sstable | |
104 | %attr(755,root,root) %{_bindir}/sstable2json | |
105 | %attr(755,root,root) %{_bindir}/schematool | |
106 | %attr(755,root,root) %{_bindir}/config-converter | |
107 | %attr(755,root,root) %{_bindir}/sstablekeys | |
108 | %attr(755,root,root) %{_sbindir}/cassandra | |
087ae4ed | 109 | %{_datadir}/%{shname} |
3f05bde6 MK |
110 | %attr(750,cassandra,cassandra) %dir /var/lib/%{shname} |
111 | %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf | |
087ae4ed MK |
112 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties |
113 | %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh | |
3f05bde6 | 114 | %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt |
087ae4ed | 115 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml |
3f05bde6 MK |
116 | %attr(750,cassandra,cassandra) %dir /var/run/%{shname} |
117 | %attr(750,cassandra,cassandra) %dir /var/log/%{shname} |