-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
85 lines (69 loc) · 2.44 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Makefile for SliTaz Bugs.
#
PACKAGE=slitaz-base
PREFIX?=/usr
LINGUAS?=ca de el es fa fr it ja pl pt_BR ru sv vi zh_CN zh_TW
all: help
help:
@echo "make [pot|msgmerge|msgfmt|install-libtaz|install-msg|install|clean]"
# i18n
pot:
xgettext -o po/$(PACKAGE).pot -L Shell --package-name="SliTaz Base" \
--copyright-holder="SliTaz" -k -k_ -klgettext -cTranslators \
./rootfs/lib/libtaz.sh
xgettext -j -o po/$(PACKAGE).pot -L Shell --package-name="SliTaz Base" \
--copyright-holder="SliTaz" -k_ -k_n -cTranslators \
./rootfs/usr/lib/slitaz/libpkg.sh \
./rootfs/var/www/cgi-bin/cgi-env.sh \
./rootfs/var/www/cgi-bin/index.cgi \
./rootfs/usr/bin/man
msgmerge:
@for l in $(LINGUAS); do \
echo -n "Updating $$l po file."; \
msgmerge -U po/$$l.po po/$(PACKAGE).pot; \
done;
msgfmt:
@for l in $(LINGUAS); do \
echo "Compiling $$l mo file..."; \
mkdir -p po/mo/$$l/LC_MESSAGES; \
msgfmt -o po/mo/$$l/LC_MESSAGES/$(PACKAGE).mo po/$$l.po; \
done;
# Install
install-libtaz:
install -m 0744 rootfs/lib/libtaz.sh $(DESTDIR)/lib
# Strip comments addressed to translators
sed -i '/# Translators:/d' $(DESTDIR)/lib/libtaz.sh
install -m 0755 -d $(DESTDIR)/usr/share/doc/slitaz
install -m 0644 doc/libtaz.txt $(DESTDIR)/usr/share/doc/slitaz
install-httphelper:
install -m 0744 rootfs/usr/lib/slitaz/httphelper.sh \
$(DESTDIR)/usr/lib/slitaz
install -m 0755 -d $(DESTDIR)/usr/share/doc/slitaz
install -m 0644 doc/httphelper.txt $(DESTDIR)/usr/share/doc/slitaz
install-libpkg:
install -m 0755 -d $(DESTDIR)/usr/lib/slitaz
install -m 0755 -d $(DESTDIR)/usr/share/doc/slitaz
install -m 0744 rootfs/usr/lib/slitaz/libpkg.sh \
$(DESTDIR)/usr/lib/slitaz
install -m 0644 doc/libpkg.txt $(DESTDIR)/usr/share/doc/slitaz
install-slitaz:
install -m 0755 -d $(DESTDIR)/usr/bin
install -m 0755 -d $(DESTDIR)/etc/slitaz
install -m 0744 rootfs/usr/bin/slitaz $(DESTDIR)/usr/bin
install -m 0644 rootfs/etc/slitaz/slitaz.conf $(DESTDIR)/etc/slitaz
install-msg: msgfmt
install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
install: install-msg
cp -a rootfs/* $(DESTDIR)/
# strip "man" script
sed -i '/^[^#]*$$/,$${s|^\t*||;/^ *#/d;/^$$/d}' $(DESTDIR)/usr/bin/man
install -m 0755 -d $(DESTDIR)/usr/share/doc/slitaz
cp -a doc/* $(DESTDIR)/usr/share/doc/slitaz
chown -R root:root $(DESTDIR)/usr/share/doc/slitaz
# Clean source
clean:
rm -rf po/mo
rm -f po/*~
rm -f po/*.mo
rm -f po/*~ $(PACKAGE)*.tar.gz $(PACKAGE)*.md5