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

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

DEFAULTPY=$(shell pyversions -v -d)
PYVERSIONS=$(shell pyversions -v -r)
ALLPY=$(PYVERSIONS)

override_dh_auto_test:
	# disable tests until they work as expected
	:

override_dh_auto_configure: $(ALLPY:%=override_dh_auto_configure-%)

override_dh_auto_configure-%:
	dh_auto_configure -Bbuild-python-$* -- --enable-sce --enable-perl PYTHON=/usr/bin/python$*

override_dh_auto_build: $(ALLPY:%=override_dh_auto_build-%)

override_dh_auto_build-%:
	dh_auto_build -Bbuild-python-$*

override_dh_auto_install: $(ALLPY:%=override_dh_auto_install-%)
	find debian/tmp -name "*.la" -delete
	rm -f debian/libopenscap-dev/usr/share/doc/libopenscap-dev/html/jquery.js

override_dh_auto_install-%:
	dh_auto_install -Bbuild-python-$* --destdir=debian/tmp

override_dh_strip:
	dh_strip -plibopenscap8 --dbg-package=libopenscap8-dbg
	dh_strip -ppython-openscap --dbg-package=libopenscap8-dbg
	dh_strip -plibopenscap-perl --dbg-package=libopenscap8-dbg

override_dh_auto_clean:
	rm -rf build-*

%:
	dh $@ --with autotools-dev,autoreconf,python2
