1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
#!/usr/bin/make -f
# export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
## Memory consumption issues on some autobuilders have been causing
## build failures. There are two ways to address such issues:
## (a) reduce parallelism, e.g., dh $@ --max-parallel=2
## (b) reduce GCC memory usage, e.g., g++ --param ggc-min-expand=20 to
## reduce abrupt memory spikes, and g++ -g0 to skip debugging info.
## These issues have occurred post-2.1.x in two places: Ubuntu
## Launchpad, and some particular Debian architectures including
## armhf, mips, mipsel, m68k, kfreebsd-amd64, kfreebsd-i386.
## For that reason, I am activating all of the above space-reduction
## mechanisms on Ubuntu, all 32-bit architectures, and all kfreebsd
## systems.
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
SAVE_SPACE=yes
endif
ifeq ($(shell dpkg-architecture --query DEB_BUILD_ARCH_BITS),32)
SAVE_SPACE=yes
endif
ifeq ($(shell dpkg-architecture --query DEB_BUILD_ARCH_OS),kfreebsd)
SAVE_SPACE=yes
endif
ifeq ($(SAVE_SPACE),yes)
ifneq (, $(filter $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU),mips mipsel))
export DEB_CXXFLAGS_MAINT_APPEND = --param ggc-min-expand=5 -g0
DH_FLAGS += --max-parallel=1
else
export DEB_CXXFLAGS_MAINT_APPEND = --param ggc-min-expand=20 -g0
DH_FLAGS += --max-parallel=2
endif
endif
%:
dh $@ ${DH_FLAGS}
# Previously tweaked inputenc package option from utf8 to utf8x, no longer necesary:
# sed --in-place 's:usepackage\[utf8\]{inputenc}:usepackage[utf8x]{inputenc}:' refman.tex &&
# Previously used recursive make to build pdf documentation, that uses
# latex/dvips/ps2pdf the last of which terminated with a mysterious
# perhaps-font-related error, instead now just use latexmk --pdf which
# uses pdflatex.
# $(MAKE) pdf
override_dh_auto_build:
dh_auto_build
@echo building PDF reference manual
cd obj-*/doc/latex && \
latexmk --pdf refman.tex
override_dh_auto_test:
@echo do not ask do not tell do not test
override_dh_install:
dh_install
@echo use shared jquery.js javascript library
for f in $$(find debian/mlpack-doc -name jquery.js); do \
ln --verbose --symbolic --force /usr/share/javascript/jquery/jquery.js $$f; \
done
override_dh_missing:
dh_missing --list-missing
override_dh_installchangelogs:
dh_installchangelogs HISTORY.md
override_dh_compress:
dh_compress -Xrefman.pdf -Xdoc/html/
|