| 1 |
#!/usr/bin/make -f |
| 2 |
#export DH_VERBOSE = 1 |
| 3 |
|
| 4 |
include /usr/share/GNUstep/debian/config.mk |
| 5 |
export SHELL := /bin/bash |
| 6 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 7 |
d_com := $(CURDIR)/debian/fisicalab.app-common |
| 8 |
|
| 9 |
# Rule to build the documentation because the upstream build system |
| 10 |
# doesn't have one. Several things to note: |
| 11 |
# 1. All images are installed along with the HTML documentation in |
| 12 |
# order not to clutter infodir and to avoid duplicate files. |
| 13 |
# 2. For producing Info files with images, texi2any needs to find the |
| 14 |
# real image. Because /usr/share/doc/fisicalab.app-doc-*/html |
| 15 |
# does not exist at build time, the images are copied in a relative |
| 16 |
# directory and the .texinfo files are patched accordingly. Then the |
| 17 |
# .info files are patched to add the leading slash. |
| 18 |
# 3. The Texinfo manual recommends to install images for Info files in |
| 19 |
# infodir/PACKAGE-figures but Emacs cannot load them from there. |
| 20 |
# Furthermore, the filenames are the same for English/Spanish but |
| 21 |
# with different content. |
| 22 |
# 4. Lintian emits file-references-package-build-path for the PDF |
| 23 |
# files which probably means that the build is not reproducible. |
| 24 |
# There doesn't seem to be a way to remove the PTEX.FileName: |
| 25 |
# neither by passing the appropriate --Xopt nor by patching the |
| 26 |
# .texinfo files. Postprocessing the PDF files with various tools |
| 27 |
# also doesn't have any effect. |
| 28 |
define doc-rule |
| 29 |
srcdir=Documentation/Manual/$(2); \ |
| 30 |
mkdir --parents build-$(1)/usr/share/doc/fisicalab.app-doc-$(1)/html \ |
| 31 |
&& cp $${srcdir}/* build-$(1) \ |
| 32 |
&& cp build-$(1)/*.{jpg,png} \ |
| 33 |
build-$(1)/usr/share/doc/fisicalab.app-doc-$(1)/html \ |
| 34 |
&& sed --in-place \ |
| 35 |
's/@image{/@image{usr\/share\/doc\/fisicalab.app-doc-$(1)\/html\//g' \ |
| 36 |
build-$(1)/*.texinfo \ |
| 37 |
&& texi2any --output=build-$(1) build-$(1)/fisicalab.texinfo \ |
| 38 |
&& sed --in-place 's/usr\/share/\/usr\/share/g' build-$(1)/*.info* \ |
| 39 |
&& mkdir build-$(1)/html \ |
| 40 |
&& cp $${srcdir}/*.{jpg,png} build-$(1)/html \ |
| 41 |
&& texi2any --output=build-$(1)/html --html $${srcdir}/fisicalab.texinfo \ |
| 42 |
&& texi2any --output=build-$(1)/fisicalab.pdf --pdf --Xopt=--clean \ |
| 43 |
$${srcdir}/fisicalab.texinfo |
| 44 |
endef |
| 45 |
|
| 46 |
%: |
| 47 |
dh $@ |
| 48 |
|
| 49 |
override_dh_auto_build: |
| 50 |
dh_auto_build -- $(optim) $(verbose) \ |
| 51 |
$(shell dpkg-buildflags --export=cmdline) |
| 52 |
convert Resources/FisicaLab.tif -resize 64x64 FisicaLab.png |
| 53 |
|
| 54 |
# Build documentation, supporting the "nodoc" profile. |
| 55 |
execute_after_dh_auto_build-indep: |
| 56 |
ifdef docs |
| 57 |
$(call doc-rule,en,English) |
| 58 |
$(call doc-rule,es,Spanish) |
| 59 |
endif |
| 60 |
|
| 61 |
execute_before_dh_link: |
| 62 |
gsdh_gnustep --app --move-to=fisicalab.app-common |
| 63 |
|
| 64 |
override_dh_compress: |
| 65 |
dh_compress --exclude=.pdf |
| 66 |
|
| 67 |
execute_after_dh_fixperms-indep: |
| 68 |
# Copyright/licensing notices which are documented in debian/copyright. |
| 69 |
find $(d_com) -name COPYING.txt -delete |
| 70 |
# Gazillion of executable image files for which lintian rightfully complains. |
| 71 |
find $(d_com) -type f -executable -exec chmod -x '{}' \; |