tazinst view Makefile @ rev 110

Tazinst: fix iso already mounted error (thanks ben, again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jan 17 17:18:42 2021 +0000 (2021-01-17)
parents b0c60e641493
children 34985ea0d32f
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 @echo "Installing slitaz-installer into $(DESTDIR)$(PREFIX)/sbin..."
79 mkdir -p $(DESTDIR)$(PREFIX)/sbin
80 install -m 0755 slitaz-installer $(DESTDIR)$(PREFIX)/sbin
81 -[ "$(VERSION)" ] && sed -i 's/^VERSION=["0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/sbin/slitaz-installer
82 @echo "Installing installer.cgi into $(DESTDIR)$(TAZPANEL)..."
83 mkdir -p $(DESTDIR)$(TAZPANEL)/menu.d
84 install -m 0755 installer.cgi $(DESTDIR)$(TAZPANEL)
85 -[ "$(VERSION)" ] && sed -i 's/^VERSION=["0-9].*/VERSION="$(VERSION)"/' $(DESTDIR)$(TAZPANEL)/installer.cgi
86 @echo "Installing installer.menu into $(DESTDIR)$(TAZPANEL)/menu.d..."
87 ln -fs ../installer.cgi $(DESTDIR)$(TAZPANEL)/menu.d/installer.cgi
88 @echo "Installing config file into $(DESTDIR)/etc/slitaz..."
89 mkdir -p $(DESTDIR)/etc/slitaz
90 install -m 0755 etc/tazinst.conf $(DESTDIR)/etc/slitaz
92 @echo "Installing Tazinst documentation..."
93 mkdir -p $(DESTDIR)$(DOCDIR)/tazinst
94 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazinst
95 # i18n
96 mkdir -p $(DESTDIR)$(PREFIX)/share/locale
97 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
98 # Desktop integration
99 @echo "Setting up desktop integration..."
100 mkdir -p $(DESTDIR)$(PREFIX)/share
101 cp -a applications $(DESTDIR)$(PREFIX)/share
103 # Uninstallation and tarball clean-up commands.
105 uninstall:
106 rm -f $(DESTDIR)/etc/slitaz/tazinst.conf
107 rm -f $(DESTDIR)$(PREFIX)/sbin/tazinst
108 rm -f $(DESTDIR)$(PREFIX)/sbin/slitaz_installer
109 rm -f $(DESTDIR)$(TAZPANEL)/installer.cgi
110 rm -f $(DESTDIR)$(TAZPANEL)/menu.d/installer.menu
111 rm -rf $(DESTDIR)$(DOCDIR)/tazinst
112 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazinst*.mo
113 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/slitaz-installer*.mo
114 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/installer*.mo
115 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazinst.desktop
117 clean:
118 rm -rf _pkg
119 rm -rf po/mo
120 rm -f po/*/*~
122 dist-clean:
123 rm -rf $(DISTDIR)
125 # Build tarball and MD5 file for packaging.
126 dist: dist-clean
127 hg archive -t tgz $(TARBALL)
128 md5sum $(TARBALL) > $(PACKAGE)-$(VERSION).md5