#!/usr/bin/make -f

#For our custom rules on all mythtv packages
# get-orig-source
# info
include /usr/share/mythtv/mythtv.make

%:
	dh $@

special-patches:
	#apply patches not intended for stable release

	if [ "$(shell lsb_release -rs)" = "10.10" ]; then \
		patch -p1 < debian/patches/qt47_support.patch; \
		patch -p1 < debian/patches/configure_missing_check.patch; \
	fi

override_dh_auto_configure: special-patches
	./configure --prefix=/usr --enable-all --zm-version=1.22.3 --qmake=/usr/bin/qmake

override_dh_auto_build:
	qmake -o Makefile PREFIX=/usr mythplugins.pro
	dh_auto_build --parallel

override_dh_auto_install:
	for plugin in mytharchive \
	mythgallery mythgame mythmusic mythmovies mythnews mythvideo \
	mythweather mythzoneminder mythbrowser mythnetvision ; do \
		$(MAKE) -C $$plugin install INSTALL_ROOT=$(CURDIR)/debian/$$plugin; \
	done

override_dh_installdocs:
	rm -f debian/mythweb/usr/share/mythtv/mythweb/{INSTALL,LICENSE,README}
	dh_installdocs

override_dh_strip:
	dh_strip --dbg-package=mythplugins-dbg
