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

name = globus-gram-job-manager-pbs

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs

INSTALLDIR = debian/tmp

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

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

%:
	dh $@

override_dh_auto_configure:
	MPIEXEC=no \
	MPIRUN=no \
	QDEL=/usr/bin/qdel \
	QSTAT=/usr/bin/qstat \
	QSUB=/usr/bin/qsub \
	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 \
	   --with-log-path=/var/spool/torque

override_dh_auto_install:
	dh_auto_install

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

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

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