tazpanel view Makefile @ rev 623

Add Italian; make pot; make msgmerge; make clean
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Jan 30 12:06:32 2018 +0200 (2018-01-30)
parents 792c457d4568
children
line source
1 # Makefile for TazPanel.
2 #
3 PREFIX?=/usr
4 SYSCONFDIR?=/etc/slitaz
5 DESTDIR?=
6 LINGUAS?=de el es fr it ja pl pt_BR ru sv vi_VN zh_CN
7 PANEL?=/var/www/tazpanel
8 BASECGI?=boot.cgi hardware.cgi help.cgi index.cgi network.cgi hosts.cgi settings.cgi
9 EXTRACGI?=floppy.cgi test.cgi powersaving.cgi
11 VERSION:=$(shell grep ^VERSION tazpanel | cut -d= -f2)
13 all: msgfmt
14 mkdir build
15 cp -a *.cgi bootloader tazpanel \
16 lib/libtazpanel lib/*.js \
17 styles/default/*.html styles/default/*.css \
18 doc/tazpanel.*.html build
19 ./stripall.sh
21 # i18n
23 pot:
24 xgettext -o po/tazpanel.pot -L Shell -k_ -k_n -k_p:1,2 \
25 --from-code="UTF-8" \
26 --package-name="TazPanel" \
27 --package-version="$(VERSION)" \
28 ./tazpanel ./lib/libtazpanel $(BASECGI) $(EXTRACGI) \
29 ./styles/default/header.html ./styles/default/footer.html
31 msgmerge:
32 @for l in $(LINGUAS); do \
33 echo -n "Updating $$l po file."; \
34 msgmerge -U po/$$l.po po/tazpanel.pot; \
35 done;
37 msgfmt:
38 @for l in $(LINGUAS); do \
39 echo "Compiling $$l mo file..."; \
40 mkdir -p po/mo/$$l/LC_MESSAGES; \
41 msgfmt -o po/mo/$$l/LC_MESSAGES/tazpanel.mo po/$$l.po; \
42 done;
44 # Installation
46 install:
47 mkdir -p \
48 $(DESTDIR)$(PREFIX)/bin \
49 $(DESTDIR)$(PREFIX)/share/locale \
50 $(DESTDIR)$(PREFIX)/share/applications \
51 $(DESTDIR)$(SYSCONFDIR) \
52 $(DESTDIR)$(PANEL)/menu.d \
53 $(DESTDIR)/var/log \
54 $(DESTDIR)$(PANEL)/lib \
55 $(DESTDIR)$(PANEL)/styles/default \
56 $(DESTDIR)$(PANEL)/doc
58 cp -a build/tazpanel $(DESTDIR)$(PREFIX)/bin
59 -[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazpanel
61 cp -a README README.html $(DESTDIR)$(PANEL)
62 cp -a build/tazpanel.*.html $(DESTDIR)$(PANEL)/doc
63 ln -sf tazpanel.en.html $(DESTDIR)$(PANEL)/doc/tazpanel.html
64 cp -a build/libtazpanel build/gz/*.js.gz $(DESTDIR)$(PANEL)/lib
65 cp -a build/gz/*.css.gz build/*.html styles/default/*.ico styles/default/*.ttf $(DESTDIR)$(PANEL)/styles/default
67 @for c in $(BASECGI); do \
68 cp -a build/$$c $(DESTDIR)$(PANEL); \
69 done;
71 if [ -e $(DESTDIR)$(PANEL)/user ] ; then rm -rf $(DESTDIR)$(PANEL)/user; fi
72 ln -s . $(DESTDIR)$(PANEL)/user
74 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
75 cp -a data/*.conf $(DESTDIR)$(SYSCONFDIR)
76 cp -a data/*.desktop $(DESTDIR)$(PREFIX)/share/applications
77 cp -a data/icons $(DESTDIR)$(PREFIX)/share
78 touch $(DESTDIR)/var/log/tazpanel.log
80 @# Remove this when TazWeb will support OpenType ligatures for web-fonts (maybe, after Webkit upgrade?)
81 mkdir -p $(DESTDIR)/usr/share/fonts/TTF
82 ln -fs $(PANEL)/styles/default/tazpanel.ttf $(DESTDIR)/usr/share/fonts/TTF/tazpanel.ttf
84 # TazPanel cache directory, rw access for all
85 install -m 0777 -d $(DESTDIR)/var/cache/tazpanel
88 install_extra:
89 mkdir -p \
90 $(DESTDIR)$(PANEL)/menu.d/boot \
91 $(DESTDIR)$(PANEL)/menu.d/hardware \
92 $(DESTDIR)/usr/bin
93 @for c in $(EXTRACGI); do \
94 cp -a build/$$c $(DESTDIR)$(PANEL); \
95 done;
96 cp -a build/bootloader $(DESTDIR)/usr/bin
97 ln -sf ../../floppy.cgi $(DESTDIR)$(PANEL)/menu.d/boot/floppy
98 ln -sf ../../powersaving.cgi $(DESTDIR)$(PANEL)/menu.d/hardware/powersaving
100 # Clean source
102 clean:
103 rm -rf build
104 rm -rf po/mo
105 rm -f po/*.mo
106 rm -f po/*.*~
108 help:
109 @echo "make [ pot | msgmerge | msgfmt | all | install | clean ]"