#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/utils.mk

DEB_PYTHON_SYSTEM=dh_python2

DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS="-Wl,-O1 -Wl,--as-needed"

DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc

# If this is a daily build, leave dbg symbols
DEB_BUILD_OPTIONS += $(if $(wildcard autogen.sh),nostrip)
export DEB_BUILD_OPTIONS

# Special-case the daily build.
makebuilddir::
	$(if $(wildcard autogen.sh),$(info $(shell NOCONFIGURE=y sh autogen.sh)))

common-binary-post-install-arch::
	find debian/tmp/usr/lib -name \*.la -exec rm {} \;
	find debian/tmp/usr/lib -name \*.a -exec rm {} \;
	find debian/tmp/usr/lib -name \*.pyc -exec rm {} \;
	find debian/tmp/usr/lib -name \*.pyo -exec rm {} \;

binary-predeb/python-grip::
	dh_python2 -ppython-grip

common-binary-predeb-arch:: list-missing
