#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

GTK2VER = $(shell pkg-config --variable=gtk_binary_version gtk+-2.0)
GTK3VER = $(shell pkg-config --variable=gtk_binary_version gtk+-3.0)

%:
	dh $@ 

override_dh_auto_configure:
	dh_auto_configure -- \
		--gcinlibdir=/usr/lib/$(DEB_BUILD_MULTIARCH)/gcin

override_dh_auto_clean:
	make clean
 
override_dh_auto_install:
	make install DESTDIR=$(CURDIR)/debian/tmp
	# move libraries to the correspond gtk version
	mkdir -p debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/gtk-2.0/$(GTK2VER)
	mv debian/tmp/usr/lib/gtk-2.0/immodules debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/gtk-2.0/$(GTK2VER)/
	mkdir -p debian/tmp/usr/lib/gtk-3.0/$(GTK3VER)
	mv debian/tmp/usr/lib/gtk-3.0/immodules debian/tmp/usr/lib/gtk-3.0/$(GTK3VER)/

override_dh_installchangelogs:
	dh_installchangelogs Changelog.html

override_dh_makeshlibs:
	dh_makeshlibs -n
