#!/usr/bin/make -f #export DH_VERBOSE = 1 include /usr/share/GNUstep/debian/config.mk export SHELL := /bin/bash export DEB_BUILD_MAINT_OPTIONS = hardening=+all d_com := $(CURDIR)/debian/fisicalab.app-common # Rule to build the documentation because the upstream build system # doesn't have one. Several things to note: # 1. All images are installed along with the HTML documentation in # order not to clutter infodir and to avoid duplicate files. # 2. For producing Info files with images, texi2any needs to find the # real image. Because /usr/share/doc/fisicalab.app-doc-*/html # does not exist at build time, the images are copied in a relative # directory and the .texinfo files are patched accordingly. Then the # .info files are patched to add the leading slash. # 3. The Texinfo manual recommends to install images for Info files in # infodir/PACKAGE-figures but Emacs cannot load them from there. # Furthermore, the filenames are the same for English/Spanish but # with different content. # 4. Lintian emits file-references-package-build-path for the PDF # files which probably means that the build is not reproducible. # There doesn't seem to be a way to remove the PTEX.FileName: # neither by passing the appropriate --Xopt nor by patching the # .texinfo files. Postprocessing the PDF files with various tools # also doesn't have any effect. define doc-rule srcdir=Documentation/Manual/$(2); \ mkdir --parents build-$(1)/usr/share/doc/fisicalab.app-doc-$(1)/html \ && cp $${srcdir}/* build-$(1) \ && cp build-$(1)/*.{jpg,png} \ build-$(1)/usr/share/doc/fisicalab.app-doc-$(1)/html \ && sed --in-place \ 's/@image{/@image{usr\/share\/doc\/fisicalab.app-doc-$(1)\/html\//g' \ build-$(1)/*.texinfo \ && texi2any --output=build-$(1) build-$(1)/fisicalab.texinfo \ && sed --in-place 's/usr\/share/\/usr\/share/g' build-$(1)/*.info* \ && mkdir build-$(1)/html \ && cp $${srcdir}/*.{jpg,png} build-$(1)/html \ && texi2any --output=build-$(1)/html --html $${srcdir}/fisicalab.texinfo \ && texi2any --output=build-$(1)/fisicalab.pdf --pdf --Xopt=--clean \ $${srcdir}/fisicalab.texinfo endef %: dh $@ override_dh_auto_build: dh_auto_build -- $(optim) $(verbose) \ $(shell dpkg-buildflags --export=cmdline) convert Resources/FisicaLab.tif -resize 64x64 FisicaLab.png # Build documentation, supporting the "nodoc" profile. execute_after_dh_auto_build-indep: ifdef docs $(call doc-rule,en,English) $(call doc-rule,es,Spanish) endif execute_before_dh_link: gsdh_gnustep --app --move-to=fisicalab.app-common override_dh_compress: dh_compress --exclude=.pdf execute_after_dh_fixperms-indep: # Copyright/licensing notices which are documented in debian/copyright. find $(d_com) -name COPYING.txt -delete # Gazillion of executable image files for which lintian rightfully complains. find $(d_com) -type f -executable -exec chmod -x '{}' \;