tazpanel view Makefile @ rev 579

Makefile: fix tazpanel-extra files list
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Apr 04 22:08:29 2016 +0200 (2016-04-04)
parents a15373a181ff
children 00f3f95762d4
line source
1 # Makefile for TazPanel.
2 #
3 PREFIX?=/usr
4 SYSCONFDIR?=/etc/slitaz
5 DESTDIR?=
6 LINGUAS?=el es fr pl pt_BR ru sv
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 ./index.cgi ./network.cgi ./hosts.cgi ./boot.cgi \
29 ./hardware.cgi ./settings.cgi ./lib/libtazpanel ./help.cgi \
30 ./floppy.cgi \
31 ./styles/default/header.html ./styles/default/footer.html
33 msgmerge:
34 @for l in $(LINGUAS); do \
35 echo -n "Updating $$l po file."; \
36 msgmerge -U po/$$l.po po/tazpanel.pot; \
37 done;
39 msgfmt:
40 @for l in $(LINGUAS); do \
41 echo "Compiling $$l mo file..."; \
42 mkdir -p po/mo/$$l/LC_MESSAGES; \
43 msgfmt -o po/mo/$$l/LC_MESSAGES/tazpanel.mo po/$$l.po; \
44 done;
46 # Installation
48 install:
49 mkdir -p \
50 $(DESTDIR)$(PREFIX)/bin \
51 $(DESTDIR)$(PREFIX)/share/locale \
52 $(DESTDIR)$(PREFIX)/share/applications \
53 $(DESTDIR)$(SYSCONFDIR) \
54 $(DESTDIR)$(PANEL)/menu.d \
55 $(DESTDIR)/var/log \
56 $(DESTDIR)$(PANEL)/lib \
57 $(DESTDIR)$(PANEL)/styles/default \
58 $(DESTDIR)$(PANEL)/doc
60 cp -a build/tazpanel $(DESTDIR)$(PREFIX)/bin
61 -[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazpanel
63 cp -a README README.html $(DESTDIR)$(PANEL)
64 cp -a build/tazpanel.*.html $(DESTDIR)$(PANEL)/doc
65 ln -sf tazpanel.en.html $(DESTDIR)$(PANEL)/doc/tazpanel.html
66 cp -a build/libtazpanel build/gz/*.js.gz $(DESTDIR)$(PANEL)/lib
67 cp -a build/gz/*.css.gz build/*.html styles/default/*.ico styles/default/*.ttf $(DESTDIR)$(PANEL)/styles/default
69 @for c in $(BASECGI); do \
70 cp -a build/$$c $(DESTDIR)$(PANEL); \
71 done;
73 if [ -e $(DESTDIR)$(PANEL)/user ] ; then rm -rf $(DESTDIR)$(PANEL)/user; fi
74 ln -s . $(DESTDIR)$(PANEL)/user
76 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
77 cp -a data/*.conf $(DESTDIR)$(SYSCONFDIR)
78 cp -a data/*.desktop $(DESTDIR)$(PREFIX)/share/applications
79 cp -a data/icons $(DESTDIR)$(PREFIX)/share
80 touch $(DESTDIR)/var/log/tazpanel.log
82 @# Remove this when TazWeb will support OpenType ligatures for web-fonts (maybe, after Webkit upgrade?)
83 mkdir -p $(DESTDIR)/usr/share/fonts/TTF
84 ln -fs $(PANEL)/styles/default/tazpanel.ttf $(DESTDIR)/usr/share/fonts/TTF/tazpanel.ttf
86 # TazPanel cache directory, rw access for all
87 install -m 0777 -d $(DESTDIR)/var/cache/tazpanel
90 install_extra:
91 mkdir -p \
92 $(DESTDIR)$(PANEL)/menu.d/boot \
93 $(DESTDIR)$(PANEL)/menu.d/hardware \
94 $(DESTDIR)/usr/bin
95 @for c in $(EXTRACGI); do \
96 cp -a build/$$c $(DESTDIR)$(PANEL); \
97 done;
98 cp -a build/bootloader $(DESTDIR)/usr/bin
99 ln -sf ../../floppy.cgi $(DESTDIR)$(PANEL)/menu.d/boot/floppy
100 ln -sf ../../powersaving.cgi $(DESTDIR)$(PANEL)/menu.d/hardware/powersaving
102 # Clean source
104 clean:
105 rm -rf build
106 rm -rf po/mo
107 rm -f po/*.mo
108 rm -f po/*.*~
110 help:
111 @echo "make [ pot | msgmerge | msgfmt | all | install | clean ]"