#! /usr/bin/make -f
# Build the opencdk8 package for Debian.

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

DEB_CONFIGURE_EXTRA_FLAGS = --enable-ld-version-script
DEB_MAKE_CHECK_TARGET = check
DEB_DH_STRIP_ARGS = --dbg-package=libopencdk8-dbg
DEB_DH_MAKESHLIBS_ARGS_libopencdk8 := -V 'libopencdk8 (>=0.5.13)'


clean::
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	mkdir -p m4
	test -r /usr/share/aclocal/libgcrypt.m4 && \
		cp -f /usr/share/aclocal/libgcrypt.m4 m4 || \
		test -r m4/libgcrypt.m4

	if test -f ltmain.sh ; then touch ltmain.sh; else libtoolize -c --force --automake; mv l*.m4 m4; fi
	if test -f aclocal.m4 ; then touch aclocal.m4; else aclocal-1.9 -I m4; fi
	if test -f config.h.in ; then touch config.h.in; else autoheader2.50; fi
	if test -f Makefile.in ; then find . -name Makefile.in -exec touch {} \; ;\
		else automake-1.9 --gnu --copy --add-missing; fi

	if test -f configure ; then touch configure; else autoconf2.50 -I . ; fi
	-rm -rf autom4te.cache

	-$(MAKE) clean

	dh_clean

common-build-arch common-build-indep:: doc/opencdk-api.html
doc/opencdk-api.html:
	$(MAKE) -C doc opencdk-api.html
