#!/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.
# tweaked by Stephen Kulow and Ivan Moore for use with KDE

BUILDDIR = ./build

ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ifeq ($(ARCH),alpha)
        export CFLAGS=-O0 -mieee
        export CXXFLAGS=-O0 -mieee
endif

build: build-stamp

-include debian/debiandirs

debian/debiandirs: debian/debianrules
	perl -w debian/debianrules echodirs > debian/debiandirs

build-stamp:
	dh_testdir
	if test ! -f configure; then \
	  $(MAKE) -f admin/Makefile.common ;\
	fi
	./configure $(configkde)
	make
	touch build-stamp

clean: debian-clean
	dh_clean

debian-clean:
	dh_testdir
	-rm -f build-stamp
	if test -d CVS; then \
	  make -f admin/Makefile.common cvs-clean ;\
	fi
	-make distclean

binary-indep: build
	dh_testroot
	dh_testdir
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	install -d debian/tmp/etc/kde2
	make install DESTDIR=`pwd`/debian/tmp/
	perl -w debian/debianrules cleanup
	/usr/bin/meinproc doc/en/index.xml
	mv *.html debian/tmp/$(kde_htmldir)/en/kfocus/
	dh_undocumented
	dh_movefiles
	dh_link usr/share/icons/locolor/16x16/apps/kfocus.png  usr/share/icons/hicolor/16x16/apps/kfocus.png usr/share/icons/locolor/32x32/apps/kfocus.png usr/share/icons/hicolor/32x32/apps/kfocus.png
	dh_installdocs
	dh_installmenu
	dh_installmime
	dh_installchangelogs ChangeLog
	dh_strip
	dh_perl
	dh_compress -X .docbook
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb       	

# Below here is fairly generic really

binary:		binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean
