#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with python3

override_dh_auto_install:
	# manpage currently disabled, see #394898
	#	cd $(CURDIR)/debian/libsmbios-bin; for f in usr/sbin/*; do \
	#	    ln -s smbios-bin.1 usr/share/man/man1/$$(basename $$f).1; \

	#autotools doesn't let you override this properly
	# https://bugs.launchpad.net/ubuntu/+source/automake/+bug/1250877
	sed -i 's,^pythondir = .*,pythondir = $${prefix}/lib/python3/dist-packages,' Makefile

	dh_auto_install

override_dh_install:
	#use libjs-jquery instead
	rm -f out/libsmbios_c/html/jquery.js
	ln -s /usr/share/javascript/jquery/jquery.js out/libsmbios_c/html/jquery.js
	#we don't want to install pre-compiled byte code
	rm -rf debian/tmp/usr/lib/python3/dist-packages/libsmbios_c/__pycache__ \
	       debian/tmp/usr/share/smbios-utils/__pycache__/
	dh_install -XLICENSE
