tazinst view Makefile @ rev 116

tazinst: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 09 15:11:39 2021 +0000 (2021-11-09)
parents 1ef7d33fc570
children
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?=de el es fr it ja pt_BR ru sv zh_CN
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 -k_ -k_n \
23 ./tazinst
24 xgettext -o po/slitaz-installer/slitaz-installer.pot -L Shell \
25 --package-name="slitaz-installer" \
26 --package-version="$(VERSION)" \
27 -k_ -k_n \
28 ./slitaz-installer
29 xgettext -o po/installer/installer.pot -L Shell \
30 --package-name="installer.cgi" \
31 --package-version="$(VERSION)" \
32 -k_ -k_n \
33 ./installer.cgi
35 msgmerge:
36 @for l in $(LINGUAS); do \
37 if [ -f "po/tazinst/$$l.po" ]; then \
38 echo -n "Updating tazinst $$l po file."; \
39 msgmerge -U po/tazinst/$$l.po po/tazinst/tazinst.pot ; \
40 fi;\
41 if [ -f "po/slitaz-installer/$$l.po" ]; then \
42 echo -n "Updating slitaz-installer $$l po file."; \
43 msgmerge -U po/slitaz-installer/$$l.po \
44 po/slitaz-installer/slitaz-installer.pot ; \
45 fi;\
46 if [ -f "po/installer/$$l.po" ]; then \
47 echo -n "Updating installer $$l po file."; \
48 msgmerge -U po/installer/$$l.po po/installer/installer.pot ; \
49 fi;\
50 done;
52 msgfmt:
53 @for l in $(LINGUAS); do \
54 if [ -f "po/tazinst/$$l.po" ]; then \
55 echo "Compiling tazinst $$l mo file..."; \
56 mkdir -p po/mo/$$l/LC_MESSAGES; \
57 msgfmt -o po/mo/$$l/LC_MESSAGES/tazinst.mo po/tazinst/$$l.po ; \
58 fi;\
59 if [ -f "po/slitaz-installer/$$l.po" ]; then \
60 echo "Compiling slitaz-installer $$l mo file..."; \
61 mkdir -p po/mo/$$l/LC_MESSAGES; \
62 msgfmt -o po/mo/$$l/LC_MESSAGES/slitaz-installer.mo \
63 po/slitaz-installer/$$l.po ; \
64 fi;\
65 if [ -f "po/installer/$$l.po" ]; then \
66 echo "Compiling installer $$l mo file..."; \
67 mkdir -p po/mo/$$l/LC_MESSAGES; \
68 msgfmt -o po/mo/$$l/LC_MESSAGES/installer.mo po/installer/$$l.po ; \
69 fi;\
70 done;
72 # Installation.
74 install: msgfmt
75 @echo "Installing Tazinst into $(DESTDIR)$(PREFIX)/sbin..."
76 mkdir -p $(DESTDIR)$(PREFIX)/sbin
77 install -m 0755 tazinst $(DESTDIR)$(PREFIX)/sbin
78 -[ "$(VERSION)" ] && sed -i 's/readonly VERSION=["0-9].*/readonly VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/sbin/tazinst
79 @echo "Installing slitaz-installer into $(DESTDIR)$(PREFIX)/sbin..."
80 mkdir -p $(DESTDIR)$(PREFIX)/sbin
81 install -m 0755 slitaz-installer $(DESTDIR)$(PREFIX)/sbin
82 -[ "$(VERSION)" ] && sed -i 's/^VERSION=["0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/sbin/slitaz-installer
83 @echo "Installing installer.cgi into $(DESTDIR)$(TAZPANEL)..."
84 mkdir -p $(DESTDIR)$(TAZPANEL)/menu.d
85 install -m 0755 installer.cgi $(DESTDIR)$(TAZPANEL)
86 -[ "$(VERSION)" ] && sed -i 's/^VERSION=["0-9].*/VERSION="$(VERSION)"/' $(DESTDIR)$(TAZPANEL)/installer.cgi
87 @echo "Installing installer.menu into $(DESTDIR)$(TAZPANEL)/menu.d..."
88 ln -fs ../installer.cgi $(DESTDIR)$(TAZPANEL)/menu.d/installer.cgi
89 @echo "Installing config file into $(DESTDIR)/etc/slitaz..."
90 mkdir -p $(DESTDIR)/etc/slitaz
91 install -m 0755 etc/tazinst.conf $(DESTDIR)/etc/slitaz
93 @echo "Installing Tazinst documentation..."
94 mkdir -p $(DESTDIR)$(DOCDIR)/tazinst
95 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazinst
96 # i18n
97 mkdir -p $(DESTDIR)$(PREFIX)/share/locale
98 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
99 # Desktop integration
100 @echo "Setting up desktop integration..."
101 mkdir -p $(DESTDIR)$(PREFIX)/share
102 cp -a applications $(DESTDIR)$(PREFIX)/share
104 # Uninstallation and tarball clean-up commands.
106 uninstall:
107 rm -f $(DESTDIR)/etc/slitaz/tazinst.conf
108 rm -f $(DESTDIR)$(PREFIX)/sbin/tazinst
109 rm -f $(DESTDIR)$(PREFIX)/sbin/slitaz_installer
110 rm -f $(DESTDIR)$(TAZPANEL)/installer.cgi
111 rm -f $(DESTDIR)$(TAZPANEL)/menu.d/installer.menu
112 rm -rf $(DESTDIR)$(DOCDIR)/tazinst
113 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazinst*.mo
114 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/slitaz-installer*.mo
115 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/installer*.mo
116 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazinst.desktop
118 clean:
119 rm -rf _pkg
120 rm -rf po/mo
121 rm -f po/*/*~
123 dist-clean:
124 rm -rf $(DISTDIR)
126 # Build tarball and MD5 file for packaging.
127 dist: dist-clean
128 hg archive -t tgz $(TARBALL)
129 md5sum $(TARBALL) > $(PACKAGE)-$(VERSION).md5