#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1

# query for the architecture triplet we build for
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# See FEATURE AREAS in dpkg-buildflags(1).
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# See ENVIRONMENT in dpkg-buildflags(1).
# Package maintainers to append CFLAGS.
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic -I/usr/include/tcl
# Package maintainers to append LDFLAGS.
#export DEB_LDFLAGS_MAINT_APPEND = -Wl
DIR = $(shell pwd)/debian/tcl-syslog
TCLVERSIONS = 8.6 9.0

%:
	dh $@

override_dh_gencontrol:
	tcltk-depends
	dh_gencontrol

override_dh_auto_configure:
	autoupdate
	for v in $(TCLVERSIONS) ; do \
		dh_auto_configure -B$(CURDIR)/debian/$$v --	\
		--with-tcl=/usr/lib/tcl$$v 			\
		--prefix=/usr 					\
                --mandir=/usr/share/man				\
		--libdir=/usr/lib/tcltk/$(DEB_HOST_MULTIARCH) 	\
		--libexecdir=/usr/lib/tcltk/$(DEB_HOST_MULTIARCH) ; \
	done

override_dh_auto_test:

override_dh_auto_install:
	for v in $(TCLVERSIONS) ; do \
	    dh_auto_install -B$(CURDIR)/debian/$$v ; \
	done
	rmdir  $(CURDIR)/debian/tcl-syslog/usr/bin
	rm -fr $(CURDIR)/debian/tcl-syslog/usr/include

