#!/usr/bin/make -f

PYTHONS:=$(shell pyversions -vr)
PYTHON3S:=$(shell py3versions -vr)

UPSTREAM_GIT = git://github.com/harelba/q.git
-include /usr/share/openstack-pkg-tools/pkgos.make

%:
	dh $@ --with python2,python3

override_dh_install:
	dh_install
	mkdir -p $(CURDIR)/debian/python-q-text-as-data/usr/bin
	cp bin/q $(CURDIR)/debian/python-q-text-as-data/usr/bin/python2-q-text-as-data
	mkdir -p $(CURDIR)/debian/python3-q-text-as-data/usr/bin
	cp bin/q $(CURDIR)/debian/python3-q-text-as-data/usr/bin/python3-q-text-as-data

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	set -e ; for pyvers in $(PYTHONS) $(PYTHON3S); do \
		PYTHON=python$$pyvers ./test/test-all ; \
	done
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build
	rm -rf *.egg-info

# Commands not to run
override_dh_installcatalogs:
override_dh_installemacsen override_dh_installifupdown:
override_dh_installinfo override_dh_installmenu override_dh_installmime:
override_dh_installmodules override_dh_installlogcheck:
override_dh_installpam override_dh_installppp override_dh_installudev override_dh_installwm:
override_dh_installxfonts override_dh_gconf override_dh_icons override_dh_perl override_dh_usrlocal:
override_dh_installcron override_dh_installdebconf:
override_dh_installlogrotate override_dh_installgsettings:
