tazinst view Makefile @ rev 64
Update 'pt_BR.po' file.
author | Leonardo Laporte <hackdorte@sapo.pt> |
---|---|
date | Mon Mar 28 05:02:37 2016 -0300 (2016-03-28) |
parents | 0df59f69c90c |
children | 7877ddbcbdbe |
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 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 -[ "$(VERSION)" ] && sed -i 's/^VERSION=["0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/sbin/slitaz-installer
79 @echo "Installing installer.cgi into $(DESTDIR)$(TAZPANEL)..."
80 mkdir -p $(DESTDIR)$(TAZPANEL)/menu.d
81 install -m 0755 installer.cgi $(DESTDIR)$(TAZPANEL)
82 -[ "$(VERSION)" ] && sed -i 's/^VERSION=["0-9].*/VERSION="$(VERSION)"/' $(DESTDIR)$(TAZPANEL)/installer.cgi
83 @echo "Installing installer.menu into $(DESTDIR)$(TAZPANEL)/menu.d..."
84 ln -fs ../installer.cgi $(DESTDIR)$(TAZPANEL)/menu.d/installer.cgi
85 @echo "Installing config file into $(DESTDIR)/etc/slitaz..."
86 mkdir -p $(DESTDIR)/etc/slitaz
87 install -m 0755 etc/tazinst.conf $(DESTDIR)/etc/slitaz
89 @echo "Installing Tazinst documentation..."
90 mkdir -p $(DESTDIR)$(DOCDIR)/tazinst
91 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazinst
92 # i18n
93 mkdir -p $(DESTDIR)$(PREFIX)/share/locale
94 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
95 # Desktop integration
96 @echo "Setting up desktop integration..."
97 mkdir -p $(DESTDIR)$(PREFIX)/share
98 cp -a applications $(DESTDIR)$(PREFIX)/share
100 # Uninstallation and tarball clean-up commands.
102 uninstall:
103 rm -f $(DESTDIR)/etc/slitaz/tazinst.conf
104 rm -f $(DESTDIR)$(PREFIX)/sbin/tazinst
105 rm -f $(DESTDIR)$(PREFIX)/sbin/slitaz_installer
106 rm -f $(DESTDIR)$(TAZPANEL)/installer.cgi
107 rm -f $(DESTDIR)$(TAZPANEL)/menu.d/installer.menu
108 rm -rf $(DESTDIR)$(DOCDIR)/tazinst
109 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazinst*.mo
110 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/slitaz-installer*.mo
111 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/installer*.mo
112 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazinst.desktop
114 clean:
115 rm -rf _pkg
116 rm -rf po/mo
117 rm -f po/*/*~
119 dist-clean:
120 rm -rf $(DISTDIR)
122 # Build tarball and MD5 file for packaging.
123 dist: dist-clean
124 hg archive -t tgz $(TARBALL)
125 md5sum $(TARBALL) > $(PACKAGE)-$(VERSION).md5