#!/usr/bin/make -f

PACKAGE		= dlume
ICON		= $(PACKAGE).xpm

include debian/debian-vars.mk

# configure

override_dh_auto_configure:
	cp -vf /usr/share/misc/config.sub .
	cp -vf /usr/share/misc/config.guess .
	cp -vf $(shell ls /usr/share/automake-*/mkinstalldirs | tail -n 1) .
	autoreconf -vfi
	dh_auto_configure

override_dh_auto_clean:
	# Delete all files that are copied by autoreconf or override_dh_auto_configure.
	rm -rf autom4te.cache
	rm -f config.* configure Makefile */Makefile Makefile.in */Makefile.in
	rm -f install-sh depcomp missing stamp* aclocal.m4 INSTALL
	rm -f mkinstalldirs
	rm -f po/POTFILES
	rm -f *.cache *.log *.status* config.h po/*.gmo *~
	rm -f src/$(PACKAGE) src/*.o

override_dh_auto_install:
	$(MAKE) DESTDIR=$(PKGDIR) install

	install -d 0755 $(PIXDIR)
	install -m 0644 debian/dlume.xpm $(PIXDIR)
	install -m 0644 dlume.png $(PIXDIR)

	#  Install KDE, GDM support
	install -m 0755 -d $(DESKTOPDIR)
	install -m 0644 debian/*.desktop $(DESKTOPDIR)

	# Remove encoding, not needed
	sed --in-place '/Encoding/d' $(DESKTOPDIR)/dlume.desktop

override_dh_installdocs:
	dh_installdocs -X README -X AUTHORS -X TODO -X NEWS

%:
	dh $@

# End of file
