#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

#export PREFIX=/usr

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@


override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_LIBEXECDIR=lib \
		-DOPENSCAP_LIBRARIES=/usr/lib/$(DEB_HOST_MULTIARCH)/libopenscap.so.8 \
		-DOPENSCAP_INCLUDE_DIRS=/usr/include/openscap/

override_dh_auto_build:
	test -f doc/user_manual.html.ORIG || mv doc/user_manual.html doc/user_manual.html.ORIG
	dh_auto_build

override_dh_auto_install:
	dh_auto_install
	rm --verbose $(TMP)/usr/share/doc/scap-workbench/COPYING

override_dh_auto_clean:
	-test -f doc/user_manual.html.ORIG && mv -f doc/user_manual.html.ORIG doc/user_manual.html
	dh_auto_clean
