source: trunk/Makefile @ 307

Revision 307, 2.5 KB checked in by marc, 9 years ago (diff)

Fixed stupid tabs on makefile

  • Property svn:executable set to *
Line 
1INSTALL ?= install
2RM ?= rm
3MSGFMT ?= msgfmt
4MSGMERGE ?= msgmerge
5XGETTEXT ?= xgettext
6FIND ?= find
7
8PREFIX = /usr
9# When debian builds it, it passes its own DESTDIR
10DESTDIR = $(PREFIX)
11
12LIBDIR = $(DESTDIR)/lib/itaka
13BINDIR = $(DESTDIR)/bin
14DATADIR = $(DESTDIR)/share/itaka
15IMAGESDIR = $(DATADIR)/images
16LOCALEDIR = $(DATADIR)/locale
17APPLICATIONSDIR = $(DESTDIR)/share/applications
18ICONDIR = $(DESTDIR)/share/pixmaps
19MANDIR = $(DESTDIR)/share/man/man1
20
21# For debian compatibility, these are hardcoded
22REPLACEIMAGESDIR = $(PREFIX)/share/itaka/images/
23REPLACELOCALEDIR = $(PREFIX)/share/itaka/locale/
24
25PYFILES := $(shell $(FIND) . -name "*.py" -print)
26
27install:
28        # Replace images and locales directory
29        mv config.py config.py.old
30        mv itaka.py itaka.py.old
31        sed -e "s|/usr/share/itaka/images/|$(REPLACEIMAGESDIR)|g" config.py.old > config.py
32        sed -e "s|/usr/share/locale/|$(REPLACELOCALEDIR)|g" itaka.py.old > itaka.py
33        mv config.py.old config.py
34        mv itaka.py.old itaka.py
35       
36        $(INSTALL) -m 755 -d $(BINDIR) $(DATADIR) $(LIBDIR) $(IMAGESDIR) $(APPLICATIONSDIR) $(ICONDIR) $(MANDIR)
37        $(INSTALL) -m 755 *.py $(LIBDIR)
38
39        # We only need a few images
40        $(INSTALL) -m 644 share/images/itaka.png $(IMAGESDIR)
41        $(INSTALL) -m 644 share/images/itaka-take.png $(IMAGESDIR)
42        $(INSTALL) -m 644 share/images/itaka16x16-take.png $(IMAGESDIR)
43        $(INSTALL) -m 644 share/images/itaka64x64.png $(IMAGESDIR)
44
45        ln -sf share/images/itaka.png $(ICONDIR)/itaka.png
46
47        $(INSTALL) -m 644 share/itaka.desktop $(APPLICATIONSDIR)
48        gzip -9 -c share/itaka.1 > share/itaka.1.gz
49        $(INSTALL) -m 644 share/itaka.1.gz $(MANDIR)
50        if test -f $(BINDIR)/itaka; then rm $(BINDIR)/itaka; fi
51        ln -sf  $(LIBDIR)/itaka.py $(BINDIR)/itaka
52        echo $( ls $(BINDIR)/itaka )
53        chmod +x $(BINDIR)/itaka
54       
55        for lang in locale/*; do
56            if [[ -e $lang/LC_MESSAGES/itaka.po ]]; then
57                for pofile in $lang/LC_MESSAGES/itaka.po; do
58                    msgfmt $pofile -o $lang/LC_MESSAGES/itaka.mo && $(INSTALL) -m 644 $pofile $(LOCALEDIR)/${lang#locale/}/LC_MESSAGES/itaka.mo;
59                done;
60            fi;
61        done
62
63uninstall:
64        rm -r $(BINDIR)/itaka $(DATADIR) $(LIBDIR) $(ICONDIR)/itaka.png $(APPLICATIONSDIR)/itaka.desktop $(MANDIR)/itaka.1.gz
65
66clean:
67        find . -name '*.pyc' -o -name '*.pyo' -exec rm {} \;
68        rm locale/*/LC_MESSAGES/*.mo
69        rm share/itaka.1.gz
70
71help:
72        @echo Usage:
73        @echo make clean                - delete built modules and object files
74        @echo make install              - install binaries into the official directories
75        @echo make uninstall            - uninstall binaries from the official directories
76        @echo make help                 - prints this help
77        @echo
78
Note: See TracBrowser for help on using the repository browser.