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

name = globus-gram-job-manager-slurm

INSTALLDIR = debian/tmp

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

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

%:
	dh $@

override_dh_auto_configure:
	MPIRUN=no \
	SRUN=/usr/bin/srun \
	SBATCH=/usr/bin/sbatch \
	SALLOC=/usr/bin/salloc \
	SCANCEL=/usr/bin/scancel \
	SCONTROL=/usr/bin/scontrol \
	dh_auto_configure -- \
	   --disable-static \
	   --includedir=/usr/include/globus \
	   --libexecdir=/usr/share/globus \
	   --docdir=$(_docdir) \
	   --with-perlmoduledir=$(perl_vendorlib)

override_dh_auto_install:
	dh_auto_install --destdir=$(INSTALLDIR)

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

	# Remove installed license files
	rm $(INSTALLDIR)$(_docdir)/*LICENSE*

override_dh_missing:
	dh_missing --fail-missing
