slitaz-tools view Makefile @ rev 1037

tazbox: lxpolkit support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 23 10:41:01 2021 +0000 (2021-10-23)
parents 2e8f6a09785c
children
line source
1 # Makefile for SliTaz tools.
2 # Check the README for more information.
3 #
4 PREFIX?=/usr
5 DOCDIR?=/usr/share/doc
6 DESTDIR?=
8 PROJECTS=slitaz-tools slitaz-boxes tazbox tazdrop
9 LINGUAS=de el es fa fr it ja pl pt_BR ru sv vi zh_CN zh_TW
11 all: msgfmt
13 help:
14 @echo ""
15 @echo "make: pot msgmerge msgfmt install install-boxes clean"
16 @echo ""
18 # i18n.
20 tools-pot:
21 @echo -n "Generating SliTaz Tools pot file... "
22 @xgettext -o po/slitaz-tools/slitaz-tools.pot -L Shell -k_ -k_n \
23 --package-name="SliTaz Tools" \
24 ./tinyutils/tazlocale ./tinyutils/tazkeymap ./tinyutils/setmixer \
25 ./tinyutils/tazx ./tinyutils/decode ./tinyutils/terminal \
26 ./tinyutils/hwsetup ./tinyutils/frugal ./tinyutils/slitaz-config
27 @echo "done"
29 boxes-pot:
30 @echo -n "Generating SliTaz Boxes pot file... "
31 @xgettext -o po/slitaz-boxes/slitaz-boxes.pot -L Shell -k_ -k_n \
32 --package-name="SliTaz Boxes" \
33 ./boxes/wifi-box ./boxes/burn-box ./boxes/scp-box
34 @echo "done"
36 tazbox-pot:
37 @echo -n "Generating tazbox pot file... "
38 @xgettext -o po/tazbox/tazbox.pot -L Shell -k -k_ -k_n \
39 --package-name="TazBox" ./tazbox/tazbox
40 @echo "done"
42 tazdrop-pot:
43 @echo -n "Generating tazdrop pot file... "
44 @xgettext -o po/tazdrop/tazdrop.pot -L Shell -k_ -k_n \
45 --package-name="TazDrop" ./tazdrop/tazdrop
46 @echo "done"
48 pot: tools-pot boxes-pot tazbox-pot tazdrop-pot
50 msgmerge:
51 @for p in $(PROJECTS); do \
52 for l in $(LINGUAS); do \
53 if [ -f "po/$$p/$$l.po" ]; then \
54 echo "Updating $$p $$l po file."; \
55 msgmerge -U po/$$p/$$l.po po/$$p/$$p.pot; \
56 fi; \
57 done; \
58 done;
60 msgfmt:
61 @for p in $(PROJECTS); do \
62 for l in $(LINGUAS); do \
63 if [ -f "po/$$p/$$l.po" ]; then \
64 echo -e "Compiling $$p $$l mo file...\n"; \
65 mkdir -p po/mo/$$l; \
66 msgfmt -o po/mo/$$l/$$p.mo po/$$p/$$l.po; \
67 fi; \
68 done; \
69 done;
71 # Installation
73 install:
74 install -m 0755 -d $(DESTDIR)/sbin
75 install -m 0755 -d $(DESTDIR)/etc
76 install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
77 install -m 0755 -d $(DESTDIR)$(PREFIX)/sbin
78 install -m 0755 -d $(DESTDIR)$(DOCDIR)/slitaz
79 cp -a etc $(DESTDIR)/
81 # Licenses
82 cp -a licenses $(DESTDIR)$(PREFIX)/share
84 # /sbin tools.
85 for i in slitaz-config tazlocale tazkeymap tazhw hwsetup; do \
86 install -m 0755 tinyutils/$$i $(DESTDIR)/sbin; \
87 done;
89 # Declare all config files.
90 for file in etc/locale.conf etc/keymap.conf etc/TZ; do \
91 touch $(DESTDIR)/$$file; \
92 done;
94 # /usr/bin tools.
95 for app in tazx startx history editor browser terminal file-manager \
96 decode frugal startd stopd; do \
97 install -m 0755 tinyutils/$$app $(DESTDIR)$(PREFIX)/bin; \
98 done;
100 # sdt
101 install -m 0755 sdt/sdt $(DESTDIR)$(PREFIX)/bin
103 # /usr/sbin sound tools.
104 #install -m 0755 tinyutils/soundconf $(DESTDIR)$(PREFIX)/sbin
105 install -m 0755 tinyutils/setmixer $(DESTDIR)$(PREFIX)/sbin
107 # slitaz-tools i18n
108 for l in $(LINGUAS); do \
109 if [ -f "po/mo/$$l/slitaz-tools.mo" ]; then \
110 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
111 install -m 0644 po/mo/$$l/slitaz-tools.mo \
112 $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
113 fi; \
114 done;
116 # Documentation
117 cp doc/post-install.txt $(DESTDIR)$(DOCDIR)/slitaz
118 # Permissions
119 chmod +x $(DESTDIR)/etc/init.d/*
121 install-boxes:
122 install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
123 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
124 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/applications
125 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/pixmaps
126 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/zoneinfo
128 install -m 0755 boxes/* $(DESTDIR)$(PREFIX)/bin
129 install -m 0755 tazbox/tazbox $(DESTDIR)$(PREFIX)/bin
130 install -m 0755 tinyutils/subox $(DESTDIR)$(PREFIX)/bin
132 # Desktop files and icons.
133 install -m 0644 applications/* $(DESTDIR)$(PREFIX)/share/applications
134 install -m 0644 pixmaps/* $(DESTDIR)$(PREFIX)/share/pixmaps
136 # i18n.
137 for l in $(LINGUAS); do \
138 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
139 install -m 0644 po/mo/$$l/*box* \
140 $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \
141 done;
143 # Gksu fake for pcmanfm.
144 cd $(DESTDIR)$(PREFIX)/bin && ln -fs subox gksu
146 clean:
147 rm -rf po/mo
148 rm -f po/*/*.po~
149 rm -f po/*/*.mo