Make build system update version number, so it doesn't need to be maintained separately.
[hermes] / package / Makefile
1 #
2 # Makefile for Hermes: Contacts Updated
3 # (c) Andrew Flegg 2009. Released under the Artistic Licence.
4
5 DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
6
7 compile:
8         perl -pi -e "s/(WimpWorks\.__init__.*?version\s*=\s*)['\"].*?['\"]/\1'${DEBVERS}'/" src/org/maemo/hermes/gui/gtkui.py
9         perl -ni -e 'print; exit if /^XB-Maemo-Icon-26:$$/' debian/control
10         uuencode -m share/hermes-48.png - | perl -ne 'print " $$_" unless $$. == 1 or /^====$$/' >>debian/control
11         py_compilefiles `find src -type f -name '*.py'`
12         cd po && $(MAKE) compile
13         mkdir bin
14
15 install:
16         mkdir -p ${DESTDIR}/opt/hermes/lib ${DESTDIR}/opt/hermes/bin ${DESTDIR}/opt/hermes/share
17         ln -s ../lib/main.py ${DESTDIR}/opt/hermes/bin/hermes
18         cp -r src/* ${DESTDIR}/opt/hermes/lib/
19         chown -R root:root ${DESTDIR}/opt/hermes/lib/
20         install -D -m 0644 -o root -g root src/*.py* ${DESTDIR}/opt/hermes/lib/
21         install -D -m 0644 -o root -g root share/account-*.png share/background.png ${DESTDIR}/opt/hermes/share/
22         install -D -m 0644 -o root -g root share/hermes-64.png ${DESTDIR}/usr/share/icons/hicolor/scalable/hildon/hermes.png
23         install -D -m 0644 -o root -g root share/hermes-48.png ${DESTDIR}/usr/share/icons/hicolor/48x48/hildon/hermes.png
24         install -D -m 0644 -o root -g root share/hermes.desktop ${DESTDIR}/usr/share/applications/hildon/hermes.desktop
25         install -D -m 0644 -o root -g root share/hermes.service ${DESTDIR}/usr/share/dbus-1/services/hermes.service
26         chmod 755 ${DESTDIR}/opt/hermes/lib/main.py
27         cd po && $(MAKE) install 
28
29 clean:
30         rm -f `find src -type f -name '*.pyo' -o -name '*.pyc'`
31         rm -f build-stamp configure-stamp
32         rm -rf debian/hermes bin
33         find . -name *~ -exec rm -f {} \;
34         cd po && $(MAKE) clean
35
36 package:
37         dpkg-buildpackage -rfakeroot -uc -us