diff options
Diffstat (limited to 'debian/rules')
-rwxr-xr-x | debian/rules | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/debian/rules b/debian/rules index df0276d..2639704 100755 --- a/debian/rules +++ b/debian/rules @@ -3,6 +3,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +# The versions of python currently supported +PYVERS=$(subst -dev,,$(subst python,,$(filter python%-dev,$(shell sed -n '/^Build-Depends/s/,//gp' debian/control)))) + WORKAROUND_REMOVED_FILES=include/libxml/xmlversion.h libxml2.spec python/setup.py doc/xmlcatalog.1 WORKAROUND_MODIFIED_FILES=python/libxml2-py.c @@ -24,21 +27,25 @@ build-stamp: done # ./configure - CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --with-python=/usr/bin/python2.3 + CFLAGS="$(CFLAGS)" ./configure --prefix=/usr echo "all:" > example/Makefile echo "install:" >> example/Makefile echo "distclean:" >> example/Makefile echo " rm -rf .deps" >> example/Makefile + mv -f python/Makefile python/Makefile.bak + echo all: > python/Makefile # Build libxml2 $(MAKE) + mv -f python/Makefile.bak python/Makefile touch build-stamp clean: dh_testdir dh_testroot - rm -f build-stamp install-stamp + rm -f build-stamp install*-stamp + rm -f debian/python*.examples debian/python*.install -$(MAKE) distclean -rm -f example/Makefile @@ -57,16 +64,17 @@ clean: dh_clean -install: install-stamp +install: install-stamp install-python-stamp install-stamp: build-stamp dh_testdir dh_testroot dh_clean -k dh_installdirs - $(MAKE) prefix=`pwd`/debian/tmp/usr \ - PYTHON_SITE_PACKAGES=`pwd`/debian/tmp/usr/lib/python2.3/site-packages \ - install + mv -f python/Makefile python/Makefile.bak + echo install: > python/Makefile + $(MAKE) prefix=`pwd`/debian/tmp/usr install + mv -f python/Makefile.bak python/Makefile mv debian/tmp/usr/share/aclocal/libxml.m4 debian/tmp/usr/share/aclocal/libxml2.m4 @@ -96,6 +104,23 @@ install-stamp: build-stamp touch install-stamp +build-python%-stamp: build-stamp + cd python && $(MAKE) clean && $(MAKE) PYTHON=/usr/bin/python$* pythondir=`pwd`/../debian/tmp/usr/lib/python$*/site-packages PYTHON_VERSION=$* PYTHON_INCLUDES=/usr/include/python$* + + touch $@ + +install-python%-stamp: build-python%-stamp + rm build-python$*-stamp + cd python && $(MAKE) PYTHON=/usr/bin/python$* pythondir=`pwd`/../debian/tmp/usr/lib/python$*/site-packages PYTHON_VERSION=$* PYTHON_INCLUDES=/usr/include/python$* install + + sed s/PYVERS/$*/ debian/python-libxml2.install.in > debian/python$*-libxml2.install + cp debian/python-libxml2.examples.in debian/python$*-libxml2.examples + + touch $@ + +install-python-stamp: $(PYVERS:%=install-python%-stamp) + touch $@ + # Build architecture-independent files here. binary-indep: build install dh_testdir -i @@ -105,6 +130,7 @@ binary-indep: build install dh_installchangelogs -i -Nlibxml2-python2.3 debian/no-upstream-changelog dh_installchangelogs -plibxml2-python2.3 dh_install -i --sourcedir=debian/tmp + dh_python -i dh_link -i dh_strip -i dh_compress -i -Xexamples/ -Xtutorial/ -Xhtml/ -X.html @@ -121,16 +147,18 @@ binary-arch: build install dh_testroot -a dh_installexamples -a dh_installdocs -plibxml2 -Nlibxml2-dev -A AUTHORS TODO README - dh_installdocs -ppython2.3-libxml2 python/TODO + for python in $(PYVERS); do \ + dh_installdocs -ppython$${python}-libxml2 python/TODO; \ + for file in AUTHORS README README.Debian changelog.Debian.gz changelog.gz; do \ + ln -sf ../libxml2/$${file} debian/python$${python}-libxml2/usr/share/doc/python$${python}-libxml2/$${file}; \ + done; \ + done ln -sf libxml2 debian/libxml2-dev/usr/share/doc/libxml2-dev ln -sf libxml2 debian/libxml2-utils/usr/share/doc/libxml2-utils dh_installman -a dh_installchangelogs -plibxml2 ChangeLog - for file in AUTHORS README README.Debian changelog.Debian.gz changelog.gz; do \ - ln -sf ../libxml2/$${file} debian/python2.3-libxml2/usr/share/doc/python2.3-libxml2/$${file}; \ - done dh_install -a --sourcedir=debian/tmp - dh_python -a -V 2.3 + dh_python -a dh_link -a dh_strip -a dh_compress -a -Xexamples/ |