#!/usr/bin/make -f

DISABLE_UPDATE_UPLOADERS := 1
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
GNOME_MODULE := libgtkhtml

SONAME := 0
LIB_PKG := libgtkhtml2-$(SONAME)

configure: configure-stamp
configure-stamp: debian/control
	dh_testdir
	-test -r /usr/share/misc/config.sub && \
	   cp -f /usr/share/misc/config.sub $(BUILD_DIR)/config.sub
	-test -r /usr/share/misc/config.guess && \
	   cp -f /usr/share/misc/config.guess $(BUILD_DIR)/config.guess
	./configure --prefix=/usr --sysconfdir=/etc
	touch $@

build: build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(MAKE)
	touch $@

clean:: debian/control
	dh_testdir
	dh_testroot
	rm -f *-stamp
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean
	sed -e 's#@SONAME@#$(SONAME)#g' \
		-e 's#@GNOME_TEAM@#$(UPLOADERS)#g' \
		debian/control.in >debian/control

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

binary-indep: install

binary-arch: install
	dh_testdir
	dh_testroot
	dh_install -s --sourcedir=debian/tmp
	dh_installdocs -p$(LIB_PKG)
	dh_installman -s
	dh_installchangelogs -p$(LIB_PKG) ChangeLog
	dh_link -s
	dh_strip -s --dbg-package=libgtkhtml2-dbg
	dh_compress -s
	dh_fixperms -s
	dh_makeshlibs -s -V
	dh_installdeb -s
	dh_shlibdeps -s -ldebian/$(LIB_PKG)/usr/lib
	dh_gencontrol -s
	dh_md5sums -s
	dh_builddeb -s

binary: binary-indep binary-arch
.PHONY: configure build clean install binary-indep binary-arch binary
