#!/usr/bin/make -f
# (c) 1998-2016  Roland Rosenfeld <roland@debian.org>
# Based on sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess. 

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DROOT=`pwd`/debian/lbdb

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with autotools_dev

override_dh_auto_configure:
	env SH=/bin/sh MAWK=/usr/bin/awk \
		./configure --prefix=/usr --libdir='$${prefix}/lib/lbdb' \
			--mandir='$${prefix}/share/man' --sysconfdir=/etc \
			--enable-lbdb-dotlock \
			--with-finger=/usr/bin/finger \
		        --with-abook=/usr/bin/abook \
		        --with-goobook=/usr/bin/goobook \
		        --with-addr-email=/usr/bin/addr-email \
		        --with-ypcat=/usr/bin/ypcat \
		        --with-getent=/usr/bin/getent \
		        --with-gpg=/usr/bin/gpg \
		        --with-pgpk=/usr/bin/pgpk \
		        --with-pgp=/usr/bin/pgp \
		        --with-evolution-addressbook-export=auto

override_dh_auto_install:
	$(MAKE) install_prefix=$(DROOT) install
	install -m644 -oroot -groot lbdb.el \
		$(DROOT)/usr/share/emacs/site-lisp/lbdb/lbdb.el
