You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/03/29 19:48:38 UTC

[4/9] thrift git commit: THRIFT-3760 Fix install paths etc of debian packages for py and perl

THRIFT-3760 Fix install paths etc of debian packages for py and perl

This closes #965


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/93bbdc81
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/93bbdc81
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/93bbdc81

Branch: refs/heads/master
Commit: 93bbdc8127cb6ebdd34350fbba1b3a0a4e8e4111
Parents: 06340a4
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Fri Mar 25 08:51:09 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 debian/control   |  2 +-
 debian/rules     | 38 +++++++++++++++++++++++---------------
 debian/substvars |  2 +-
 3 files changed, 25 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/93bbdc81/debian/control
----------------------------------------------------------------------
diff --git a/debian/control b/debian/control
index be5209c..c1d478f 100644
--- a/debian/control
+++ b/debian/control
@@ -30,7 +30,7 @@ Package: python-thrift
 Architecture: any
 Section: python
 Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-six
-Recommends: python-twisted-web
+Recommends: python-twisted-web, python-backports.ssl-match-hostname, python-ipaddress
 Provides: ${python:Provides}
 Description: Python bindings for Thrift
  Thrift is a software framework for scalable cross-language services

http://git-wip-us.apache.org/repos/asf/thrift/blob/93bbdc81/debian/rules
----------------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
index 2441a4c..dcd2b0b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -29,7 +29,7 @@ configure-stamp:
 
 	# Add here commands to configure the package.
 	if [ -f bootstrap.sh ]; then $(CURDIR)/bootstrap.sh; fi
-	$(CURDIR)/configure --prefix=/usr --with-c_glib --without-erlang
+	$(CURDIR)/configure --prefix=/usr
 
 	touch configure-stamp
 
@@ -40,7 +40,7 @@ build: build-arch build-indep
 	# $(MAKE) -C test check
 
 build-arch: build-arch-stamp
-build-arch-stamp: configure-stamp
+$(CURDIR)/compiler/cpp/thrift build-arch-stamp: configure-stamp
 
 	# Compile compiler
 	$(MAKE) -C $(CURDIR)/compiler/cpp
@@ -61,12 +61,12 @@ build-arch-stamp: configure-stamp
 	# PHP
 	cd $(CURDIR)/lib/php/src/ext/thrift_protocol && \
 		phpize && \
-		./configure && make
+		./configure && $(MAKE)
 
 	touch $@
 
 build-indep: build-indep-stamp
-build-indep-stamp: configure-stamp
+build-indep-stamp: configure-stamp $(CURDIR)/compiler/cpp/thrift
 
 	# Add here commands to compile the indep part of the package.
 	#$(MAKE) doc
@@ -91,6 +91,8 @@ clean:
 	dh_testroot
 	rm -f build-arch-stamp build-indep-stamp configure-stamp
 
+	cd $(CURDIR)/lib/py && python setup.py clean --all
+
 	# Add here commands to clean up after the build process.
 	-$(MAKE) clean
 
@@ -107,12 +109,12 @@ install-indep:
 	# debian/<package>-doc.
 	#INSTALLDOC#
 
-        # Java
+	# Java
 	mkdir -p $(CURDIR)/debian/libthrift-java/usr/share/java/ && \
 	cp $(CURDIR)/lib/java/build/libthrift*.jar \
 		$(CURDIR)/debian/libthrift-java/usr/share/java/
 
-        # Ruby
+	# Ruby
 	mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 && \
 	cp $(CURDIR)/lib/rb/lib/thrift.rb \
 		$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1
@@ -125,7 +127,10 @@ install-indep:
 		$(CURDIR)/debian/libthrift-cil/usr/lib/cli/thrift/Thrift.dll
 
 	# Perl
-	$(MAKE) -C $(CURDIR)/lib/perl install DESTDIR=$(CURDIR)/debian/libthrift-perl/usr
+	$(MAKE) -C $(CURDIR)/lib/perl install DESTDIR=$(CURDIR)/debian/libthrift-perl
+	mv $(CURDIR)/debian/libthrift-perl/usr/local/lib/perl5 $(CURDIR)/debian/libthrift-perl/usr/lib
+	rmdir $(CURDIR)/debian/libthrift-perl/usr/local/lib
+	rmdir $(CURDIR)/debian/libthrift-perl/usr/local
 
 	dh_install -i
 
@@ -148,11 +153,14 @@ install-arch:
 	# Python
 	cd $(CURDIR)/lib/py && \
 	for py in $(PYVERS); do \
-		$$py setup.py install --no-compile --root=$(CURDIR)/debian/python-thrift; \
-		$$py-dbg setup.py install --no-compile --root=$(CURDIR)/debian/python-thrift-dbg; \
+		$$py setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift; \
+		$$py-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift-dbg; \
 	done
 
-	find $(CURDIR)/debian/python-thrift-dbg -name "*.pyc" -print0 | xargs -0 rm -f
+	find $(CURDIR)/debian/python-thrift -name "*.py[co]" -print0 | xargs -0 rm -f
+	find $(CURDIR)/debian/python-thrift -name "__pycache__" -print0 | xargs -0 rm -fr
+	find $(CURDIR)/debian/python-thrift-dbg -name "__pycache__" -print0 | xargs -0 rm -fr
+	find $(CURDIR)/debian/python-thrift-dbg -name "*.py[co]" -print0 | xargs -0 rm -f
 	find $(CURDIR)/debian/python-thrift-dbg -name "*.py" -print0 | xargs -0 rm -f
 	find $(CURDIR)/debian/python-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf
 	find $(CURDIR)/debian/python-thrift-dbg -depth -type d -empty -exec rmdir {} \;
@@ -165,9 +173,9 @@ install-arch:
 	# C++ and C (glib)
 	mkdir -p $(CURDIR)/debian/tmp; \
 	cd $(CURDIR)/lib/cpp && \
-		make DESTDIR=$(CURDIR)/debian/tmp install
+		$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
 	cd $(CURDIR)/lib/c_glib && \
-		make DESTDIR=$(CURDIR)/debian/tmp install
+		$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
 
 	dh_install --sourcedir=debian/tmp -s
 
@@ -183,8 +191,8 @@ binary-common:
 	dh_installexamples
 	dh_installman
 	dh_link
-	dh_strip -Npython-thrift-dbg -Nthrift-compiler -Nlibthrift0 --dbg=python-thrift-dbg
-	dh_strip -Npython-thrift-dbg
+	dh_strip -ppython-thrift --dbg=python-thrift-dbg
+	dh_strip -pthrift-compiler -plibthrift0
 	dh_compress
 	dh_fixperms
 	dh_makeshlibs
@@ -200,7 +208,7 @@ binary-indep: build-indep install-indep
 
 # Build architecture dependent packages using the common target.
 binary-arch: build-arch install-arch
-	echo "php:Depends=phpapi-$(php-config5 --phpapi)" > debian/substvars
+	echo "php:Depends=phpapi-$(shell php-config5 --phpapi)" > $(CURDIR)/debian/substvars
 	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
 
 binary: binary-arch binary-indep

http://git-wip-us.apache.org/repos/asf/thrift/blob/93bbdc81/debian/substvars
----------------------------------------------------------------------
diff --git a/debian/substvars b/debian/substvars
index badf572..9841f2d 100644
--- a/debian/substvars
+++ b/debian/substvars
@@ -1 +1 @@
-php:Depends=phpapi-
+php:Depends=phpapi-20121212