#!/usr/bin/make -f

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

O_LD_PATH := $(LD_LIBRARY_PATH)
export LD_LIBRARY_PATH = $(O_LD_PATH):/opt/trinity/lib

DEB_MAKE_CHECK_TARGET := check
DEB_CONFIGURE_EXTRA_FLAGS += --disable-shared --with-pic
CPPFLAGS += -I/opt/trinity/include
LDFLAGS += -L/opt/trinity/lib -lept

DEB_DH_BUILDDEB_ARGS += -- -Z$(shell dpkg-deb --help | grep -q ":.* xz[,.]" \
                               && echo xz || echo bzip2)

post-patches:: debian/stamp-bootstrap

debian/stamp-bootstrap:
	dh_testdir
	autopoint && \
	autoreconf --install && \
	automake -f && \
	touch debian/stamp-bootstrap

clean::
	dh_testdir
	rm -f debian/stamp-bootstrap

# Store build information
common-binary-post-install-arch common-binary-post-install-indep::
	dh_buildinfo
