#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1

export PYTHON=/usr/bin/python3

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

%:
	dh $@

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))'

execute_before_dh_install:
	find debian/tmp -name '*.la' -print -delete
	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

# What is IAnjuta-3.0.gir used for?
override_dh_missing:
	dh_missing -X IAnjuta
