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

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


build: build-stamp

build-stamp:
	dh_testdir
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	mkdir -p $(CURDIR)/debian/tmp/usr/share/myspell/dicts
	mkdir -p $(CURDIR)/debian/tmp/usr/share/hyphen

	for dic in `find . -type f -name "hyph*.dic"`; do \
		install -m644 $$dic \
			$(CURDIR)/debian/tmp/usr/share/hyphen; \
		ln -s /usr/share/hyphen/`basename $$dic` $(CURDIR)/debian/tmp/usr/share/myspell/dicts/ ; \
	done

	dh_install --sourcedir=$(CURDIR)/debian/tmp -i

	for pkg in `dh_listpackages`; do \
		mkdir -p $(CURDIR)/debian/$$pkg/usr/share/myspell/infos/ooo; \
		install -m644 debian/$$pkg.dictlistinfo \
			$(CURDIR)/debian/$$pkg/usr/share/myspell/infos/ooo/$$pkg; \
	done

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

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

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