[packages/cassandra-bin] Update to 2.0.11 by Lukasz Gabrych. Enabled cqlsh.

matkor matkor at pld-linux.org
Tue Jan 13 13:34:59 CET 2015


commit 93a9c726d6cc8d62bd66bca99b5f2a979aa582fc
Author: Mateusz Korniak <matkor at pld-linux.org>
Date:   Tue Jan 13 12:30:49 2015 +0100

    Update to 2.0.11 by Lukasz Gabrych. Enabled cqlsh.

 cassandra-bin-cqlsh_path_fix.patch | 11 +++++++++++
 cassandra-bin-jamm_path_fix.patch  | 20 ++++++++++----------
 cassandra-bin.spec                 | 37 +++++++++++++++++++++++++++++++++----
 3 files changed, 54 insertions(+), 14 deletions(-)
---
diff --git a/cassandra-bin.spec b/cassandra-bin.spec
index 738beb3..82f3c9b 100644
--- a/cassandra-bin.spec
+++ b/cassandra-bin.spec
@@ -10,20 +10,24 @@
 Summary:	Cassandra database binary package
 Summary(pl.UTF-8):	Binarna redystrybucja bazy danych Cassandra
 Name:		cassandra-bin
-Version:	2.0.6
+Version:	2.0.11
 Release:	1
 License:	ASF
 Group:		Applications/Databases
 Source0:	ftp://ftp.task.gda.pl/pub/www/apache/dist/cassandra/%{version}/apache-cassandra-%{version}-bin.tar.gz
-# Source0-md5:	c8da1f4f546ea31ab85cfb236374863b
+# Source0-md5:  f8021f9defcdd6957ff78de7c6d5308b
 Source1:	cassandra.in.sh
 Source2:	%{shname}.init
 Source3:	%{name}.tmpfiles
 Patch0:		%{name}-jamm_path_fix.patch
+Patch1:		%{name}-cqlsh_path_fix.patch
 URL:		http://cassandra.apache.org/
+BuildRequires:  python-distribute
 BuildRequires:	rpm-javaprov
+BuildRequires:  rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.300
 Requires(post,preun):	/sbin/chkconfig
+Requires:       python-modules
 Requires:	rc-scripts
 Suggests:	java-jna
 BuildArch:	noarch
@@ -44,6 +48,13 @@ oparty na ColumnFamily, bogatszy niż typowe systemy klucza i wartości.
 %prep
 %setup -q -n apache-cassandra-%{version}
 %patch0 -p1
