APP = gpxview
MAEMO_VERSION_MAJOR = 
prefix = /usr
datarootdir = ${prefix}/share
datadir = ${prefix}/share

LANGS = en_GB de_DE fi_FI
LANGS_HELP = en_GB de_DE fi_FI

all:

clean:

install-debian:
#	install -m 644 help/gpxview.html $(DESTDIR)$(prefix)/share/$(APP)

install-maemo:
	# the path to /share is hardcoded since datapath points to /opt on fremantle
	install -d $(DESTDIR)$(prefix)/share/applications/hildon
	install $(APP).desktop $(DESTDIR)$(prefix)/share/applications/hildon
	for s in 40 26; do \
	  install -d $(DESTDIR)$(prefix)/share/icons/hicolor/$${s}x$${s}/hildon ;\
	  install -m 644 $(APP).$$s.png $(DESTDIR)$(prefix)/share/icons/hicolor/$${s}x$${s}/hildon/$(APP).png ;\
	done
	install -d $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/hildon
	install -m 644 $(APP).64.png $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/hildon/$(APP).png
	if [ $(MAEMO_VERSION_MAJOR) -lt 5 ]; then \
		echo "Installing hildon help files"; \
		for LANG in $(LANGS_HELP); do \
			install -d $(DESTDIR)$(prefix)/share/osso-help/$${LANG} ;\
			install -m 644 ../help/$${LANG}/*.xml $(DESTDIR)$(prefix)/share/osso-help/$${LANG} ;\
		done;\
	fi

install: install-debian
	install -d $(DESTDIR)$(datadir)/$(APP)
	install -m 644 icons/*.gif icons/*.png $(DESTDIR)$(datadir)/$(APP)
	install -m 644 welcome.gpx icons/*.png $(DESTDIR)$(datadir)/$(APP)
	for LANG in $(LANGS); do \
		install -d $(DESTDIR)$(prefix)/share/locale/$${LANG}/LC_MESSAGES ;\
		msgfmt ../po/$${LANG}.po -o $(DESTDIR)$(prefix)/share/locale/$${LANG}/LC_MESSAGES/$(APP).mo ;\
	done

