#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
export DH_VERBOSE = 1

export PYBUILD_NAME=subscription-manager
export PYBUILD_DISABLE=test

include /usr/share/dpkg/default.mk

%:
	dh $@ --with python2 --buildsystem=pybuild
# 	dh $@ --with python2,python3 --buildsystem=pybuild

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

override_dh_auto_build:
	make -f Makefile GTK_VERSION=2 OS_DIST=debian PREFIX=/usr

override_dh_auto_install:
	make -f Makefile install GTK_VERSION=2 OS_DIST=debian PREFIX=/usr DESTDIR=debian/python-subscription-manager
	sed -i -e '/dbus-python/d' debian/python-subscription-manager/usr/lib/python2.7/site-packages/subscription_manager-*.egg-info/requires.txt
	sed -i 's/libexec/lib\/$(DEB_HOST_MULTIARCH)/g' debian/python-subscription-manager/etc/cron.daily/rhsmd

override_dh_auto_test:

# If you need to rebuild the Sphinx documentation
# Add spinxdoc to the dh --with line
#override_dh_auto_build:
#	dh_auto_build
#	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -bhtml        docs/ build/html # HTML generator
#	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -bman        docs/ build/man # Manpage generator

