#!/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.
#export DH_VERBOSE=1
 
# This is the debhelper compatability version to use.
export DH_COMPAT=3

SHELL=/bin/sh

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-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
# 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/libmimelib1/ install
	dh_undocumented
	dh_installman -a
	dh_movefiles --sourcedir=debian/libmimelib1
	dh_installdocs
	dh_installchangelogs -plibmimelib1 mimelib/Changes
	dh_installchangelogs -plibmimelib-dev mimelib/Changes
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs -V
	dh_perl
	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 checkroot
