diff options
author | Roger Meier <roger@apache.org> | 2013-01-08 23:12:28 +0100 |
---|---|---|
committer | Roger Meier <roger@apache.org> | 2013-01-08 23:12:28 +0100 |
commit | a17265d61588dd53083d34bb1e3621c571a1e562 (patch) | |
tree | e3d12c90184cac6e8351e6de3f1caf419222acf5 /debian/rules | |
parent | 6a9df6e085cde94a38a3c3c0af55c8356267dd23 (diff) | |
download | thrift-a17265d61588dd53083d34bb1e3621c571a1e562.tar.gz |
THRIFT-1825 Debian Packaging: cpp libs no longer included since 0.8
Initial Patch: Marco Matarazzo
Folder move and deletion of contrib/create-debian-packages.sh by roger ;-r
Diffstat (limited to 'debian/rules')
-rwxr-xr-x | debian/rules | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..8995f9c39 --- /dev/null +++ b/debian/rules @@ -0,0 +1,207 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +PYVERS := $(shell pyversions -r) + +configure: configure-stamp +configure-stamp: + dh_testdir + # 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 + + touch configure-stamp + + +#Architecture +build: build-arch build-indep + # Tests disabled + # $(MAKE) -C test check + +build-arch: build-arch-stamp +build-arch-stamp: configure-stamp + + # Compile compiler + $(MAKE) -C $(CURDIR)/compiler/cpp + + # Compile C++ library + $(MAKE) -C $(CURDIR)/lib/cpp + + # Compile C (glib) library + $(MAKE) -C $(CURDIR)/lib/c_glib + + # Python library + cd $(CURDIR)/lib/py && \ + for py in $(PYVERS); do \ + $$py setup.py build; \ + $$py-dbg setup.py build; \ + done + + # PHP + cd $(CURDIR)/lib/php/src/ext/thrift_protocol && \ + phpize && \ + ./configure && make + + touch $@ + +build-indep: build-indep-stamp +build-indep-stamp: configure-stamp + + # Add here commands to compile the indep part of the package. + #$(MAKE) doc + + # Java + cd $(CURDIR)/lib/java && \ + ant + + # C# + $(MAKE) -C $(CURDIR)/lib/csharp + + # Ruby + $(MAKE) -C $(CURDIR)/lib/rb + + # Perl + $(MAKE) -C $(CURDIR)/lib/perl INSTALLDIRS=vendor + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-arch-stamp build-indep-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: install-indep install-arch +install-indep: + dh_testdir + dh_testroot + dh_clean -k -i + dh_installdirs -i + + # Add here commands to install the indep part of the package into + # debian/<package>-doc. + #INSTALLDOC# + + # 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 + mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8 && \ + cp $(CURDIR)/lib/rb/lib/thrift.rb \ + $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8 + cp -r $(CURDIR)/lib/rb/lib/thrift \ + $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8 + 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 + cp -r $(CURDIR)/lib/rb/lib/thrift \ + $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 + + # C# + mkdir -p $(CURDIR)/debian/libthrift-cil/usr/lib/cli/thrift/ && \ + cp $(CURDIR)/lib/csharp/Thrift.dll \ + $(CURDIR)/debian/libthrift-cil/usr/lib/cli/thrift/Thrift.dll + + # Perl + $(MAKE) -C $(CURDIR)/lib/perl install DESTDIR=$(CURDIR)/debian/libthrift-perl/usr + + dh_install -i + +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + + # Add here commands to install the arch part of the package into + # debian/tmp. + #$(MAKE) DESTDIR=$(CURDIR)/debian/thrift install + + # Compiler + mkdir -p $(CURDIR)/debian/thrift-compiler/usr/bin && \ + cp $(CURDIR)/compiler/cpp/thrift \ + $(CURDIR)/debian/thrift-compiler/usr/bin/thrift && \ + rmdir $(CURDIR)/debian/thrift-compiler/usr/sbin + + # 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; \ + done + + find $(CURDIR)/debian/python-thrift-dbg -name "*.pyc" -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 {} \; + + # PHP + mkdir -p $(CURDIR)/debian/php5-thrift + cd $(CURDIR)/lib/php && \ + $(MAKE) DESTDIR=$(CURDIR)/debian/php5-thrift install + + # C++ and C (glib) + mkdir -p $(CURDIR)/debian/tmp; \ + cd $(CURDIR)/lib/cpp && \ + make DESTDIR=$(CURDIR)/debian/tmp install + cd $(CURDIR)/lib/c_glib && \ + make DESTDIR=$(CURDIR)/debian/tmp install + + dh_install --sourcedir=debian/tmp -s + + +# Must not depend on anything. This is to be called by +# binary-arch/binary-indep +# in another 'make' thread. +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip -Npython-thrift-dbg -Nthrift-compiler -Nlibthrift0 --dbg=python-thrift-dbg + dh_strip -Npython-thrift-dbg + dh_compress + dh_fixperms + dh_pysupport + dh_makeshlibs + dh_installdeb + dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + echo "php:Depends=phpapi-$(php-config5 --phpapi)" > debian/substvars + $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure |