#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk export DEB_BUILD_MAINT_OPTIONS = hardening=+all # When cross-building, debhelper generates the meson cross file with # debcrossgen, whose default implementation never sets an exe_wrapper. Use # "meson env2mfile" instead, which picks up the triplet-prefixed # cross-exe-wrapper so that the man page can be generated by running qdl. export MESON_USE_NEW_CROSSGEN = 1 %: dh $@ # VERSION: upstream derives the version from "git describe" which reports # "unknown-version" when building from the release tarball. Report the Debian # package version instead. # nbdkit: the plugin defaults to "auto" so a missing nbdkit-plugin-dev would # silently drop it from the build. Enable it always so configure fails # rather than leaving nbdkit-plugin-qdl empty. # udev_group: the udev rules only tag EDL devices with uaccess, which grants # access to the user on the active local seat. Also grant access to the # plugdev group so that flashing works from ssh or other non-seat sessions, # matching how other Debian packages handle USB devices. # tests: the unit tests need cmocka, which is not installed for the nocheck # profile. Disable them there, as dh_auto_configure would otherwise turn the # "auto" feature into a hard requirement and fail configure. override_dh_auto_configure: dh_auto_configure -- \ -DVERSION=$(DEB_VERSION) \ -Dnbdkit=enabled \ -Dtests=$(if $(filter nocheck,$(DEB_BUILD_PROFILES)),disabled,enabled) \ -Dudev_group=plugdev # The nbdkit plugin documentation ships in nbdkit-plugin-qdl, so leave it out # of the upstream documentation installed in qdl. override_dh_installdocs: dh_installdocs -pqdl -Xnbd.md dh_installdocs --remaining-packages # The man page is generated by running the built qdl binary through help2man, # which is not installed for the nodoc profile, so only install the man page # without it. Cross builds run qdl through the cross-exe-wrapper. ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),) override_dh_installman: dh_installman -pqdl debian/tmp/usr/share/man/man1/qdl.1 endif