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

build:
	$(checkdir)
	(export LIBS="-lc" \
		CFLAGS="-O2 -g -Wall -D_REENTRANT" \
		CXXFLAGS="-O2 -g -Wall -D_REENTRANT" ; \
		./configure --prefix=/usr --enable-debug --enable-static \
				--without-libjpeg \
		 		--without-libgif \
				--without-libgdbm --enable-static \
			        --includedir="\$$(prefix)/include/kde" )
	make 

	touch build

clean:
	$(checkdir)
	-rm -f build
	-make distclean 
	-rm -f */Makefile
	-rm -f `find . -name "*~"` 
	-rm -rf debian/tmp debian/kdesupport0g debian/*shlibs* \
		debian/files* core debian/substvars */*.lo
	-rm -rf config.log
	dh_clean


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 -k
	dh_installdirs

	make install prefix=`pwd`/debian/tmp/usr 
	chmod a+x debian/kderules
	debian/kderules

	dh_movefiles
	dh_installdocs
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_suidregister
	dh_makeshlibs -V "kdesupport0g (>= 2:980312)" -m1
	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
