#!/usr/bin/make -f
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

LIB_PKG := $(shell sed -nr 's/^Package:[[:space:]]*(libanjuta[-0-9]+)[[:space:]]*$$/\1/p' debian/control)
SHVER := 2:3.2.0

%:
	dh $@ --with gir,gnome

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-glade-catalog

override_dh_makeshlibs:
	dh_makeshlibs -V '$(LIB_PKG) (>= $(SHVER))'

override_dh_install:
	rm -f debian/tmp/usr/share/doc/anjuta/INSTALL
	rm -f debian/tmp/usr/share/doc/anjuta/COPYING
	rm -f debian/tmp/usr/share/doc/anjuta/ChangeLog
	dh_install -X.la --list-missing

override_dh_strip:
	dh_strip --dbgsym-migration='anjuta-dbg (<< 2:3.22.0-1~)'
