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