#!/usr/bin/make -f

%:
	dh $@ --with vdrplugin

override_dh_auto_configure:
	./configure

#	exit 1

override_dh_auto_build:
	dh_auto_build


execute_after_dh_auto_install:
	help2man -N ./vdr-sxfe --help-option=--help --name="Remote X-Server frontend for vdr-plugin-xineliboutput" > debian/vdr-sxfe.1
	help2man -N ./vdr-fbfe --help-option=--help --name="Remote Framebuffer frontend for vdr-plugin-xineliboutput" > debian/vdr-fbfe.1
	help2man -N ./vdr-wlfe --help-option=--help --name="Remote Wayland frontend for vdr-plugin-xineliboutput" > debian/vdr-wlfe.1

#	exit 1

override_dh_gencontrol:
	dpkg -p libxine2-dev | sed -re '/^Version:/! d; s/^Version: (([0-9]:)?([0-9]+\.){2}[0-9]+).*$$/xine:Depends=libxine2 (>= \1)/' \
	>> debian/libxine2-xvdr.substvars

	dh_gencontrol

override_dh_auto_install:
	dh_auto_install
	install -m 644 -D debian/icon.svg debian/xineliboutput-sxfe/usr/share/icons/xineliboutput-sxfe.svg
	install -m 644 -D debian/icon.svg debian/xineliboutput-sxfe/usr/share/icons/xineliboutput-fbfe.svg

override_dh_auto_clean:
	$(MAKE) -o .dependencies clean

override_dh_clean:
	dh_clean vdr-sxfe.1 vdr-fbfe.1
