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

name = globus-gatekeeper

INSTALLDIR = debian/tmp

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

%:
	dh $@

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	LDFLAGS="$(LDFLAGS) -Wl,--as-needed -Wl,-z,defs" \
	dh_auto_configure -- \
	   --disable-static \
	   --includedir=/usr/include/globus \
	   --libexecdir=/usr/share/globus \
	   --docdir=$(_docdir) \
	   --with-initscript-config-path=/etc/default/$(name) \
	   --with-lockfile-path=/var/lock/$(name)

override_dh_auto_install:
	dh_auto_install --destdir=$(INSTALLDIR)

	# Remove start-up script
	rm -rf $(INSTALLDIR)/etc/init.d

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

	mkdir -p $(INSTALLDIR)/etc/grid-services
	mkdir -p $(INSTALLDIR)/etc/grid-services/available

override_dh_installinit:
	dh_installinit --no-enable

override_dh_missing:
	dh_missing --fail-missing

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