]>
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 ? |
63a7728c MK |
7 | # TODO: C java-jna is only valid with openjdk8-jre ? |
8 | # cassandra running java from openjdk8-jre-8u66.b02-2.x86_64 fails with java-jna-4.2.1-1.x86_64 but without clamis JNA to work in logs | |
3f05bde6 | 9 | |
4e6d3cb2 | 10 | %define shname cassandra |
f60c3231 | 11 | %include /usr/lib/rpm/macros.java |
087ae4ed | 12 | Summary: Cassandra database binary package |
4e6d3cb2 | 13 | Summary(pl.UTF-8): Binarna redystrybucja bazy danych Cassandra |
087ae4ed | 14 | Name: cassandra-bin |
59e906cd MK |
15 | Version: 2.1.16 |
16 | Release: 1 | |
3f05bde6 MK |
17 | License: ASF |
18 | Group: Applications/Databases | |
b4f49f9b | 19 | Source0: ftp://ftp.task.gda.pl/pub/www/apache/dist/cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz |
59e906cd | 20 | # Source0-md5: cc11eadd767e0200d412b7a0bde6a9f5 |
087ae4ed MK |
21 | Source1: cassandra.in.sh |
22 | Source2: %{shname}.init | |
687fc4b6 | 23 | Source3: %{name}.tmpfiles |
40af29a9 | 24 | Patch0: %{name}-jamm_path_fix.patch |
93a9c726 | 25 | Patch1: %{name}-cqlsh_path_fix.patch |
5422f39a | 26 | Patch2: %{name}-pld_logging.patch |
3f05bde6 | 27 | URL: http://cassandra.apache.org/ |
fdc8d9a4 | 28 | BuildRequires: python-distribute |
3f05bde6 | 29 | BuildRequires: rpm-javaprov |
fdc8d9a4 | 30 | BuildRequires: rpm-pythonprov |
8006c5d6 | 31 | BuildRequires: rpmbuild(macros) >= 1.710 |
f60c3231 | 32 | Requires(post,preun): /sbin/chkconfig |
fdc8d9a4 MK |
33 | Requires: python |
34 | Requires: python-modules | |
f60c3231 | 35 | Requires: rc-scripts |
63a7728c MK |
36 | Requires: jre >= 1.7 |
37 | Conflicts: java-jna | |
3f05bde6 MK |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
39 | ||
40 | %description | |
087ae4ed MK |
41 | Cassandra brings together the distributed systems technologies from |
42 | Dynamo and the data model from Google's BigTable. Like Dynamo, | |
43 | Cassandra is eventually consistent. Like BigTable, Cassandra provides | |
44 | a ColumnFamily-based data model richer than typical key/value systems. | |
3f05bde6 MK |
45 | |
46 | %description -l pl.UTF-8 | |
4e6d3cb2 TP |
47 | Cassandra łączy technologie systemów rozproszonych z Dynamo i model |
48 | danych z googlowskiego BigTable. Tak jak Dynamo, Cassandra jest | |
087ae4ed | 49 | ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych |
4e6d3cb2 | 50 | oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości. |
3f05bde6 MK |
51 | |
52 | %prep | |
b51a24b8 | 53 | %setup -q -n apache-cassandra-%{version} |
40af29a9 | 54 | %patch0 -p1 |
93a9c726 | 55 | %patch1 -p1 |
5422f39a | 56 | %patch2 -p1 |
93a9c726 MK |
57 | |
58 | %build | |
59 | # current version of cqlsh supports only python 2. | |
60 | cd pylib | |
271a98d0 | 61 | %py_build %{?with_tests:test} |
93a9c726 | 62 | cd .. |
3f05bde6 | 63 | |
3f05bde6 MK |
64 | %install |
65 | rm -rf $RPM_BUILD_ROOT | |
4e6d3cb2 | 66 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d/,%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \ |
687fc4b6 | 67 | $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \ |
b4f49f9b | 68 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} |
4e6d3cb2 | 69 | |
fdc8d9a4 | 70 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cassandra |
93a9c726 MK |
71 | |
72 | rm bin/*.bat | |
73 | cp -p bin/{cqlsh,*sstable*,*tool,cassandra-cli} $RPM_BUILD_ROOT%{_bindir} | |
4e6d3cb2 TP |
74 | cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir} |
75 | cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
93a9c726 | 76 | # use bundled libs for python-cql - from cqlsh doc |
0aa3a378 MK |
77 | # cp -p %{SOURCE1} lib/cql-internal-only-1.4.2.zip $RPM_BUILD_ROOT%{_datadir}/%{shname} |
78 | # cp -p %{SOURCE1} lib/thrift-python-internal-only-0.9.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
79 | cp -p %{SOURCE1} lib/*.zip $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
5422f39a MK |
80 | cp -p conf/{*.properties,*.yaml,*.xml,cassandra-env.sh,hotspot_compiler,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf |
81 | # ,triggers | |
82 | install -d $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers | |
83 | cp -p conf/triggers/*.txt $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers | |
fdc8d9a4 | 84 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf |
687fc4b6 | 85 | |
93a9c726 | 86 | cd pylib |
271a98d0 | 87 | %py_install |
93a9c726 MK |
88 | cd .. |
89 | ||
3f05bde6 MK |
90 | %clean |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | ||
93 | %pre | |
3f05bde6 MK |
94 | %groupadd -g 259 -r cassandra |
95 | %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra | |
96 | ||
f60c3231 ER |
97 | %post |
98 | /sbin/chkconfig --add cassandra | |
99 | %service cassandra restart | |
100 | ||
3f05bde6 MK |
101 | %preun |
102 | if [ "$1" = "0" ]; then | |
f60c3231 ER |
103 | %service cassandra stop |
104 | /sbin/chkconfig --del cassandra | |
3f05bde6 MK |
105 | fi |
106 | ||
3f05bde6 MK |
107 | %files |
108 | %defattr(644,root,root,755) | |
93a9c726 | 109 | %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt |
3f05bde6 MK |
110 | %attr(754,root,root) /etc/rc.d/init.d/cassandra |
111 | %attr(755,root,root) %{_bindir}/cassandra-cli | |
93a9c726 | 112 | %attr(755,root,root) %{_bindir}/cqlsh |
3f05bde6 | 113 | %attr(755,root,root) %{_bindir}/nodetool |
0aa3a378 MK |
114 | # %attr(755,root,root) %{_bindir}/json2sstable |
115 | ## %attr(755,root,root) %{_bindir}/sstable2json | |
b4f49f9b | 116 | %attr(755,root,root) %{_bindir}/sstablescrub |
3f05bde6 | 117 | %attr(755,root,root) %{_bindir}/sstablekeys |
b4f49f9b | 118 | %attr(755,root,root) %{_bindir}/sstableloader |
0aa3a378 | 119 | ## %attr(755,root,root) %{_bindir}/sstablesplit |
c187b9d9 | 120 | %attr(755,root,root) %{_bindir}/sstableupgrade |
3f05bde6 | 121 | %attr(755,root,root) %{_sbindir}/cassandra |
087ae4ed | 122 | %{_datadir}/%{shname} |
b4f49f9b | 123 | %{systemdtmpfilesdir}/%{shname}.conf |
3f05bde6 MK |
124 | %attr(750,cassandra,cassandra) %dir /var/lib/%{shname} |
125 | %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf | |
087ae4ed MK |
126 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties |
127 | %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh | |
3f05bde6 | 128 | %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt |
087ae4ed | 129 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml |
5422f39a MK |
130 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.xml |
131 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/hotspot_compiler | |
132 | %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}/conf/triggers | |
133 | %attr(640,root,cassandra) /var/lib/%{shname}/conf/triggers/*.txt | |
134 | ||
3f05bde6 | 135 | %attr(750,cassandra,cassandra) %dir /var/log/%{shname} |
4e6d3cb2 | 136 | %attr(750,cassandra,cassandra) %dir /var/run/%{shname} |
a2bbccde | 137 | %{py_sitedir}/cqlshlib |
93a9c726 | 138 | %if "%{py_ver}" > "2.4" |
a2bbccde | 139 | %{py_sitedir}/cassandra_pylib-0.0.0-py*.egg-info |
93a9c726 | 140 | %endif |