#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 WORKAROUND_REMOVED_FILES=include/libxml/xmlversion.h libxml2.spec python/setup.py doc/xmlcatalog.1 WORKAROUND_MODIFIED_FILES=python/libxml2-py.c CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif build: build-stamp build-stamp: dh_testdir # Workaround backups because of non-idempotent upstream: for file in $(WORKAROUND_REMOVED_FILES) $(WORKAROUND_MODIFIED_FILES); do \ cp -f -a $${file} $${file}-tmp; \ done # ./configure CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --with-python=/usr/bin/python2.3 echo "all:" > example/Makefile echo "install:" >> example/Makefile echo "distclean:" >> example/Makefile echo " rm -rf .deps" >> example/Makefile # Build libxml2 $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp install-stamp -$(MAKE) distclean -rm -f example/Makefile rm COPYING && cp Copyright COPYING # Restore workaround backups of removed and modified files -for file in $(WORKAROUND_REMOVED_FILES) $(WORKAROUND_MODIFIED_FILES); do \ test -r $${file}-tmp && \ mv -f $${file}-tmp $${file}; \ done -test -r /usr/share/misc/config.sub && \ cp -f /usr/share/misc/config.sub config.sub -test -r /usr/share/misc/config.guess && \ cp -f /usr/share/misc/config.guess config.guess dh_clean install: install-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 debian/tmp/usr/share/aclocal/libxml.m4 debian/tmp/usr/share/aclocal/libxml2.m4 # Properly install documentation in /usr/share/doc/libxml2-doc install -d debian/tmp/usr/share/doc/libxml2-doc/examples install -m 644 \ doc/*.html \ doc/*.gif \ doc/*.png \ doc/libxml2-api.xml debian/tmp/usr/share/doc/libxml2-doc install -m 644 \ doc/examples/*.c \ doc/examples/*.res \ doc/examples/index.html \ doc/examples/[tw]*.xml debian/tmp/usr/share/doc/libxml2-doc/examples cp -a \ doc/html \ doc/tutorial debian/tmp/usr/share/doc/libxml2-doc # Special workaround for svn-buildpackage: # Restore workaround backups of modified files. -for file in $(WORKAROUND_MODIFIED_FILES); do \ test -r $${file}-tmp && \ cat $${file}-tmp > $${file}; \ done touch install-stamp # Build architecture-independent files here. binary-indep: build install dh_testdir -i dh_testroot -i dh_installdocs -i -A AUTHORS TODO README dh_installchangelogs -i debian/no-upstream-changelog dh_install -i --sourcedir=debian/tmp dh_link -i dh_strip -i dh_compress -i -Xexamples/ -Xtutorial/ -Xhtml/ -X.html dh_fixperms -i dh_installdeb -i dh_shlibdeps -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i # Build architecture-dependent files here. binary-arch: build install dh_testdir -a dh_testroot -a dh_installexamples -a dh_installdocs -plibxml2 -Nlibxml2-dev -A AUTHORS TODO README dh_installdocs -plibxml2-python2.3 python/TODO 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/libxml2-python2.3/usr/share/doc/libxml2-python2.3/$${file}; \ done dh_install -a --sourcedir=debian/tmp dh_link -a dh_strip -a dh_compress -a -Xexamples/ dh_fixperms -a dh_makeshlibs -a -V 'libxml2 (>= 2.6.14)' dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install