#!/usr/bin/make -f
# -*- makefile -*-

name = globus-common

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,defs

INSTALLDIR = debian/tmp

_docdir = /usr/share/doc/lib$(name)-dev

perl_vendorlib = $(shell eval "`perl -V:installvendorlib`"; echo $$installvendorlib)

%:
	dh $@

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	GLOBUS_VERSION=6.2 \
	SH=/bin/sh \
	dh_auto_configure -- \
	   --disable-static \
	   --includedir=/usr/include/globus \
	   --libexecdir=/usr/share/globus \
	   --docdir=$(_docdir) \
	   --with-perlmoduledir=$(perl_vendorlib) \
	   --with-backward-compatibility-hack

override_dh_auto_test:
	dh_auto_test -- NO_EXTERNAL_NET=1

override_dh_auto_install:
	dh_auto_install

	# Remove libtool archives (.la files)
	rm $(INSTALLDIR)/usr/lib/*/*.la

	# Remove environment scripts
	rm $(INSTALLDIR)/usr/share/globus-user-env.csh
	rm $(INSTALLDIR)/usr/share/globus-user-env.sh

	# Remove installed license file
	rm $(INSTALLDIR)$(_docdir)/GLOBUS_LICENSE
