#!/usr/bin/make -f
# -*- makefile -*-
# 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

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep

build:
	dh_testdir

install: build
	dh_testdir
	dh_testroot
	dh_installdirs

	mkdir -p $(CURDIR)/debian/mobilehotspot/opt/mobilehotspot/resources
	cp -a resources/* $(CURDIR)/debian/mobilehotspot/opt/mobilehotspot/resources/
	mkdir -p $(CURDIR)/debian/mobilehotspot/opt/mobilehotspot/libs
	cp -a libs/* $(CURDIR)/debian/mobilehotspot/opt/mobilehotspot/libs/
	cp mobilehotspot mobilehotspot_backend $(CURDIR)/debian/mobilehotspot/opt/mobilehotspot/
	mkdir -p $(CURDIR)/debian/mobilehotspot/usr/bin
	mkdir -p $(CURDIR)/debian/mobilehotspot/usr/sbin
	ln -s -f /opt/mobilehotspot/mobilehotspot $(CURDIR)/debian/mobilehotspot/usr/bin/mobilehotspot
	ln -s -f /opt/mobilehotspot/mobilehotspot_backend $(CURDIR)/debian/mobilehotspot/usr/sbin/mobilehotspot_backend
	mkdir -p $(CURDIR)/debian/mobilehotspot/usr/share/icons/hicolor/scalable/
	ln -s -f /opt/mobilehotspot/resources/mobilehotspot_64x64.png $(CURDIR)/debian/mobilehotspot/usr/share/icons/hicolor/scalable/mobilehotspot.png
	mkdir -p $(CURDIR)/debian/mobilehotspot/usr/share/icons/hicolor/64x64/apps
	ln -s -f /opt/mobilehotspot/resources/mobilehotspot_64x64.png $(CURDIR)/debian/mobilehotspot/usr/share/icons/hicolor/64x64/apps/mobilehotspot.png
	mkdir -p  $(CURDIR)/debian/mobilehotspot/usr/share/pixmaps/
	ln -s -f /opt/mobilehotspot/resources/mobilehotspot_64x64.png $(CURDIR)/debian/mobilehotspot/usr/share/pixmaps/mobilehotspot.png
	mkdir -p $(CURDIR)/debian/mobilehotspot/usr/share/applications/hildon/
	cp $(CURDIR)/debian/mobilehotspot/opt/mobilehotspot/resources/mobilehotspot.desktop $(CURDIR)/debian/mobilehotspot/usr/share/applications/hildon/mobilehotspot.desktop
	mkdir -p $(CURDIR)/debian/mobilehotspot/etc/sudoers.d
	ln -s -f /opt/mobilehotspot/resources/mobilehotspot.sudoers $(CURDIR)/debian/mobilehotspot/etc/sudoers.d/mobilehotspot.sudoers

clean:
	dh_clean
	rm -rf $(CURDIR)/debian/mobilehotspot/

