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

DIR = $(shell pwd)/debian/tmp
LIBDIR = $(DIR)/usr/lib/tcltk

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

%:
	dh $@ 

override_dh_auto_configure:
	dh_auto_configure -- --libdir=/usr/lib/tcltk --includedir=/usr/include/nsf --enable-threads --enable-shared

override_dh_auto_build:
	dh_auto_build
	$(MAKE) man-nroff
# Provide a man extension (*nx) to the Section-3 manpages
	cd doc/ && \
	  for f in *.3 ; do \
	     f2=$$(echo $$f | sed -e 's/\.3/.3nx/') ; \
		cat $$f | sed -e 's/^\.TH \([^ ]\+\|"[^"]\+"\) [3n]/.TH \1 3nx/' \
			 >$$f2 ; \
	done

override_dh_auto_install:
	dh_auto_install

# clean-up temporary installation content, before compiling the debs

	rm -rf $(LIBDIR)/nsf*/xotcl/COPYRIGHT

override_dh_auto_test:
ifeq ($(filter $(DEB_BUILD_OPTIONS),nocheck),)
	$(MAKE) test-nohttp
endif
