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


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

DEB_CONFIGURE_EXTRA_FLAGS := --enable-noexecstack --enable-ld-version-script
DEB_MAKE_CHECK_TARGET = check

DEB_DH_STRIP_ARGS = --dbg-package=libgcrypt11-dbg
DEB_DH_MAKESHLIBS_ARGS := -V 'libgcrypt11 (>=1.4.2)'

clean::
	if test -f ltmain.sh ; then touch ltmain.sh; else libtoolize -c -f --automake; 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 --copy --add-missing; fi

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

common-configure-impl:: $(DEB_BUILDDIR)/doc/stamp-vti
$(DEB_BUILDDIR)/doc/stamp-vti:
	cd $(DEB_SRCDIR)/doc && $(MAKE) stamp-vti

build/libgcrypt11-doc:: $(DEB_BUILDDIR)/config.status
	cd $(DEB_SRCDIR)/doc && $(MAKE) gcrypt.ps html

install/libgcrypt11-dev::
	find debian/tmp/usr/lib -name "*.la" -exec \
		sed -i -e "s,^dependency_libs=.*,dependency_libs=''," {} +

