#!/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
export PYBUILD_DESTDIR_python2=${PWD}/debian/python-${PYBUILD_NAME}/
export PYBUILD_DESTDIR_python2-dbg=${PWD}/debian/python-${PYBUILD_NAME}-dbg/
export PYBUILD_DESTDIR_python3=${PWD}/debian/python3-${PYBUILD_NAME}/
export PYBUILD_DESTDIR_python3-dbg=${PWD}/debian/python3-${PYBUILD_NAME}-dbg/

export WITH_SUBMAN_GUI=false
export WITH_COCKPIT=false
export GTK_VERSION=2
export OS_DIST=debian
export PYTHON=python2
export INCLUDE_SYSPURPOSE=1

include /usr/share/dpkg/default.mk

%:
	dh $@ --with python2 --buildsystem=pybuild

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

override_dh_auto_build:
	make -f Makefile PREFIX=/usr VERSION=${DEB_VERSION_UPSTREAM_REVISION}

override_dh_auto_install:
	make -f Makefile install PREFIX=/usr VERSION=${DEB_VERSION_UPSTREAM_REVISION} DESTDIR=${PYBUILD_DESTDIR_python2}
	# manpages are part of subscription-manager package
	rm -fr ${PYBUILD_DESTDIR_python2}/usr/share/man
	sed -i -e '/dbus-python/d' ${PYBUILD_DESTDIR_python2}usr/lib/python*/site-packages/subscription_manager-*.egg-info/requires.txt

override_dh_auto_test:

