#!/usr/bin/make -f
# based on the sample debian/rules file for MPlayer.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=3

package        := ht-editor
prefix := $(shell pwd)/debian/$(package)

arch   := $(shell dpkg --print-architecture)


config.status: configure
	dh_testdir
	# Add here commands to configure the package.
	$(checkdir)
	./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --enable-release $(DEB_BUILD_OPTIONS)

	touch configure-stamp

build: build-stamp
build-stamp: config.status
	dh_testdir

	# commands to compile the package.
	${MAKE} 

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	# commands to clean up after the build process.
	-$(MAKE) distclean
	dh_clean

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

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# commands to install the package into debian/<packagename>
	$(MAKE) prefix=$(prefix)/usr sysconfdir=$(prefix)/etc mandir=$(prefix)/usr/share/man install


	dh_installdebconf
	dh_installdocs doc/ht.html
	dh_installmenu
	dh_installmime
	dh_installinfo doc/ht.info
	dh_installchangelogs ChangeLog
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean checkroot
