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

name = globus-gram-job-manager-lsf

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

INSTALLDIR = debian/tmp

_docdir = /usr/share/doc/$(name)

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

%:
	dh $@

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	BSUB=/usr/bin/bsub \
	BQUEUES=/usr/bin/bqueues \
	BJOBS=/usr/bin/bjobs \
	BKILL=/usr/bin/bkill \
	BHIST=/usr/bin/bhist \
	BACCT=/usr/bin/bacct \
	MPIEXEC=no \
	MPIRUN=no \
	dh_auto_configure -- \
	   --disable-static \
	   --includedir=/usr/include/globus \
	   --libexecdir=/usr/share/globus \
	   --docdir=$(_docdir) \
	   --with-perlmoduledir=$(perl_vendorlib) \
	   --with-globus-state-dir=/var/log/globus

override_dh_auto_install:
	dh_auto_install

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

	# Remove jobmanager-lsf from install dir - leave it for admin config
	rm $(INSTALLDIR)/etc/grid-services/jobmanager-lsf

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

override_dh_strip:
	dh_strip --dbgsym-migration='$(name)-dbg (<< 2.7-2~)'
