]> git.pld-linux.org Git - packages/cassandra-bin.git/blob - cassandra-bin.spec
Update to 2.0.11 by Lukasz Gabrych. Enabled cqlsh.
[packages/cassandra-bin.git] / cassandra-bin.spec
1 # TODO: Fix .init cassandra status does not work now.
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)
4 # TODO: Consider adding
5 #               cassandra       -       memlock unlimited
6 #   to /etc/security/limits.conf ?
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:        2.0.11
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:  f8021f9defcdd6957ff78de7c6d5308b
19 Source1:        cassandra.in.sh
20 Source2:        %{shname}.init
21 Source3:        %{name}.tmpfiles
22 Patch0:         %{name}-jamm_path_fix.patch
23 Patch1:         %{name}-cqlsh_path_fix.patch
24 URL:            http://cassandra.apache.org/
25 BuildRequires:  python-distribute
26 BuildRequires:  rpm-javaprov
27 BuildRequires:  rpm-pythonprov
28 BuildRequires:  rpmbuild(macros) >= 1.300
29 Requires(post,preun):   /sbin/chkconfig
30 Requires:       python-modules
31 Requires:       rc-scripts
32 Suggests:       java-jna
33 BuildArch:      noarch
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %description
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.
41
42 %description -l pl.UTF-8
43 Cassandra łączy technologie systemów rozproszonych z Dynamo i model
44 danych z googlowskiego BigTable. Tak jak Dynamo, Cassandra jest
45 ostatecznie spójna. Tak jak BigTable daje do dyspozycji model danych
46 oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości.
47
48 %prep
49 %setup -q -n apache-cassandra-%{version}
50 %patch0 -p1
51 %patch1 -p1
52
53 %build
54 # current version of cqlsh supports only python 2.
55 cd pylib
56 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
57 cd ..
58
59 %install
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d/,%{_sysconfdir}/%{shname},%{_bindir},%{_sbindir},%{_datadir}/%{shname}} \
62         $RPM_BUILD_ROOT/var/{lib/%{shname}/{commitlog,conf,data,saved_caches},{log,run}/%{shname}} \
63         $RPM_BUILD_ROOT%{systemdtmpfilesdir}
64
65 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cassandra
66
67 rm bin/*.bat
68 cp -p bin/{cqlsh,*sstable*,*tool,cassandra-cli} $RPM_BUILD_ROOT%{_bindir}
69 cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir}
70 cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname}
71 # use bundled libs for python-cql - from cqlsh doc
72 cp -p %{SOURCE1} lib/cql-internal-only-1.4.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
73 cp -p %{SOURCE1} lib/thrift-python-internal-only-0.9.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
74 cp -p conf/{*.properties,cassandra-env.sh,cassandra.yaml,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf
75
76 install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf
77
78 cd pylib
79 %{__python} setup.py \
80         build --build-base build-2 \
81         install --skip-build \
82         --optimize=2 \
83         --root=$RPM_BUILD_ROOT
84 cd ..
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %pre
90 %groupadd -g 259 -r cassandra
91 %useradd -M -o -r -u 259 -d /var/lib/%{shname} -s /bin/sh -g cassandra -c "Cassandra Server" cassandra
92
93 %post
94 /sbin/chkconfig --add cassandra
95 %service cassandra restart
96
97 %preun
98 if [ "$1" = "0" ]; then
99         %service cassandra stop
100         /sbin/chkconfig --del cassandra
101 fi
102
103 %files
104 %defattr(644,root,root,755)
105 %doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt
106 %attr(754,root,root) /etc/rc.d/init.d/cassandra
107 %attr(755,root,root) %{_bindir}/cassandra-cli
108 %attr(755,root,root) %{_bindir}/cqlsh
109 %attr(755,root,root) %{_bindir}/nodetool
110 %attr(755,root,root) %{_bindir}/json2sstable
111 %attr(755,root,root) %{_bindir}/sstable2json
112 %attr(755,root,root) %{_bindir}/sstablescrub
113 %attr(755,root,root) %{_bindir}/sstablekeys
114 %attr(755,root,root) %{_bindir}/sstableloader
115 %attr(755,root,root) %{_bindir}/sstablesplit
116 %attr(755,root,root) %{_bindir}/sstableupgrade
117 %attr(755,root,root) %{_sbindir}/cassandra
118 %{_datadir}/%{shname}
119 %{systemdtmpfilesdir}/%{shname}.conf
120 %attr(750,cassandra,cassandra) %dir /var/lib/%{shname}
121 %attr(750,root,cassandra) %dir /var/lib/%{shname}/conf
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
124 %attr(640,root,cassandra) /var/lib/%{shname}/conf/*.txt
125 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml
126 %attr(750,cassandra,cassandra) %dir /var/log/%{shname}
127 %attr(750,cassandra,cassandra) %dir /var/run/%{shname}
128 %{py_sitescriptdir}/cqlshlib
129 %if "%{py_ver}" > "2.4"
130         %{py_sitescriptdir}/cassandra_pylib-0.0.0-py*.egg-info
131 %endif
This page took 0.138062 seconds and 3 git commands to generate.