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