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