#!/usr/bin/make -f

config.status: configure
	dh_testdir
	if [ -e ./autogen.sh ] ; then ./autogen.sh ; fi
	./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"

build: config.status 
	dh_testdir
	$(MAKE)
	touch $@

clean: 
	dh_testdir
	dh_testroot
	rm -f build-stamp 
	if [ -e Makefile ] ; then $(MAKE) distclean ; fi

install: build
	dh_testdir
	dh_testroot
#	dh_prep  
	dh_installdirs

	# Add here commands to install the package into debian/kiwix.
	$(MAKE) DESTDIR=$(CURDIR)/debian/kiwix install

# 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_installchangelogs 
	dh_installdocs
	dh_installexamples
#	dh_install
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
	dh_pysupport
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_makeshlibs
	dh_installdeb
#	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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