#!/usr/bin/make -f

package = ec-fonts-mftraced
main = debian/tmp

# override Red Hat layout used in GNUmakefile
MFLAGS = TEXCONFDIR='$$(sysconfdir)/texmf' MAPDIR='$$(TEXCONFDIR)/dvips/'

build:
	$(MAKE) $(MFLAGS)
	-defoma-hints --no-question type1 pfa/*.pfa > debian/ecfonts.hints
	touch build

clean:
	rm -f build
	-$(MAKE) clean
	rm -f `find . -name "*~"`
	rm -rf $(main) debian/files* core debian/substvars

# should I put the content of binary-arch here?
binary-indep: build

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) $(MFLAGS) install DESTDIR=$(main)

	# remove extra license file
	rm $(main)/usr/share/doc/ec-fonts-mftraced/LICENSE

	# remove INSTALL file
	rm $(main)/usr/share/doc/ec-fonts-mftraced/INSTALL

	mkdir -p $(main)/etc/defoma/hints
	install -m644 debian/ecfonts.hints $(main)/etc/defoma/hints


binary: binary-indep binary-arch
	dh_testdir
	dh_testroot
	dh_installchangelogs --keep ChangeLog
	dh_installdocs README
	dh_installexamples
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
#	dh_installinfo
#	dh_installman
#	dh_link
#	dh_strip
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_python
#	dh_makeshlibs
	dh_installdeb
#	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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