#!/usr/bin/make -f

# tell gconf not to register schemas at package build time
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1

build-arch: build
build-indep: build

build: build-stamp
build-stamp:
	cp -f /usr/share/misc/config.sub .
	cp -f /usr/share/misc/config.guess .
	dh_testdir
	./configure --prefix=/usr --sysconfdir=/etc --enable-hamlib

	$(MAKE)
	touch build-stamp

clean:
	dh_testdir
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f config.guess config.sub build-stamp config.log \
	   help/gmfsk/C/gmfsk-C.omf.out
	dh_clean

binary-indep:	build
# nothing else to do

binary-arch:	build
	dh_clean
	dh_installdirs
	$(MAKE) install DESTDIR=`pwd`/debian/gmfsk
	cp debian/gmfsk.desktop debian/gmfsk/usr/share/applications

	# Move the X fonts to the proper location
	#mv debian/gmfsk/usr/share/fonts/feldhell/*.pcf debian/gmfsk/usr/X11R6/lib/X11/fonts/misc
	#rm -rf debian/gmfsk/usr/share/fonts
	# Remove the X fonts as they can't be used currently - to be fixed
	rm -rf debian/gmfsk/usr/share/fonts

	dh_gconf
	#dh_installxfonts
	dh_installdocs AUTHORS README
	dh_installmenu
	dh_installman debian/gmfsk.man
	dh_installchangelogs ChangeLog
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

checkroot:
	dh_testdir
	dh_testroot

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