diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-10 16:16:32 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-10 16:16:32 -0500 |
commit | 02dc85a95b228b7242b0d11ea35619faad96db03 (patch) | |
tree | e161ba877a0720bbdf7818bdec06eb239d8ad271 /ubuntu/precise/dependencies/python-tqt/debian/rules | |
parent | 6f2c7dc70e77d2f768d687838b6cc9f7632f609e (diff) | |
download | tde-packaging-02dc85a95b228b7242b0d11ea35619faad96db03.tar.gz tde-packaging-02dc85a95b228b7242b0d11ea35619faad96db03.zip |
Split precise from maverick
Diffstat (limited to 'ubuntu/precise/dependencies/python-tqt/debian/rules')
-rwxr-xr-x | ubuntu/precise/dependencies/python-tqt/debian/rules | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/ubuntu/precise/dependencies/python-tqt/debian/rules b/ubuntu/precise/dependencies/python-tqt/debian/rules new file mode 100755 index 000000000..ebb91c6e4 --- /dev/null +++ b/ubuntu/precise/dependencies/python-tqt/debian/rules @@ -0,0 +1,172 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export DH_OPTIONS + +-include /usr/share/python/python.mk +ifeq (,$(py_sitename)) +py_sitename = site-packages +py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages +py_sitename_sh = $(py_sitename) +py_libdir_sh = $(py_libdir) +endif + + +DOC=$(CURDIR)/debian/python-tqt-doc/usr/share/doc/python-tqt-doc +INSTDIR=$(CURDIR)/debian + +export QTDIR=/usr/share/tqt3 +export QMAKESPEC=$(QTDIR)/mkspecs/linux-g++ + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CXXFLAGS += -O0 +else + CXXFLAGS += -O1 +endif +CXXFLAGS += "-I/usr/include/tqt" + +PYTHONS := $(shell pyversions -vr debian/control) + + +GCCVER := $(shell gcc --version | sed -n '/^gcc (GCC)/s/.*(GCC) \(...\).*/\1/p') +ifneq (,$(filter $(GCCVER),4.2 4.3)) + SPLIT=40 +else + SPLIT=10 +endif + +.PRECIOUS: build-%/configure-stamp dbg-build-%/configure-stamp + +configure: $(PYTHONS:%=build-%/configure-stamp) $(PYTHONS:%=dbg-build-%/configure-stamp) +build-%/configure-stamp: + dh_testdir + mkdir -p build-$* + cd build-$* && echo yes \ + | python$* ../configure.py \ + -c -n /usr/include/tqscintilla \ + -o /usr/lib -u -j $(SPLIT) \ + -d /usr/lib/python$*/$(call py_sitename,$*) \ + -l /usr/include/python$* \ + -v /usr/share/sip/tqt \ + -m /usr/lib/python$*/config \ + CXXFLAGS_RELEASE="" CXXFLAGS="${CXXFLAGS}" STRIP="" + touch $@ + +dbg-build-%/configure-stamp: + dh_testdir + mkdir -p dbg-build-$* + cd dbg-build-$* && echo yes \ + | python$*-dbg ../configure.py \ + -c -n /usr/include/tqscintilla \ + -o /usr/lib -u -j $(SPLIT) \ + -d /usr/lib/python$*/$(call py_sitename,$*) \ + -l /usr/include/python$*_d \ + -v /usr/share/sip/tqt \ + -m /usr/lib/python$*/config_d \ + CXXFLAGS_RELEASE="" CXXFLAGS="-O0 -g -I/usr/include/tqt" STRIP="" + touch $@ + +build: $(PYTHONS:%=build-%/build-stamp) $(PYTHONS:%=dbg-build-%/build-stamp) + +build-%/build-stamp: build-%/configure-stamp + dh_testdir + $(MAKE) -C build-$* + touch $@ + +dbg-build-%/build-stamp: dbg-build-%/configure-stamp + dh_testdir + $(MAKE) -C dbg-build-$* + touch $@ + +install-indep: configure + dh_testdir + dh_testroot + dh_clean -k -i + dh_installdirs -i + for version in ${PYTHONS}; do\ + pylib=$$(python$$version -c 'from distutils import sysconfig; print sysconfig.get_python_lib()'); \ + mkdir -p debian/python-tqt-dev/$$pylib;\ + install -m 644 -o root -g root build-$$version/pyqtconfig.py debian/python-tqt-dev/$$pylib;\ + done + dh_install -i + +install-arch: build + dh_testdir + dh_testroot + dh_clean -k -a + dh_installdirs -a + for version in ${PYTHONS}; do \ + $(MAKE) -C build-$$version install DESTDIR=$(CURDIR)/debian/tmp;\ + done + for version in ${PYTHONS}; do \ + pylib=$$(python$$version -c 'from distutils import sysconfig; print sysconfig.get_python_lib()'); \ + $(MAKE) -C dbg-build-$$version install DESTDIR=$(CURDIR)/debian/python-tqt-dbg;\ + mkdir -p debian/python-tqt-gl-dbg/$$pylib;\ + mv debian/python-tqt-dbg/$$pylib/qtgl.so \ + debian/python-tqt-gl-dbg/$$pylib/;\ + mkdir -p debian/python-tqtext-dbg/$$pylib;\ + mv debian/python-tqt-dbg/$$pylib/qtext.so \ + debian/python-tqtext-dbg/$$pylib/;\ + done + + dh_install -a --sourcedir=$(CURDIR)/debian/tmp + + for i in $$(find debian/python-*-dbg -name '*.so'); do \ + b=$$(basename $$i .so); \ + mv $$i $$(dirname $$i)/$${b}_d.so; \ + done + find debian/python-*-dbg ! -type d \ + ! \( -name '*.so' -o -name '*config_d.py' \) | xargs rm -f + find debian/python-*-dbg -depth -type d -empty -exec rmdir {} \; + +clean: + dh_testdir + dh_testroot + rm -rf $(PYTHONS:%=build-%) $(PYTHONS:%=dbg-build-%) + rm -f *-stamp + dh_clean + +# 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_installman + dh_installchangelogs ChangeLog + dh_installdocs -A NEWS THANKS + dh_installexamples + dh_link +ifeq (,$(findstring -i, $(DH_OPTIONS))) + DH_OPTIONS= dh_strip -ppytqt-tools + set -e; \ + for p in python-tqt python-tqt-gl python-tqtext; do \ + DH_OPTIONS= dh_strip -p$$p --dbg-package=$$p-dbg; \ + rm -rf debian/$$p-dbg/usr/share/doc/$$p-dbg; \ + ln -s $$p debian/$$p-dbg/usr/share/doc/$$p-dbg; \ + done +endif +# dh_strip + dh_compress -X.py -X.bmp -X.ui -X.sql + dh_fixperms + dh_pysupport + dh_sip + dh_lintian + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture independant packages using the common target. +binary-indep: install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary configure |