#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@ --with autotools-dev,systemd


override_dh_auto_configure:
	dh_auto_configure -- --enable-SIMPLE_USER_CACHE --enable-CPUNO_ADJUST

override_dh_install:
	dh_install
	# remove files we don't want to install for now
	rm $(CURDIR)/debian/sinfo/usr/bin/sshallsinfo
	rm $(CURDIR)/debian/sinfo/usr/share/man/man1/sshallsinfo.1
	# remove .la file, they are not needed on Debian and cause harm
	# for multiarch
	rm $(CURDIR)/debian/sinfo/usr/lib/*/sinfo/*.la
	# rename sinfo to sinfo-client to not conflict with slurm-client
	mv $(CURDIR)/debian/sinfo/usr/bin/sinfo $(CURDIR)/debian/sinfo/usr/bin/sinfo-client
	mv $(CURDIR)/debian/sinfo/usr/share/man/man1/sinfo.1 $(CURDIR)/debian/sinfo/usr/share/man/man1/sinfo-client.1
	mv html/man_sinfo.html html/man_sinfo-client.html

override_dh_installdocs:
	dh_installdocs	-XMakefile -X.xml -X.fig README html


override_dh_installinit:
	dh_installinit --update-rcd-params="defaults 80 10"

override_dh_fixperms:
	dh_fixperms
	# fix cgi permissions
	chmod 755 $(CURDIR)/debian/sinfo/usr/share/sinfo/sinfo.pl.cgi

# This is not a shared library for public use, the libs are only
# used internally
override_dh_makeshlibs:
