#!/usr/bin/make -f DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk v=1.4.7 pkgdir=$(shell pwd)/debian/tmp libdir=$(pkgdir)/usr/lib/$(DEB_HOST_MULTIARCH) %: dh $@ override_dh_clean: [ ! -f Makefile ] || $(MAKE) distclean rm -rf libtiff/tcl/port rm -rf libtiff/tcl/man rm -rf libtiff/tcl/libtiff rm -f libjpeg/jconfig.h rm -f libtiff/tcl/tools/Makefile find . -name "*.so" | xargs rm -f find . -name "*.a" | xargs rm -f find . -name config.status | xargs rm -f find . -name config.log | xargs rm -f dh_clean override_dh_auto_configure: cp /usr/include/$(DEB_HOST_MULTIARCH)/jconfig.h libjpeg/ CFLAGS="$(CFLAGS)" \ CPPFLAGS="$(CPPFLAGS)" \ LDFLAGS="$(LDFLAGS)" \ dh_auto_configure -- \ --with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH) \ --with-tk=/usr/lib/$(DEB_HOST_MULTIARCH) \ --with-tkinclude=/usr/include/tcl \ --enable-threads override_dh_auto_build: $(MAKE) TCL_INC_DIR=/usr/include/tcl/tcl-private/generic \ TK_INC_DIR=/usr/include/tcl/tk-private/generic override_dh_auto_install: $(MAKE) install INSTALL_ROOT=$(pkgdir) # # Fix file permissions find $(libdir) -type f | xargs chmod a-x # # Fix pkgIndex.tcl to prevent loading package to Tk 8.3 or older sed -i -e'1i\ # Tcl package index file\ #\ # Return if Tcl/Tk is old.\ #\ if {[package vcompare [info tclversion] 8.5] < 0} return\ ' $(libdir)/Img*/pkgIndex.tcl # # Move library into tcltk subdirectory install -m 755 -d $(libdir)/../tcltk/$(DEB_HOST_MULTIARCH) mv $(libdir)/Img* $(libdir)/../tcltk/$(DEB_HOST_MULTIARCH) # # Fix *Config.sh DIR=`ls -d $(libdir)/../tcltk/$(DEB_HOST_MULTIARCH)/Img*` ; \ PKGDIR=`basename $$DIR` ; \ for f in $(libdir)/*Config.sh ; do \ sed -i -e "s:\(/[^/]*\)\+\([ /]\):/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/$$PKGDIR\2:" $$f || exit 1; \ done # # Cleanup manpages (cd $(pkgdir)/usr/share/man/mann && \ for f in *.n ; do \ sed -e's/^\.TH \([^ ]\+\) n/.TH \1 3tk/' \ -e's/\xc2\xad //' \ $$f > `basename $$f .n`.3tk || exit 1; \ done) # # Rename img to img-intro since it's refered as img-intro mv $(pkgdir)/usr/share/man/mann/img.3tk $(pkgdir)/usr/share/man/mann/img-intro.3tk override_dh_auto_test: # Disable tests because they require X override_dh_fixperms-indep: dh_fixperms chmod a-x debian/libtk-img-doc/usr/share/doc/libtk-img-doc/examples/msgs/* override_dh_compress: dh_compress -X.tcl .PHONY: override_dh_clean override_dh_auto_build override_dh_auto_install \ override_dh_auto_test override_dh_fixperms-indep override_dh_compress