#!/usr/bin/make -f

DEB_PYTHON_SYSTEM := pycentral
export DH_PYCENTRAL=nomove

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk
include /usr/share/cdbs/1/rules/langpack.mk

DEB_DH_INSTALL_SOURCEDIR := debian/tmp
DEB_PYTHON_INSTALL_ARGS_ALL := --no-compile --install-scripts usr/share/apport

pre-build::
	# install appropriate backends
	cp backends/packaging-apt-dpkg.py apport/packaging_impl.py

common-post-build-indep::
	make -C po
	make -C gtk
	make -C qt4
	make -C doc

binary-install/apport-gtk::
	dh_desktop -p $(cdbs_curpkg)

binary-install/apport-qt::
	dh_desktop -p $(cdbs_curpkg)

binary-install/apport::
	dh_installmime -p $(cdbs_curpkg)
	dh_icons

	# ignore wine crashes by default, until we found a way to
	# handle them appropriately
	install -d debian/$(cdbs_curpkg)/etc/apport/blacklist.d
	echo '/usr/bin/wine-preloader' > debian/$(cdbs_curpkg)/etc/apport/blacklist.d/apport

clean::
	# remove backend copies
	rm -f apport/packaging_impl.py
	make -C po clean
	make -C gtk clean
	make -C qt4 clean
	make -C doc clean
