#!/usr/bin/make -f
#
# thomas@linuxmuster.net
# 20231201
# GPL v3
#

#export DH_COMPAT=9

configure: configure-stamp
configure-stamp:
	dh_testdir

	# make necessary build dirs
	mkdir -p cache || true
	mkdir -p src || true
	mkdir -p tmp || true

	touch configure-stamp

build: build-stamp
build-stamp: configure-stamp
	dh_testdir
	touch build-stamp

distclean: clean
	rm -rf src || true
	rm -rf tmp || true

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	#rm -rf tmp
	dh_clean -d

install: build
	dh_testdir
	dh_testroot
	#dh_clean -k
	dh_installdirs
	dh_install

	# invoke build helper scripts
	run-parts build/run.d --report --exit-on-error

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
#	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs
#	dh_installexamples
#	dh_installmenu
	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
	dh_installdirs
	dh_installcron
#	dh_installman
#	dh_installinfo
#	dh_undocumented
	dh_install
	dh_installchangelogs
	dh_link
	dh_strip
#	dh_compress
	dh_fixperms
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
#	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb -- -Zgzip

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
