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

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ --with sphinxdoc

override_dh_auto_configure:
	dh_autoreconf
	dh_auto_configure -- --with-python-config=/usr/bin/python3-config \
	                     --with-tcllib=/usr/lib/$(DEB_HOST_MULTIARCH)/libtcl8.6.so --with-tclinc=/usr/include/tcl8.6/tcl.h
	make config

override_dh_auto_build-indep:
	dh_auto_build -i
	cd doc/sphinx_source && make html

override_dh_auto_install:
	make install DEST=$$(pwd)/debian/tmp
	rm debian/tmp/doc/Changes*
	rm debian/tmp/scripts/autobotchk
	rm debian/tmp/scripts/sentinel.tcl
	rm debian/tmp/eggdrop
	mv debian/tmp/eggdrop-1.* debian/tmp/eggdrop

override_dh_installchangelogs:
	dh_installchangelogs doc/Changes1.10
