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