#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk export DH_VERBOSE = 1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all CMAKE_FLAGS := -DENABLE_STATIC_LIB=0 -DDOXYGEN_FOUND=ON -DCMAKE_C_FLAGS="-g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -D_FORTIFY_SOURCE=2" define genman = help2man \ --no-info \ --source=debian\ --help-option='-h' \ --no-discard-stderr \ --version-string=$(DEB_VERSION) \ --name=$(2) \ --section=$(3) \ --output man/man$(3)/$(2).$(3) \ $(1) endef %: dh $@ -Scmake override_dh_auto_build: dh_auto_build dh_auto_build -- doc override_dh_auto_configure: dh_auto_configure -- $(CMAKE_FLAGS) # Remove RPATH for e_smi_tool # genman is not working when no driver is available at the moment # man is generated offline as a workaround override_dh_install: mkdir -p man/man1 for exe in `find -type f -name e_smi_tool`; do \ $(call genman,$$exe,e_smi_tool,1); \ chrpath -d $$exe; \ done dh_install # Remove extra-license-file find debian -name COPYING -exec rm -f {} \; override_dh_auto_clean: dh_auto_clean rm -f include/e_smi/e_smi64Config.h *.pdf rm -rf man genman: help2man --no-info --source=debian --version-string="5.2.1" \ --name="AMD EPYC System Management Interface Tool" \ --section=1 --include debian/libe-smi64-1.desc \ e_smi_tool | grep -v "Err" | grep -v '====' \ | grep -v '\[0m' | grep -v '^Help :' \ > debian/e_smi_tool.1