]>
Commit | Line | Data |
---|---|---|
16c24e02 | 1 | # TODO: Fix of data/ cassandra created dirs/files privilages (now they are all readable) |
f60c3231 | 2 | # TODO: Consider adding |
4e6d3cb2 | 3 | # cassandra - memlock unlimited |
16c24e02 | 4 | # to /etc/security/limits.conf ? |
63a7728c | 5 | # TODO: C java-jna is only valid with openjdk8-jre ? |
47df05c0 | 6 | # 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 | 7 | |
4e6d3cb2 | 8 | %define shname cassandra |
087ae4ed | 9 | Summary: Cassandra database binary package |
4e6d3cb2 | 10 | Summary(pl.UTF-8): Binarna redystrybucja bazy danych Cassandra |
087ae4ed | 11 | Name: cassandra-bin |
40bf3751 | 12 | Version: 4.1.3 |
8bf8d201 | 13 | Release: 1 |
3f05bde6 MK |
14 | License: ASF |
15 | Group: Applications/Databases | |
40bf3751 JR |
16 | Source0: https://dlcdn.apache.org/cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz |
17 | # Source0-md5: f2f148d0c7af65375caedb074dde93d1 | |
087ae4ed | 18 | Source1: cassandra.in.sh |
687fc4b6 | 19 | Source3: %{name}.tmpfiles |
47df05c0 | 20 | Source4: %{shname}.service |
40af29a9 | 21 | Patch0: %{name}-jamm_path_fix.patch |
47df05c0 | 22 | Patch3: %{name}-pld-env.patch |
3f05bde6 | 23 | URL: http://cassandra.apache.org/ |
fdc8d9a4 | 24 | BuildRequires: python-distribute |
3f05bde6 | 25 | BuildRequires: rpm-javaprov |
fdc8d9a4 | 26 | BuildRequires: rpm-pythonprov |
8006c5d6 | 27 | BuildRequires: rpmbuild(macros) >= 1.710 |
47df05c0 MK |
28 | Requires(post,preun,postun): systemd-units >= 38 |
29 | Requires: jre >= 1.7 | |
fdc8d9a4 MK |
30 | Requires: python |
31 | Requires: python-modules | |
47df05c0 | 32 | Requires: systemd-units >= 0.38 |
63a7728c | 33 | Conflicts: java-jna |
3f05bde6 MK |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
35 | ||
36 | %description | |
087ae4ed MK |
37 | Cassandra brings together the distributed systems technologies from |
38 | Dynamo and the data model from Google's BigTable. Like Dynamo, | |
39 | Cassandra is eventually consistent. Like BigTable, Cassandra provides | |
40 | a ColumnFamily-based data model richer than typical key/value systems. | |
3f05bde6 MK |
41 | |
42 | %description -l pl.UTF-8 | |
4e6d3cb2 TP |
43 | Cassandra łączy technologie systemów rozproszonych z Dynamo i model |
44 | danych z googlowskiego BigTable. Tak jak Dynamo, Cassandra jest | |
087ae4ed | 45 | ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych |
4e6d3cb2 | 46 | oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości. |
3f05bde6 MK |
47 | |
48 | %prep | |
b51a24b8 | 49 | %setup -q -n apache-cassandra-%{version} |
40af29a9 | 50 | %patch0 -p1 |
47df05c0 MK |
51 | %patch3 -p1 |
52 | # Fix logging dir | |
53 | %{__sed} -i -e 's#$CASSANDRA_HOME/logs#/var/log/cassandra#g' bin/cassandra | |
93a9c726 MK |
54 | |
55 | %build | |
56 | # current version of cqlsh supports only python 2. | |
57 | cd pylib | |
40bf3751 | 58 | %py3_build %{?with_tests:test} |
93a9c726 | 59 | cd .. |
3f05bde6 | 60 | |
3f05bde6 MK |
61 | %install |
62 | rm -rf $RPM_BUILD_ROOT | |
47df05c0 | 63 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \ |
687fc4b6 | 64 | $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \ |
47df05c0 | 65 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} $RPM_BUILD_ROOT/%{systemdunitdir} |
4e6d3cb2 | 66 | |
47df05c0 | 67 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/%{shname}.service |
93a9c726 | 68 | |
47df05c0 | 69 | cp -p bin/{cqlsh*,*sstable*,*tool} $RPM_BUILD_ROOT%{_bindir} |
4e6d3cb2 TP |
70 | cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir} |
71 | cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
93a9c726 | 72 | # use bundled libs for python-cql - from cqlsh doc |
0aa3a378 MK |
73 | # cp -p %{SOURCE1} lib/cql-internal-only-1.4.2.zip $RPM_BUILD_ROOT%{_datadir}/%{shname} |
74 | # cp -p %{SOURCE1} lib/thrift-python-internal-only-0.9.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
75 | cp -p %{SOURCE1} lib/*.zip $RPM_BUILD_ROOT%{_datadir}/%{shname} | |
40bf3751 | 76 | cp -p conf/{*.properties,*.yaml,*.xml,cassandra-env.sh,hotspot_compiler,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf |
5422f39a MK |
77 | install -d $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers |
78 | cp -p conf/triggers/*.txt $RPM_BUILD_ROOT/var/lib/%{shname}/conf/triggers | |
fdc8d9a4 | 79 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf |
687fc4b6 | 80 | |
93a9c726 | 81 | cd pylib |
40bf3751 | 82 | %py3_install |
93a9c726 MK |
83 | cd .. |
84 | ||
3f05bde6 MK |
85 | %clean |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %pre | |
3f05bde6 MK |
89 | %groupadd -g 259 -r cassandra |
90 | %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra | |
91 | ||
f60c3231 | 92 | %post |
47df05c0 | 93 | %systemd_post %{shname}.service |
f60c3231 | 94 | |
3f05bde6 | 95 | %preun |
47df05c0 MK |
96 | %systemd_preun %{shname}.service |
97 | ||
98 | %postun | |
99 | %systemd_reload | |
3f05bde6 | 100 | if [ "$1" = "0" ]; then |
47df05c0 MK |
101 | %userremove %{shname} |
102 | %groupremove %{shname} | |
3f05bde6 MK |
103 | fi |
104 | ||
3f05bde6 MK |
105 | %files |
106 | %defattr(644,root,root,755) | |
93a9c726 | 107 | %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt |
93a9c726 | 108 | %attr(755,root,root) %{_bindir}/cqlsh |
47df05c0 | 109 | %{_bindir}/cqlsh.py |
3f05bde6 | 110 | %attr(755,root,root) %{_bindir}/nodetool |
b4f49f9b | 111 | %attr(755,root,root) %{_bindir}/sstablescrub |
b4f49f9b | 112 | %attr(755,root,root) %{_bindir}/sstableloader |
c187b9d9 | 113 | %attr(755,root,root) %{_bindir}/sstableupgrade |
47df05c0 MK |
114 | %attr(755,root,root) %{_bindir}/sstableutil |
115 | %attr(755,root,root) %{_bindir}/sstableverify | |
3f05bde6 | 116 | %attr(755,root,root) %{_sbindir}/cassandra |
087ae4ed | 117 | %{_datadir}/%{shname} |
47df05c0 | 118 | %{systemdunitdir}/%{shname}.service |
b4f49f9b | 119 | %{systemdtmpfilesdir}/%{shname}.conf |
3f05bde6 MK |
120 | %attr(750,cassandra,cassandra) %dir /var/lib/%{shname} |
121 | %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf | |
087ae4ed MK |
122 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.properties |
123 | %attr(755,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.sh | |
3f05bde6 | 124 | %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt |
087ae4ed | 125 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml |
5422f39a MK |
126 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.xml |
127 | %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/hotspot_compiler | |
128 | %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}/conf/triggers | |
129 | %attr(640,root,cassandra) /var/lib/%{shname}/conf/triggers/*.txt | |
130 | ||
3f05bde6 | 131 | %attr(750,cassandra,cassandra) %dir /var/log/%{shname} |
4e6d3cb2 | 132 | %attr(750,cassandra,cassandra) %dir /var/run/%{shname} |
40bf3751 JR |
133 | %{py3_sitedir}/cqlshlib |
134 | %{py3_sitedir}/cassandra_pylib-0.0.0-py*.egg-info |