#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

package=bleriot-fonts
installdir=usr/X11R6/lib/X11/fonts/misc

build:
	$(checkdir)

	for f in *.bdf; do \
		bdftopcf $$f > `basename $$f .bdf`.pcf; \
	done

	touch build

clean:
	$(checkdir)
	-rm -f build
	-rm -f *.pcf
	-rm -f `find . -name "*~"`
	-rm -rf debian/tmp debian/files* core debian/substvars
	-rm -f $(package).alias

binary-indep:	checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp
	install -d debian/tmp/$(installdir)

	for f in *.pcf; do \
	  install -m644 $$f debian/tmp/$(installdir); \
	  gzip debian/tmp/$(installdir)/$$f; \
	done
	install -d debian/tmp/etc/X11/fonts/misc/

	tools/generate_alias.pl *.bdf > $(package).alias
	install -m644 $(package).alias debian/tmp/etc/X11/fonts/misc/

	install -d debian/tmp/usr/share/doc/$(package)/html
	## the following line requires that you make the fonts available
	## for the current server (xset +fp the_dir)
	cd debian/tmp/usr/share/doc/$(package)/html && ../../../../../../../tools/create_html_info.pl -snap

	debstd doc/README -c doc/RadarFont_charset_encoding.txt ## do not compress html/*png !!!
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	dpkg --build debian/tmp ..

binary-arch:	checkroot build
	$(checkdir)

# There are no architecture-dependent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

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