#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# This file is public domain software, originally written by Joey Hess.
#
# This version is for packages that are architecture independent.

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

# This is the debhelper compatibility version to use.
export DH_COMPAT=2

build: build-stamp

build-stamp:
	dh_testdir

	export LANG=C
	debian/scripts/to-dict.sh --no-trans Mueller7accentGPL.koi mueller7accent.notr
	debian/scripts/to-dict.sh --src-data mueller7accent.notr mueller7accent.data 
	debian/scripts/to-dict.sh --data-dict mueller7accent.data mueller7accent
	-rm -f mueller7.data mueller7.notr
	debian/scripts/to-dict.sh --expand-index mueller7accent.index mueller7accent.index.exp
	sort -k 1,1 mueller7accent.index.exp > mueller7accent.index	
	-rm -f mueller7accent.index.exp

	debian/scripts/to-dict.sh --no-trans Mueller7GPL.koi mueller7.notr
	debian/scripts/to-dict.sh --src-data mueller7.notr mueller7.data
	debian/scripts/to-dict.sh --data-dict mueller7.data mueller7
	-rm -f mueller7.data mueller7.notr
	debian/scripts/to-dict.sh --expand-index mueller7.index mueller7.index.exp
	sort -k 1,1 mueller7.index.exp > mueller7.index	
	-rm -f mueller7.index.exp
	touch build-stamp


clean:
	dh_testdir
	dh_testroot
	rm -rf debian/tmp
	rm -f build-stamp

	# Add here commands to clean up after the build process.
	#-$(MAKE) clean
	#-$(MAKE) distclean
	-rm -f *.dict.dz *.index *.data *.notr
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	mkdir -p debian/tmp/usr/share/dict
	mkdir -p debian/tmp/usr/share/dictd
	mkdir -p debian/tmp/etc/mova

	install -m644 *.koi *.koi.hash debian/tmp/usr/share/dict
	install -m644 *.dict.dz *.index debian/tmp/usr/share/dictd
	install -m644 debian/Movarc* debian/tmp/etc/mova

	dh_movefiles

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	dh_installmenu
	dh_compress
	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






