#!/usr/bin/make -f

#DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

PKGDIR=debian/singularity-container

%:
	dh $@  --with autoreconf

override_dh_auto_install:
	dh_auto_install
	: # move bash completions into now new standard location
	mv $(PKGDIR)/etc/bash_completion.d $(PKGDIR)/usr/share/bash-completion/completions

override_dh_installman:
	: # Very sloppy man pages for now
	debian/generate_manpages $(PKGDIR)
	dh_installman

override_dh_installdocs:
	dh_installdocs README.md AUTHORS

override_dh_auto_test:

override_dh_fixperms:
	dh_fixperms
	chown root.root $(PKGDIR)/usr/lib/*/singularity/sexec
	chmod 4755 $(PKGDIR)/usr/lib/*/singularity/sexec-suid
	chmod 644 $(PKGDIR)/usr/lib/*/singularity/cli/*.help
