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

DIR = $(CURDIR)/debian/tcl-udp

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	#
	# Remove stale manpage
	rm -f udp.n

override_dh_auto_configure:
	dh_auto_configure -- \
			  --with-tcl=/usr/lib \
			  --with-tclinclude=/usr/include/tcl

override_dh_auto_install:
	$(MAKE) install DESTDIR=$(DIR)
	#
	mv $(DIR)/usr/lib/udp* $(DIR)/usr/lib/tcltk
	find $(DIR) -empty -prune -exec rmdir \{\} \;

override_dh_shlibdeps:
	tcltk-depends
	dh_shlibdeps

get-orig-source:
	wget -O tcludp_1.0.8.orig.tar.gz \
	     http://prdownloads.sourceforge.net/tcludp/tcludp-1.0.8.tar.gz 

.PHONY: override_dh_auto_clean override_dh_auto_configure \
	override_dh_auto_install override_dh_shlibdeps get-orig-source
