#! /usr/bin/make -f

%:
	dh $@ --with python2

override_dh_auto_configure:
	dh_auto_configure -B build/gtk2 -- --with-gtk=2.0 \
                                           --with-python \
                                           --enable-plugin=yes \
                                           --disable-introspection
	dh_auto_configure -B build/gtk3 -- --with-gtk=3.0 \
                                           --with-examples \
                                           --enable-introspection

override_dh_auto_build:
	dh_auto_build -D build/gtk2
	dh_auto_build -D build/gtk3

override_dh_auto_install:
	dh_auto_install -D build/gtk2 --destdir=debian/gtk2
	dh_auto_install -D build/gtk3 --destdir=debian/gtk3

override_dh_auto_clean:
	rm -rf debian/gtk2 debian/gtk3 build
	dh_auto_clean

override_dh_install:
	dh_install -plibgvnc-1.0-0 \
                   -plibgvnc-1.0-dev \
                   -plibgtk-vnc-2.0-0 \
                   -plibgtk-vnc-2.0-dev \
                   -pgir1.2-gtk-vnc-2.0 \
                   -pgvncviewer \
                  --sourcedir=debian/gtk3

	dh_install -plibgtk-vnc-1.0-0 \
                   -plibgtk-vnc-1.0-dev \
                   -pmozilla-gtk-vnc \
                   -ppython-gtk-vnc \
                  --sourcedir=debian/gtk2

override_dh_strip:
	dh_strip -plibgvnc-1.0-0 --dbg-package=libgvnc-1.0-0-dbg
	dh_strip -plibgtk-vnc-1.0-0 --dbg-package=libgtk-vnc-1.0-0-dbg
	dh_strip -pmozilla-gtk-vnc --dbg-package=libgtk-vnc-1.0-0-dbg
	dh_strip -plibgtk-vnc-2.0-0 --dbg-package=libgtk-vnc-2.0-0-dbg
	dh_strip -pgvncviewer -ppython-gtk-vnc

override_dh_python2:
	dh_python2 --no-guessing-versions

override_dh_makeshlibs:
	dh_makeshlibs -plibgtk-vnc-1.0-0 -V 'libgtk-vnc-1.0-0 (>= 0.3.9)'
	dh_makeshlibs -pmozilla-gtk-vnc --noscripts -X /plugins/
	dh_makeshlibs -a -Nlibgtk-vnc-1.0-0 -Nmozilla-gtk-vnc
	dh_girepository

