#!/usr/bin/make -f

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

BASEDIR=`pwd`/debian/aspell-ku

configure: configure-stamp
configure-stamp:
	dh_testdir
	./configure
	touch $@

build: build-arch build-indep

build-arch: build-stamp

build-indep: build-stamp

build-stamp: configure-stamp
	dh_testdir
	gzip -9 < ku.cwl > ku.cwl.gz
	touch $@

clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) clean
	rm -f ku.cwl.gz Makefile
	rm -f build-stamp configure-stamp
	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) DESTDIR=$(BASEDIR) rws_files= install
	gzip -9c ku.cwl > $(BASEDIR)/usr/share/aspell/ku.cwl.gz
	touch $(BASEDIR)/var/lib/aspell/ku.compat
	touch $(BASEDIR)/var/lib/aspell/ku.rws
	echo ku >> $(BASEDIR)/usr/share/aspell/ku.contents
	dh_install
	dh_link
	installdeb-aspell

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install

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