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

CFLAGS += -D_REENTRANT
ifeq ($(DEB_BUILD_ARCH),hppa)
	CFLAGS += -fno-gcse
endif

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 = --with-mcrypt=no --enable-ld-version-script --disable-cxx --without-lzo
DEB_MAKE_CHECK_TARGET = check
DEB_DH_STRIP_ARGS = --dbg-package=libgnutls26-dbg
DEB_DH_MAKESHLIBS_ARGS_libgnutls26 := -V 'libgnutls26 (>=2.4.0-0)'
DEB_DH_MAKESHLIBS_ARGS_guile-gnutls := -Xusr/lib/libguile-gnutls-
DEB_COMPRESS_EXCLUDE := gnutls.pdf

# No guile on ia64; do not build gnutls wrapper there.
ifeq ($(DEB_BUILD_ARCH),ia64)
	DEB_CONFIGURE_EXTRA_FLAGS += --disable-guile
else
	DEB_CONFIGURE_EXTRA_FLAGS += --enable-guile --with-guile-site-dir=/usr/share/guile/site
endif

post-patches::
	cd $(DEB_SRCDIR) && chmod +x doc/scripts/sort2.pl doc/scripts/gdoc

# pre-clean rule: save gnutls.pdf since it is expensive to regenerate.
# See README.source_and_patches


# additional commands for clean
clean::
	mkdir -p m4

	-rm -rf autom4te.cache

	-rm -f tests/stamp-tests
	# stupid conflicts
	-rm -f libextra/lzoconf.h libextra/lzodefs.h
	-rm -f doc/*.info*
	# restore gnutls.pdf
	if [ -e doc/gnutls.pdf.debbackup ] && [ ! -e doc/gnutls.pdf ] ; then mv doc/gnutls.pdf.debbackup doc/gnutls.pdf ; fi

# additional comands for build rule

# add post deb preparation (including debhelper stuff) actions
# generate symlinks manually and use dh_link to make them policy-conform.
