#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

INST_OWN = -o root -g root
INST_SCRIPT = install -c  $(INST_OWN) -m 755

DEST=$(CURDIR)/debian/tmp
DESTLIBPIXPS=$(DEST)/usr/share/maemo-periodic/pixmaps
DESTSERVICE=$(DEST)/usr/share/dbus-1/services
DESTDESKTOP=$(DEST)/usr/share/applications/hildon
DESTBIN=$(DEST)/usr/bin
DESTMENUEXTRA=$(DEST)/etc/others-menu/extra_applications
DESTIMAGE=$(DEST)/usr/share/icons/hicolor/26x26/hildon

clean:
	dh_testdir
	dh_testroot
	dh_clean debian/dirs

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install	     
	mkdir -p $(DESTLIB)/;
	mkdir -p $(DESTLIBPIXPS)/;
	mkdir -p $(DESTDESKTOP)/;
	mkdir -p $(DESTSERVICE)/;
	mkdir -p $(DESTBIN)/;
	mkdir -p $(DESTIMAGE)/;
	mkdir -p $(DESTMENUEXTRA)/;
	cp maemo-periodic.desktop $(DESTDESKTOP)/;
	cp maemo_periodic.service $(DESTSERVICE)/;
	cp maemo-periodic.png $(DESTIMAGE)/;
	cp listas.py $(DEST)/usr/share/maemo-periodic/;
	cp molmass.py $(DEST)/usr/share/maemo-periodic/;
	cp MaemoPeriodic.py $(DEST)/usr/share/maemo-periodic/;
	cd pixmaps && \
		cp about.png $(DESTLIBPIXPS)/; \
				

# Build architecture-dependent files here.
binary-indep:
# We have nothing to do by default.

# Build architecture-independent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installmenu
	dh_installchangelogs changelog
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_python
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	$(INST_SCRIPT) debian/postinst $(DEST)/DEBIAN/postinst
	$(INST_SCRIPT) debian/prerm $(DEST)/DEBIAN/prerm
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: clean binary-indep binary-arch binary install build