+%patch1 -p1
+
+%build
+# current version of cqlsh supports only python 2.
+cd pylib
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+cd ..
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -52,13 +63,26 @@ install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d/,%{_sysconfdir}/%{shname},%{_bindir}
 	$RPM_BUILD_ROOT%{systemdtmpfilesdir}
 
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cassandra
-cp -p bin/{*sstable*,*tool,cassandra-cli} $RPM_BUILD_ROOT%{_bindir}
+
+rm bin/*.bat
+cp -p bin/{cqlsh,*sstable*,*tool,cassandra-cli} $RPM_BUILD_ROOT%{_bindir}
 cp -p bin/cassandra $RPM_BUILD_ROOT%{_sbindir}
 cp -p %{SOURCE1} lib/*.jar $RPM_BUILD_ROOT%{_datadir}/%{shname}
+# use bundled libs for python-cql - from cqlsh doc
+cp -p %{SOURCE1} lib/cql-internal-only-1.4.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
+cp -p %{SOURCE1} lib/thrift-python-internal-only-0.9.1.zip $RPM_BUILD_ROOT%{_datadir}/%{shname}
 cp -p conf/{*.properties,cassandra-env.sh,cassandra.yaml,README.txt} $RPM_BUILD_ROOT/var/lib/%{shname}/conf
 
 install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{shname}.conf
 
+cd pylib
+%{__python} setup.py \
+        build --build-base build-2 \
+        install --skip-build \
+        --optimize=2 \
+        --root=$RPM_BUILD_ROOT
+cd ..
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -78,9 +102,10 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc CHANGES.txt LICENSE.txt README.txt NEWS.txt NOTICE.txt
+%doc CHANGES.txt LICENSE.txt NEWS.txt NOTICE.txt
 %attr(754,root,root) /etc/rc.d/init.d/cassandra
 %attr(755,root,root) %{_bindir}/cassandra-cli
+%attr(755,root,root) %{_bindir}/cqlsh
 %attr(755,root,root) %{_bindir}/nodetool
 %attr(755,root,root) %{_bindir}/json2sstable
 %attr(755,root,root) %{_bindir}/sstable2json
@@ -100,3 +125,7 @@ fi
 %attr(640,root,cassandra) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{shname}/conf/*.yaml
 %attr(750,cassandra,cassandra) %dir /var/log/%{shname}
 %attr(750,cassandra,cassandra) %dir /var/run/%{shname}
+%{py_sitescriptdir}/cqlshlib
+%if "%{py_ver}" > "2.4"
+	%{py_sitescriptdir}/cassandra_pylib-0.0.0-py*.egg-info
+%endif
diff --git a/cassandra-bin-cqlsh_path_fix.patch b/cassandra-bin-cqlsh_path_fix.patch
new file mode 100644
index 0000000..991cf3d
--- /dev/null
+++ b/cassandra-bin-cqlsh_path_fix.patch
@@ -0,0 +1,11 @@
+--- ./bin/cqlsh.patch_fix	2014-10-21 16:31:37.000000000 +0200
++++ ./bin/cqlsh	2015-01-12 23:25:27.805713525 +0100
+@@ -74,7 +74,7 @@ CASSANDRA_PATH = os.path.join(os.path.di
+ ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')]
+ myplatform = platform.system()
+ if myplatform == 'Linux':
+-    ZIPLIB_DIRS.append('/usr/share/cassandra/lib')
++    ZIPLIB_DIRS.append('/usr/share/cassandra')
+ 
+ if os.environ.get('CQLSH_NO_BUNDLED', ''):
+     ZIPLIB_DIRS = ()
diff --git a/cassandra-bin-jamm_path_fix.patch b/cassandra-bin-jamm_path_fix.patch
index 6b834fd..af1b9cc 100644
--- a/cassandra-bin-jamm_path_fix.patch
+++ b/cassandra-bin-jamm_path_fix.patch
@@ -1,11 +1,11 @@
---- ./conf/cassandra-env.sh.jamm_path_fix	2012-05-16 10:11:38.016189136 +0200
-+++ ./conf/cassandra-env.sh	2012-05-16 10:12:25.489984266 +0200
-@@ -121,7 +121,7 @@ JVM_OPTS="$JVM_OPTS -ea"
- check_openjdk=`"${JAVA:-java}" -version 2>&1 | awk '{if (NR == 2) {print $1}}'`
- if [ "$check_openjdk" != "OpenJDK" ]
- then
--    JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar"
-+    JVM_OPTS="$JVM_OPTS -javaagent:/usr/share/cassandra/jamm-0.2.5.jar"
- fi
+--- ./conf/cassandra-env.sh.jamm_path_fix	2014-10-21 16:31:37.000000000 +0200
++++ ./conf/cassandra-env.sh	2015-01-12 21:31:40.086273885 +0100
+@@ -168,7 +168,7 @@ JMX_PORT="7199"
+ JVM_OPTS="$JVM_OPTS -ea"
  
- # enable thread priorities, primarily so we can give periodic tasks
+ # add the jamm javaagent
+-JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar"
++JVM_OPTS="$JVM_OPTS -javaagent:/usr/share/cassandra/jamm-0.2.5.jar"
+ 
+ # some JVMs will fill up their heap when accessed via JMX, see CASSANDRA-6541
+ JVM_OPTS="$JVM_OPTS -XX:+CMSClassUnloadingEnabled"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cassandra-bin.git/commitdiff/93a9c726d6cc8d62bd66bca99b5f2a979aa582fc



More information about the pld-cvs-commit mailing list