tazinst view Makefile @ rev 18

Added tag 3.91 for changeset ffba6e8966ac
author Dominique Corbex <domcox@slitaz.org>
date Fri Jan 03 18:01:10 2014 +0100 (2014-01-03)
parents 02aae5848073
children 661566d3b980
line source
1 # Makefile for TazInst.
2 # Check the README for more information.
3 #
4 PREFIX?=/usr
5 DOCDIR?=/usr/share/doc
6 DESTDIR?=
7 TAZPANEL?=/var/www/tazpanel
8 LINGUAS?=el es es_AR fr pt_BR sv ru
10 PACKAGE = tazinst
11 VERSION := $(shell grep ^VERSION ${PACKAGE} | cut -d '=' -f 2)
12 TARBALL = $(PACKAGE)-$(VERSION).tar.gz
14 all:
16 # i18n.
18 pot:
19 xgettext -o po/tazinst/tazinst.pot -L Shell \
20 --package-name="TazInst" \
21 --package-version="$(VERSION)" \
22 ./tazinst
23 xgettext -o po/slitaz-installer/slitaz-installer.pot -L Shell \
24 --package-name="slitaz-installer" \
25 --package-version="$(VERSION)" \
26 ./slitaz-installer
27 xgettext -o po/installer/installer.pot -L Shell \
28 --package-name="installer.cgi" \
29 --package-version="$(VERSION)" \
30 ./installer.cgi
32 msgmerge:
33 @for l in $(LINGUAS); do \
34 if [ -f "po/tazinst/$$l.po" ]; then \
35 echo -n "Updating tazinst $$l po file."; \
36 msgmerge -U po/tazinst/$$l.po po/tazinst/tazinst.pot ; \
37 fi;\
38 if [ -f "po/slitaz-installer/$$l.po" ]; then \
39 echo -n "Updating slitaz-installer $$l po file."; \
40 msgmerge -U po/slitaz-installer/$$l.po \
41 po/slitaz-installer/slitaz-installer.pot ; \
42 fi;\
43 if [ -f "po/installer/$$l.po" ]; then \
44 echo -n "Updating installer $$l po file."; \
45 msgmerge -U po/installer/$$l.po po/installer/installer.pot ; \
46 fi;\
47 done;
49 msgfmt:
50 @for l in $(LINGUAS); do \
51 if [ -f "po/tazinst/$$l.po" ]; then \
52 echo "Compiling tazinst $$l mo file..."; \
53 mkdir -p po/mo/$$l/LC_MESSAGES; \
54 msgfmt -o po/mo/$$l/LC_MESSAGES/tazinst.mo po/tazinst/$$l.po ; \
55 fi;\
56 if [ -f "po/slitaz-installer/$$l.po" ]; then \
57 echo "Compiling slitaz-installer $$l mo file..."; \
58 mkdir -p po/mo/$$l/LC_MESSAGES; \
59 msgfmt -o po/mo/$$l/LC_MESSAGES/slitaz-installer.mo \
60 po/slitaz-installer/$$l.po ; \
61 fi;\
62 if [ -f "po/installer/$$l.po" ]; then \
63 echo "Compiling installer $$l mo file..."; \
64 mkdir -p po/mo/$$l/LC_MESSAGES; \
65 msgfmt -o po/mo/$$l/LC_MESSAGES/installer.mo po/installer/$$l.po ; \
66 fi;\
67 done;
69 # Installation.
71 install: msgfmt
72 @echo "Installing Tazinst into $(DESTDIR)$(PREFIX)/sbin..."
73 mkdir -p $(DESTDIR)$(PREFIX)/sbin
74 install -m 0755 tazinst $(DESTDIR)$(PREFIX)/sbin
75 @echo "Installing slitaz-installer into $(DESTDIR)$(PREFIX)/sbin..."
76 mkdir -p $(DESTDIR)$(PREFIX)/sbin
77 install -m 0755 slitaz-installer $(DESTDIR)$(PREFIX)/sbin
78 @echo "Installing installer.cgi into $(DESTDIR)$(TAZPANEL)..."
79 mkdir -p $(DESTDIR)$(TAZPANEL)/menu.d
80 install -m 0755 installer.cgi $(DESTDIR)$(TAZPANEL)
81 @echo "Installing installer.menu into $(DESTDIR)$(TAZPANEL)/menu.d..."
82 ln -s ../installer.cgi $(DESTDIR)$(TAZPANEL)/menu.d/installer.cgi
83 @echo "Installing config file into $(DESTDIR)/etc/slitaz..."
84 mkdir -p $(DESTDIR)/etc/slitaz
85 install -m 0755 etc/tazinst.conf $(DESTDIR)/etc/slitaz
87 @echo "Installing Tazinst documentation..."
88 mkdir -p $(DESTDIR)$(DOCDIR)/tazinst
89 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazinst
90 # i18n
91 mkdir -p $(DESTDIR)$(PREFIX)/share/locale
92 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
93 # Desktop integration
94 @echo "Setting up desktop integration..."
95 mkdir -p $(DESTDIR)$(PREFIX)/share
96 cp -a applications $(DESTDIR)$(PREFIX)/share
98 # Uninstallation and tarball clean-up commands.
100 uninstall:
101 rm -f $(DESTDIR)/etc/slitaz/tazinst.conf
102 rm -f $(DESTDIR)$(PREFIX)/sbin/tazinst
103 rm -f $(DESTDIR)$(PREFIX)/sbin/slitaz_installer
104 rm -f $(DESTDIR)$(TAZPANEL)/installer.cgi
105 rm -f $(DESTDIR)$(TAZPANEL)/menu.d/installer.menu
106 rm -rf $(DESTDIR)$(DOCDIR)/tazinst
107 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazinst*.mo
108 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/slitaz-installer*.mo
109 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/installer*.mo
110 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazinst.desktop
112 clean:
113 rm -rf _pkg
114 rm -rf po/mo
115 rm -f po/*/*~
117 dist-clean:
118 rm -rf $(DISTDIR)
120 # Build tarball and MD5 file for packaging.
121 dist: dist-clean
122 hg archive -t tgz $(TARBALL)
123 md5sum $(TARBALL) > $(PACKAGE)-$(VERSION).md5