tazpanel view Makefile @ rev 520

PROVIDE support in package list report
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 04 11:16:14 2015 +0200 (2015-08-04)
parents d7b7403d5f2a
children 5323427d34b9
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 settings.cgi
9 EXTRACGI?=floppy.cgi powersaving.cgi
11 VERSION:=$(shell grep ^VERSION tazpanel | cut -d '=' -f 2)
13 all: msgfmt
15 # i18n
17 pot:
18 xgettext -o po/tazpanel.pot -L Shell -k_ -k_n -k_p:1,2 \
19 --from-code="UTF-8" \
20 --package-name="TazPanel" \
21 --package-version="$(VERSION)" \
22 ./tazpanel ./index.cgi ./network.cgi ./boot.cgi \
23 ./hardware.cgi ./settings.cgi ./lib/libtazpanel ./help.cgi \
24 ./styles/default/header.html ./styles/default/footer.html
26 msgmerge:
27 @for l in $(LINGUAS); do \
28 echo -n "Updating $$l po file."; \
29 msgmerge -U po/$$l.po po/tazpanel.pot; \
30 done;
32 msgfmt:
33 @for l in $(LINGUAS); do \
34 echo "Compiling $$l mo file..."; \
35 mkdir -p po/mo/$$l/LC_MESSAGES; \
36 msgfmt -o po/mo/$$l/LC_MESSAGES/tazpanel.mo po/$$l.po; \
37 done;
39 # Installation
41 install:
42 mkdir -p \
43 $(DESTDIR)$(PREFIX)/bin \
44 $(DESTDIR)$(PREFIX)/share/locale \
45 $(DESTDIR)$(PREFIX)/share/applications \
46 $(DESTDIR)$(SYSCONFDIR) \
47 $(DESTDIR)$(PANEL)/menu.d \
48 $(DESTDIR)/var/log
49 cp -a tazpanel $(DESTDIR)$(PREFIX)/bin
50 -[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazpanel
51 cp -a lib/ styles/ doc/ README* $(DESTDIR)$(PANEL)
52 @for c in $(BASECGI); do \
53 cp -a $$c $(DESTDIR)$(PANEL); \
54 done;
55 if [ -e $(DESTDIR)$(PANEL)/user ] ; then rm -rf $(DESTDIR)$(PANEL)/user; fi
56 ln -s . $(DESTDIR)$(PANEL)/user
57 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
58 cp -a data/*.conf $(DESTDIR)$(SYSCONFDIR)
59 cp -a data/*.desktop $(DESTDIR)$(PREFIX)/share/applications
60 cp -a data/icons $(DESTDIR)$(PREFIX)/share
61 touch $(DESTDIR)/var/log/tazpanel.log
63 @# Clean comments in production release
64 sed -i '/^\t*\/\//d' $(DESTDIR)$(PANEL)/lib/tazpanel.js
66 @# Remove this when TazWeb will support OpenType ligatures for web-fonts (maybe, after Webkit upgrade?)
67 mkdir -p $(DESTDIR)/usr/share/fonts/TTF
68 ln -fs $(PANEL)/styles/default/tazpanel.ttf $(DESTDIR)/usr/share/fonts/TTF/tazpanel.ttf
70 install_extra:
71 mkdir -p \
72 $(DESTDIR)$(PANEL)/menu.d/boot \
73 $(DESTDIR)$(PANEL)/menu.d/hardware \
74 $(DESTDIR)/usr/bin
75 @for c in $(EXTRACGI); do \
76 cp -a $$c $(DESTDIR)$(PANEL); \
77 done;
78 cp -a bootloader $(DESTDIR)/usr/bin
79 ln -s ../../floppy.cgi $(DESTDIR)$(PANEL)/menu.d/boot/floppy
80 ln -s ../../powersaving.cgi $(DESTDIR)$(PANEL)/menu.d/hardware/powersaving
82 # Clean source
84 clean:
85 rm -rf po/mo
86 rm -f po/*.mo
87 rm -f po/*.*~
89 help:
90 @echo "make [ pot | msgmerge | msgfmt | all | install | clean ]"