#!/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
DESTLIB=$(DEST)/usr/share/nicotine
DESTSERVICE=$(DEST)/usr/share/dbus-1/services
DESTDESKTOP=$(DEST)/usr/share/applications/hildon
DESTMENUEXTRA=$(DEST)/etc/others-menu/extra_applications
DESTIMAGE=$(DEST)/usr/share/icons/hicolor/26x26/hildon

build: #si se hace un Makefile

clean:
	dh_testdir
	dh_testroot
	dh_clean debian/dirs

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install    
	mkdir -p $(DESTLIB)/pynicotine/; 
	mkdir -p $(DESTLIB)/pynicotine/gtkgui/;
	mkdir -p $(DESTDESKTOP)/;
	mkdir -p $(DESTSERVICE)/;
	mkdir -p $(DESTBIN)/;
	mkdir -p $(DESTIMAGE)/;
	mkdir -p $(DESTMENUEXTRA)/;
	cp nicotine.desktop $(DESTDESKTOP)/;
	cp nicotine_pymaemo.service $(DESTSERVICE)/;
	cp nicotine.png $(DESTIMAGE)/;
	cp nicotine.py $(DESTLIB)/;
	cd pynicotine && \
		cp *.py $(DESTLIB)/pynicotine/; \
	cd gtkgui && \
		cp * $(DESTLIB)/pynicotine/gtkgui/; \
				

# 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_installman
	dh_installchangelogs CHANGELOG
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_python
	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
