cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject git commit: add cqlsh to Debian package
Date Mon, 30 Jan 2012 01:09:20 GMT
Updated Branches:
  refs/heads/trunk 1387d92fc -> 8a5436a2b


add cqlsh to Debian package


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8a5436a2
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8a5436a2
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8a5436a2

Branch: refs/heads/trunk
Commit: 8a5436a2b6378586af8fd19a73c9a5e8398f4a03
Parents: 1387d92
Author: paul cannon <paul@datastax.com>
Authored: Thu Jan 26 00:27:03 2012 -0600
Committer: Eric Evans <eevans@apache.org>
Committed: Sun Jan 29 19:09:34 2012 -0600

----------------------------------------------------------------------
 bin/cqlsh                |   26 ++++++++++++++++++--------
 debian/cassandra.install |    2 ++
 debian/control           |    5 +++--
 debian/rules             |    4 ++++
 pylib/setup.py           |   24 ++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a5436a2/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 6ea8600..74d62f2 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -47,6 +47,7 @@ import optparse
 import ConfigParser
 import codecs
 import re
+import platform
 
 # cqlsh should run correctly when run out of a Cassandra source tree,
 # out of an unpacked Cassandra tarball, and after a proper package install.
@@ -66,16 +67,25 @@ except ImportError:
 CQL_LIB_PREFIX = 'cql-internal-only-'
 THRIFT_LIB_PREFIX = 'thrift-python-internal-only-'
 
-# use bundled libs for python-cql and thrift, if available
-ziplibdir = os.path.join(os.path.dirname(__file__), '..', 'lib')
-cql_zips = glob(os.path.join(ziplibdir, CQL_LIB_PREFIX + '*.zip'))
-if cql_zips:
-    cql_zip = cql_zips[0]
+# use bundled libs for python-cql and thrift, if available. if there
+# is a ../lib dir, use bundled libs there preferentially.
+ZIPLIB_DIRS = [os.path.join(os.path.dirname(__file__), '..', 'lib')]
+myplatform = platform.system()
+if myplatform == 'Linux':
+    ZIPLIB_DIRS.append('/usr/share/cassandra/lib')
+
+def find_zip(libprefix):
+    for ziplibdir in ZIPLIB_DIRS:
+        zips = glob(os.path.join(ziplibdir, libprefix + '*.zip'))
+        if zips:
+            return max(zips)   # probably the highest version, if multiple
+
+cql_zip = find_zip(CQL_LIB_PREFIX)
+if cql_zip:
     ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
     sys.path.insert(0, os.path.join(cql_zip, 'cql-' + ver))
-thrift_zips = glob(os.path.join(ziplibdir, THRIFT_LIB_PREFIX + '*.zip'))
-if thrift_zips:
-    thrift_zip = thrift_zips[0]
+thrift_zip = find_zip(THRIFT_LIB_PREFIX)
+if thrift_zip:
     sys.path.insert(0, thrift_zip)
 
 try:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a5436a2/debian/cassandra.install
----------------------------------------------------------------------
diff --git a/debian/cassandra.install b/debian/cassandra.install
index 214b5db..33ef6c4 100644
--- a/debian/cassandra.install
+++ b/debian/cassandra.install
@@ -11,5 +11,7 @@ bin/json2sstable usr/bin
 bin/sstable2json usr/bin
 bin/sstablekeys usr/bin
 bin/sstableloader usr/bin
+bin/cqlsh usr/bin
 lib/*.jar usr/share/cassandra/lib
+lib/*.zip usr/share/cassandra/lib
 lib/licenses usr/share/doc/cassandra

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a5436a2/debian/control
----------------------------------------------------------------------
diff --git a/debian/control b/debian/control
index 56b76ed..a0a9c7d 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,8 @@ Source: cassandra
 Section: misc
 Priority: extra
 Maintainer: Eric Evans <eevans@apache.org>
-Build-Depends: debhelper (>= 5), openjdk-6-jdk (>= 6b11) | java6-sdk, ant (>= 1.7),
ant-optional (>= 1.7), subversion
+Uploaders: Sylvain Lebresne <slebresne@apache.org>
+Build-Depends: debhelper (>= 5), openjdk-6-jdk (>= 6b11) | java6-sdk, ant (>= 1.7),
ant-optional (>= 1.7), subversion, python-support
 Homepage: http://cassandra.apache.org
 Vcs-Svn: https://svn.apache.org/repos/asf/cassandra/trunk
 Vcs-Browser: http://svn.apache.org/viewvc/cassandra/trunk
@@ -10,7 +11,7 @@ Standards-Version: 3.8.3
 
 Package: cassandra
 Architecture: all
-Depends: openjdk-6-jre-headless (>= 6b11) | java6-runtime, jsvc (>= 1.0), libcommons-daemon-java
(>= 1.0), adduser, libjna-java
+Depends: openjdk-6-jre-headless (>= 6b11) | java6-runtime, jsvc (>= 1.0), libcommons-daemon-java
(>= 1.0), adduser, libjna-java, python (>= 2.5), python-support (>= 0.90.0), ${misc:Depends}
 Conflicts: apache-cassandra1
 Replaces: apache-cassandra1
 Description: distributed storage system for structured data

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a5436a2/debian/rules
----------------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
index 8906701..97e0274 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,6 +18,7 @@ clean:
 	rm -rf bin/java
 	find -name "*.pyc" -exec rm '{}' ';'
 	find -name "*py.class" -exec rm '{}' ';'
+	$(RM) -r pylib/build
 	dh_clean
 
 build: build-stamp
@@ -26,6 +27,8 @@ build-stamp:
 	printf "version=%s" $(VERSION) > build.properties
 
 	$(ANT) jar
+	cd pylib && python setup.py install --no-compile --install-layout deb \
+		--root $(CURDIR)/debian/cassandra
 
 	touch build-stamp
 
@@ -34,6 +37,7 @@ install: build
 	dh_testroot
 	dh_installdirs
 	dh_install
+	dh_pysupport
 
 	# Copy in the jar and symlink to something stable
 	dh_install build/apache-cassandra-$(VERSION).jar \

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8a5436a2/pylib/setup.py
----------------------------------------------------------------------
diff --git a/pylib/setup.py b/pylib/setup.py
new file mode 100755
index 0000000..704d077
--- /dev/null
+++ b/pylib/setup.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from distutils.core import setup
+
+setup(
+    name="cassandra-pylib",
+    description="Cassandra Python Libraries",
+    packages=["cqlshlib"],
+)


Mime
View raw message