summaryrefslogtreecommitdiffstats
path: root/ubuntu/_base/dependencies/sip4-tqt/debian/rules
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-04-03 22:56:40 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-04-03 22:56:40 +0900
commit11394aecd1f906fee2ebd2b90412aeba4651fbff (patch)
treebcf750380e6d9fc7dbe524e16bbe2afde25dcfa0 /ubuntu/_base/dependencies/sip4-tqt/debian/rules
parentd24bd898174453b586ac90f2ef7a60165fa26fde (diff)
downloadtde-packaging-11394aecd1f906fee2ebd2b90412aeba4651fbff.tar.gz
tde-packaging-11394aecd1f906fee2ebd2b90412aeba4651fbff.zip
DEB: use _base folder for a distro instead of specific distros (squeeze
and maverick). Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'ubuntu/_base/dependencies/sip4-tqt/debian/rules')
-rwxr-xr-xubuntu/_base/dependencies/sip4-tqt/debian/rules171
1 files changed, 171 insertions, 0 deletions
diff --git a/ubuntu/_base/dependencies/sip4-tqt/debian/rules b/ubuntu/_base/dependencies/sip4-tqt/debian/rules
new file mode 100755
index 000000000..86a541601
--- /dev/null
+++ b/ubuntu/_base/dependencies/sip4-tqt/debian/rules
@@ -0,0 +1,171 @@
+#!/usr/bin/make -f
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DEB_DH_BUILDDEB_ARGS += -- -Z$(shell dpkg-deb --help | grep -q ":.* xz[,.]" \
+ && echo xz || echo bzip2)
+
+export DH_OPTIONS
+
+INSTDIR=$(CURDIR)/debian
+
+CFLAGS=
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0 -g
+else
+ CFLAGS += -O2 -g
+endif
+
+PYTHONS := $(shell pyversions -vr debian/control)
+
+DEB_PYTHON_SYSTEM = $(if $(wildcard /usr/bin/dh_python2),,pysupport)
+DH_PYTHON2 = $(if $(wildcard /usr/bin/dh_python2),dh_python2,dh_pysupport)
+
+-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
+
+
+.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-$* \
+ && python$* ../configure.py \
+ -d /usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt \
+ -g python$* \
+ -u STRIP="" CFLAGS="${CFLAGS} -I/usr/include/tqt -I/usr/include/tqt3 -I/usr/include/qt3" CFLAGS_RELEASE="" CXXFLAGS="${CFLAGS} -I/usr/include/tqt -I/usr/include/tqt3 -I/usr/include/qt3" CXXFLAGS_RELEASE=""
+ touch $@
+
+dbg-build-%/configure-stamp:
+ dh_testdir
+ mkdir -p dbg-build-$*
+ cd dbg-build-$* \
+ && python$*-dbg ../configure.py \
+ -d /usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt \
+ -g python$* \
+ -e /usr/include/python$*_d \
+ -u CFLAGS="-O0 -g -I/usr/include/tqt -I/usr/include/tqt3 -I/usr/include/qt3" CFLAGS_RELEASE="" CXXFLAGS="-O0 -g -I/usr/include/tqt -I/usr/include/tqt3 -I/usr/include/qt3" CXXFLAGS_RELEASE="" 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 $@
+
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -rf *-stamp siputils.pyc $(PYTHONS:%=build-%) $(PYTHONS:%=dbg-build-%)
+ dh_clean
+
+install-arch: build
+ dh_testdir
+ dh_testroot
+ dh_prep -a
+ dh_installdirs -a
+ # This is needed to enforce that the install-arch-% rules are
+ # not run in parallel. Both rules install into the same directory,
+ # and therefore might try to access the same files at the same time.
+ # Therefore, instead of depending on the install-arch-% rules,
+ # we invoke them explicitly.
+ for p in $(PYTHONS) ; do \
+ $(MAKE) -f debian/rules install-arch-$$p;\
+ done
+
+ for i in $$(find debian/python-sip-tqt-dbg -name '*.so'); do \
+ b=$$(basename $$i .so); \
+ mv $$i $$(dirname $$i)/$${b}_d.so; \
+ done
+ find debian/python-sip-tqt-dbg ! -type d ! -name '*_d.*' | xargs rm -f
+ find debian/python-sip-tqt-dbg -depth -empty -exec rmdir {} \;
+
+ dh_install -a --sourcedir=$(CURDIR)/debian/tmp
+ install -m 755 -o root -g root debian/dh_sip_tqt debian/python-sip-tqt-dev/usr/bin
+
+install-arch-%:
+ $(MAKE) -C build-$* install DESTDIR=$(CURDIR)/debian/tmp
+ $(MAKE) -C dbg-build-$* install DESTDIR=$(CURDIR)/debian/python-sip-tqt-dbg
+ mkdir -p debian/python-sip-tqt/usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt/
+ touch debian/python-sip-tqt/usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt/__init__.py
+ install -m 644 -o root -g root debian/sipconfig.py debian/python-sip-tqt/usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt/
+ install -m 644 -o root -g root build-$*/sipconfig.py debian/python-sip-tqt/usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt/sipconfig_nd.py
+ifneq (dh_pysupport,${DH_PYTHON2})
+ # install *_d.py into wrong package to prevent deletion in dh_python2
+ install -m 644 -o root -g root dbg-build-$*/sipconfig.py debian/python-sip-tqt/usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt/sipconfig_d.py
+else
+ install -m 644 -o root -g root dbg-build-$*/sipconfig.py debian/python-sip-tqt-dbg/usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt/sipconfig_d.py
+endif
+ mkdir -p debian/python-sip-tqt-dev/usr/include/python$*
+ install -m 644 -o root -g root siplib/sip.h debian/python-sip-tqt-dev/usr/include/python$*/
+ mkdir -p debian/python-sip-tqt-dev/usr/include/python$*_d
+ ln -s ../python$*/sip.h \
+ debian/python-sip-tqt-dev/usr/include/python$*_d/sip.h
+ mkdir -p debian/python-sip-tqt-dev/usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt
+ install -m 644 -o root -g root sipdistutils.py debian/python-sip-tqt-dev/usr/lib/python$*/$(call py_sitename,$*)/sip4_tqt
+
+
+# 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
+ dh_installdocs -A
+ dh_installexamples
+ dh_link
+# don't call strip twice, it's in binary-common
+ifneq (,$(findstring -a, $(DH_OPTIONS)))
+ DH_OPTIONS= dh_strip -ppython-sip-tqt-dev
+ DH_OPTIONS= dh_strip -ppython-sip-tqt -Npython-sip-tqt-dev --dbg-package=python-sip-tqt-dbg
+ rm -rf debian/python-sip-tqt-dbg/usr/share/doc/python-sip-tqt-dbg
+ mkdir -p debian/python-sip-tqt-dbg/usr/share/doc
+ ln -s python-sip-tqt debian/python-sip-tqt-dbg/usr/share/doc/python-sip-tqt-dbg
+endif
+ dh_compress
+ dh_fixperms
+ ${DH_PYTHON2}
+ifneq (dh_pysupport,${DH_PYTHON2})
+ # move *_d.py back into right package
+ find debian/python-sip-tqt -name "*_d.py" | \
+ while read f; do \
+ f1="debian/python-sip-tqt-dbg/$${f#debian/python-sip-tqt/}"; \
+ mkdir -p "$${f1%/*}"; \
+ mv "$${f}" "$${f1}" ; \
+ done
+endif
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb $(DEB_DH_BUILDDEB_ARGS)
+
+# Build architecture independant packages using the common target.
+binary-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