#!/usr/bin/make -f DEB_PYTHON_SYSTEM = pysupport include /usr/share/cdbs/1/rules/patchsys-quilt.mk include ./debian/python-autotools.mk include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk -include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk DEB_COMPRESS_EXCLUDE = .py .glade DEB_MAKE_CHECK_TARGET = check DEB_CONFIGURE_EXTRA_FLAGS += --enable-thread DEB_PYTHON_PRIVATE_MODULES_DIRS_python-gtk2-doc = /usr/share/pygtk # FIXME: make hardcoded to break the loop... build-%/check-stamp: MAKE = xvfb-run -s "-screen 0 1280x1024x24 -noreset" make dbg-build-%/check-stamp: MAKE = xvfb-run -s "-screen 0 1280x1024x24 -noreset" make $(patsubst %,build-%/install-stamp,$(PYVERS)) :: build-%/install-stamp: # FIXME: move some of this stuff to python-autotools.mk? # move installed files to a per python runtime location to allow # comparison of the resulting files across runtimes or shipping # multiple versions # pkg-config file (this is shipped twice because of varying pyexecdir) mkdir debian/tmp/usr/lib/pkgconfig/python$* mv debian/tmp/usr/lib/pkgconfig/*.pc debian/tmp/usr/lib/pkgconfig/python$* # defs files, should be the same whatever the build-time python runtime mkdir debian/tmp/usr/share/pygtk/2.0/defs/python$* mv debian/tmp/usr/share/pygtk/2.0/defs/*.defs debian/tmp/usr/share/pygtk/2.0/defs/python$* # headers, should be the same whatever the build-time python runtime mkdir debian/tmp/usr/include/python$* mv debian/tmp/usr/include/pygtk-2.0 debian/tmp/usr/include/python$* install-stamp:: # check that all builds with various Python runtimes produced the same # *.defs files (or fail) for v in $(PYVERS); do \ echo "Comparing defs files for the default Python version ($(PYDEFAULTVER)) with defs files for Python $$v"; \ diff --brief --recursive debian/tmp/usr/share/pygtk/2.0/defs/python$(PYDEFAULTVER) debian/tmp/usr/share/pygtk/2.0/defs/python$$v; \ echo "Comparing headers for the default Python version ($(PYDEFAULTVER)) with headers for Python $$v"; \ diff --brief --recursive debian/tmp/usr/include/python$(PYDEFAULTVER) debian/tmp/usr/include/python$$v; \ done # since all Python runtimes produced the same files, only keep one set echo "Cleaning up" mv debian/tmp/usr/share/pygtk/2.0/defs/python$(PYDEFAULTVER)/*.defs debian/tmp/usr/share/pygtk/2.0/defs mv debian/tmp/usr/include/python$(PYDEFAULTVER)/* debian/tmp/usr/include for v in $(PYVERS); do \ rm --force --recursive debian/tmp/usr/share/pygtk/2.0/defs/python$$v; \ rm --force --recursive debian/tmp/usr/include/python$$v; \ done # finally, install files from DESTDIR in the per-package dirs dh_install # install rtupdate script to handle Python default runtime change install -d debian/python-gtk2-dev/usr/share/python/runtime.d install debian/python-gtk2-dev.rtupdate debian/python-gtk2-dev/usr/share/python/runtime.d clean:: rm -f tests/*.pyc binary-install/python-gtk2-doc:: find debian/python-gtk2-doc/usr/share/doc -name '*.py[co]' -delete binary-install/python-gtk2-dev:: grep -rlZ "^#\!.*python" debian/python-gtk2-dev/usr | xargs -0r chmod 755 binary-install/python-gtk2-dbg:: rm -rf debian/python-gtk2-dbg/usr/share/doc/python-gtk2-dbg ln -s python-gtk2 debian/python-gtk2-dbg/usr/share/doc/python-gtk2-dbg