#!/usr/bin/make -f
# debian/rules file - for GNUPG (1.9)
# Copyright 1994,1995 by Ian Jackson.
# Copyright 1998-2003 by James Troup.
# Copyright 2003-2004 by Matthias Urlichs.
# 
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified

export DEB_BUILD_HARDENING=1

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --enable-symcryptrun

override_dh_shlibdeps:
# Make ldap a recommends rather than a hard dependency.
	dh_shlibdeps -a -Xgnupg2/gpg2keys_ldap -- \
		-dRecommends debian/tmp/usr/lib/gnupg2/gpg2keys_ldap -dDepends

override_dh_auto_install:
	dh_auto_install
	install -d debian/gnupg-agent/etc/X11/Xsession.d
	install -m 644 debian/gnupg-agent.xsession \
		debian/gnupg-agent/etc/X11/Xsession.d/90gpg-agent

override_dh_installchangelogs:
	dh_installchangelogs -pgnupg-agent agent/ChangeLog-2011
	dh_installchangelogs -pgpgsm sm/ChangeLog-2011
	dh_installchangelogs -pscdaemon scd/ChangeLog-2011
	dh_installchangelogs -pgnupg2 ChangeLog

# Install subdirectory changelogs.
	for i in \
		$(foreach dir,doc g10 jnlib kbx keyserver tools,$(dir)/ChangeLog-2011); \
		do install -m 644 $$i \
			debian/gnupg2/usr/share/doc/gnupg2/changelog.$$(dirname $$i); done

