#!/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.

SHELL=/bin/sh

BUILDDIR = $(shell pwd)

build: build-stamp

-include debian/debiandirs

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

build-stamp: 
	dh_testdir
	if test ! -f configure; then \
	  $(MAKE) -f admin/Makefile.common ;\
	fi
	./configure $(configkde) --enable-static  \
		--without-libjpeg --without-libgif --without-libgdbm  \
		--without-audiofile \
		--libdir=$(kde_libdir) --includedir=$(kde_includedir)

	make TOPSUBDIRS="mimelib"

	touch build-stamp

clean: debian-clean
	dh_clean
	-rm -f debian/debiandirs

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:	checkroot build
	$(checkdir)
# 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
	dh_installdirs

	make DESTDIR=`pwd`/debian/tmp install
	perl -w admin/debianrules cleanup
	dh_undocumented
	dh_movefiles
	dh_installdocs
	dh_installchangelogs -plibmimelib1 mimelib/Changes
	dh_installchangelogs -plibmimelib-dev mimelib/Changes
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs -V
	dh_installdeb
	dh_perl
	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 checkroot
