#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs

%:
	dh $@

execute_before_dh_install:
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
	: # docbook2pdf output depends on the process locale (link targets
	: # shift by ~0.4pt and rule positions/widths change between the
	: # C and C.UTF-8 collations), so pin the locale to make the
	: # generated shared-mime-info-spec.pdf reproducible regardless of
	: # the build environment.
	LC_ALL=C LANG=C docbook2pdf -o data data/shared-mime-info-spec.xml
	LC_ALL=C LANG=C docbook2html -o data/shared-mime-info-spec.html data/shared-mime-info-spec.xml
endif

override_dh_compress:
	dh_compress -X.pdf

execute_after_dh_clean:
	rm -rf data/shared-mime-info-spec.html data/shared-mime-info-spec.pdf
