#!/usr/bin/make -f # debian/rules that uses debhelper. include /usr/share/dpkg/architecture.mk destdir = $(CURDIR)/debian/tmp mandir = /usr/share/man docdir = /usr/share/doc/tcllib exampledir = $(docdir)/examples tcllibcdir = debian/tcllib-critcl/usr/lib/tcltk/$(DEB_HOST_MULTIARCH) TCLV = 8.6 TCLV1 = 9.0 TCLVERSIONS = $(TCLV) $(TCLV1) %: dh $@ override_dh_clean: dh_testdir dh_testroot # for v in $(TCLVERSIONS) ; do \ rm -rf $(CURDIR)/debian/$$v ; \ done # rm -f config.cache config.status dh_clean override_dh_auto_configure: for v in $(TCLVERSIONS) ; do \ dh_auto_configure -B$(CURDIR)/debian/$$v -- \ --with-tclsh=/usr/bin/tclsh$$v ; \ done # Build-arch works with the critcl part override_dh_auto_build-arch: dh_testdir # for v in $(TCLVERSIONS) ; do \ $(MAKE) -C$(CURDIR)/debian/$$v DESTDIR=$(CURDIR)/debian/$$v install-binaries ; \ done # Build-indep mostly covers docs and such override_dh_auto_build-indep: dh_testdir # $(MAKE) -C$(CURDIR)/debian/$(TCLV) html-doc # # Remove doc for non-existent module rm $(CURDIR)/debian/$(TCLV)/doc/html/exif.html # # Fix broken examples permissions chmod 644 examples/csv/bench_join chmod 644 examples/logger/snit-logger.tcl chmod 644 examples/logger/xotcl-logger.tcl chmod 644 examples/mapproj/* override_dh_auto_test: # Disable tests (TODO: add all required packages to build dependencies # and enable tests) override_dh_auto_install: dh_testdir # $(MAKE) -C$(CURDIR)/debian/$(TCLV) DESTDIR=$(destdir) install-tcl ; \ # # remove the critcl package from the arch-indep package find $(destdir) -name tcllibc -type d -prune -exec rm -rf \{\} \; # # install the mpexpand script, which doesn't otherwise get installed. install -p -m 755 modules/doctools/mpexpand $(destdir)/usr/bin # # now set the permissions properly, since the Makefile doesn't bother cd $(destdir)/usr/lib && \ find . -type f -print | xargs chmod 644 override_dh_install-indep: dh_testdir # # cleanup manpages cd $(destdir)$(mandir)/mann && \ for f in dtplite mpexpand nns nnsd nnslog page tcldocstrip ; do \ sed -e'/\.so man.macros/ d' \ -e's/^\.TH \([^ ]\+\) n/.TH \1 1/' \ -e's/(n)/(3tcl)/g' \ -e's/^\.dtx/\\\&.dtx/' \ -e's/^\.\.\(.\)/\\\&..\1/' \ $$f.n > $$f.1; \ rm $$f.n; \ done # cd $(destdir)$(mandir)/mann && \ for f in *.n ; do \ sed -e'/\.so man.macros/ d' \ -e's/^\.TH "math::roman" 1/.TH "math::roman" 3tcl 1/' \ -e's/^\.TH "tcl::transform::zlib" [in] /.TH "tcl::transform::zlib" 3tcllib /' \ -e's/^\.TH \(.\+\) [in] /.TH \1 3tcl /' \ -e's/send(n)/send(3tk)/g' \ -e's/(n)/(3tcl)/g' \ -e's/^\.RE\([^ ]\)/.RE\n\1/' \ -e's/^\.dtx/\\\&.dtx/' \ -e's/^\.sppp/.sp/' \ -e's/^\.plot/\\\&.plot/' \ -e's/^\.sp /.sp\n/' \ -e's/\xf6/\\[:o]/g' \ -e"s/\xe9/\\['e]/g" \ -e's/^\.\.\(.\)/\\\&..\1/' \ -e's/^\.ddt/\\\&.ddt/' \ -e's/^\. It/\\\&. It/' \ -e's/^\.text/\\\&.text/' \ -e's/^\.IP,/\\.IP/' \ -e's/^\.mycombo/\\\&.mycombo/' \ $$f > `basename $$f .n`.3tcl; \ rm $$f; \ done # # cleanup docs cd $(CURDIR)/debian/$(TCLV)/doc/html && \ for f in *.html ; do \ sed -i -e's/\(^\|[^:]\+\)send(n)/\1send(3tk)/g' \ -e's/math::roman()/math::roman(3tcl)/' \ -e's/(n)/(3tcl)/g' $$f; \ done # # generate documentation index tclsh debian/gen_index.tcl $(CURDIR)/debian/$(TCLV)/doc/html >$(destdir)/index.html # dh_install -i override_dh_install-arch: dh_testdir dh_install -a # mkdir -p $(tcllibcdir) # cp -r $(CURDIR)/debian/$(TCLV)/usr/lib/*/tcllibc* $(tcllibcdir) ls -lR $(tcllibcdir) for v in $(TCLVERSIONS) ; do \ cp $(CURDIR)/debian/$$v/usr/lib/*/tcllibc*/*/tcllibc.so $$(echo $(tcllibcdir)/tcllibc*)/tcllibc$$v.so ; \ done # # remove unnecessary files rm $(tcllibcdir)/tcllibc*/license.terms rm $(tcllibcdir)/tcllibc*/teapot.txt find $(tcllibcdir) -name tcllibc.so -delete # # fix the index file echo 'if {[package vsatisfies [package provide Tcl] $(TCLV1)-]} {' >$$(echo $(tcllibcdir)/tcllibc*)/pkgIndex.tcl sed -e 's/file join \$$path/file join \$$dir/' -e 's/tcllibc\$$ext/tcllibc$(TCLV1)\$$ext/' \ $(CURDIR)/debian/$(TCLV1)/usr/lib/*/tcllibc*/pkgIndex.tcl >>$$(echo $(tcllibcdir)/tcllibc*)/pkgIndex.tcl echo '} else {' >>$$(echo $(tcllibcdir)/tcllibc*)/pkgIndex.tcl sed -e 's/file join \$$path/file join \$$dir/' -e 's/tcllibc\$$ext/tcllibc$(TCLV)\$$ext/' \ $(CURDIR)/debian/$(TCLV)/usr/lib/*/tcllibc*/pkgIndex.tcl >>$$(echo $(tcllibcdir)/tcllibc*)/pkgIndex.tcl echo '}' >>$$(echo $(tcllibcdir)/tcllibc*)/pkgIndex.tcl # # cleanup find debian/tcllib-critcl -type d -empty -delete override_dh_compress: dh_compress -Xusr/share/doc/tcllib/examples/ \ -Xusr/share/doc/tcllib/html/ override_dh_gencontrol: tcltk-depends dh_gencontrol .PHONY: override_dh_clean override_dh_auto_build-arch override_dh_auto_install-arch override_dh_install-arch \ override_dh_auto_build-indep override_dh_auto_install-indep \ override_dh_compress override_dh_gencontrol