]>
Commit | Line | Data |
---|---|---|
e829fe4c | 1 | LINGUAS=de it fr ja es sv ru tr zh_CN da ca pl sl nb nn pt_BR eu fa gl hu |
3f7b1143 DM |
2 | |
3 | VERSION=1.0 | |
f6d19e5a | 4 | PKGREL=2 |
3f7b1143 DM |
5 | |
6 | PVE_I18N_DEB=pve-i18n_${VERSION}-${PKGREL}_all.deb | |
7 | PMG_I18N_DEB=pmg-i18n_${VERSION}-${PKGREL}_all.deb | |
8 | ||
9 | DEBS=${PMG_I18N_DEB} ${PVE_I18N_DEB} | |
10 | ||
11 | PMGLOCALEDIR=${DESTDIR}/usr/share/pmg-i18n | |
12 | PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n | |
13 | ||
14 | PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS)) | |
15 | PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS)) | |
16 | ||
42d82cd2 | 17 | all: | submodule |
3f7b1143 DM |
18 | |
19 | .PHONY: deb | |
20 | deb: $(DEBS) | |
42d82cd2 | 21 | $(DEBS): | submodule |
3f7b1143 DM |
22 | rm -rf dest |
23 | mkdir dest | |
24 | rsync -a debian dest | |
25 | make DESTDIR=dest install | |
26 | cd dest; dpkg-buildpackage -b -us -uc | |
27 | lintian ${PMG_I18N_DEB} | |
28 | lintian ${PVE_I18N_DEB} | |
29 | ||
42d82cd2 DM |
30 | .PHONY: submodule |
31 | submodule: | |
80273b30 | 32 | test -f "pmg-gui/Makefile" || git submodule update --init |
42d82cd2 | 33 | |
3f7b1143 DM |
34 | .PHONY: install |
35 | install: ${PMG_LANG_FILES} ${PVE_LANG_FILES} | |
36 | install -d ${PMGLOCALEDIR} | |
37 | install -m 0644 ${PMG_LANG_FILES} ${PMGLOCALEDIR} | |
38 | install -d ${PVELOCALEDIR} | |
39 | install -m 0644 ${PVE_LANG_FILES} ${PVELOCALEDIR} | |
40 | ||
41 | ||
c1ae7daa DC |
42 | pmg-lang-%.js: %.po |
43 | ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $? | |
3f7b1143 | 44 | |
c1ae7daa DC |
45 | pve-lang-%.js: %.po |
46 | ./po2js.pl -t pve -v "${VERSION}-${PKGREL}" -o pve-lang-$*.js $? | |
47 | ||
48 | # parameter 1 is the name | |
49 | # parameter 2 is the directory | |
50 | define potupdate | |
51 | ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2) | |
52 | endef | |
3f7b1143 DM |
53 | |
54 | .PHONY: update | |
55 | update: | |
c1ae7daa DC |
56 | git submodule foreach 'git pull --ff-only origin master' |
57 | $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/) | |
58 | $(call potupdate,pve-manager,pve-manager/www/manager6/) | |
59 | $(call potupdate,proxmox-mailgateway,pmg-gui/js/) | |
60 | msgcat proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot > messages.pot.tmp | |
61 | mv messages.pot.tmp messages.pot | |
62 | for i in $(LINGUAS); do echo -n "$$i: "; msgmerge -s -v $$i.po messages.pot >$$i.po.tmp && mv $$i.po.tmp $$i.po; done; | |
63 | rm messages.pot | |
3f7b1143 DM |
64 | |
65 | # try to generate po files when someone add a new language | |
62c8fdde | 66 | .SECONDARY: # do not delete generated intermediate file |
c1ae7daa DC |
67 | %.po: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot |
68 | msgcat $+ > $*.pot | |
69 | msginit -i $*.pot -l $* -o $*.po | |
70 | rm $*.pot | |
cbc629ce DM |
71 | |
72 | .PHONY: distclean | |
73 | distclean: clean | |
74 | ||
3f7b1143 DM |
75 | .PHONY: clean |
76 | clean: | |
77 | find . -name '*~' -exec rm {} ';' | |
78 | rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes pve-lang-*.js pmg-lang-*.js | |
cbc629ce DM |
79 | |
80 | .PHONY: upload-pve | |
81 | upload-pve: ${PVE_I18N_DEB} | |
ded3002e | 82 | tar cf - ${PVE_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch |
cbc629ce DM |
83 | |
84 | .PHONY: upload-pmg | |
85 | upload-pmg: ${PMG_I18N_DEB} | |
ded3002e | 86 | tar cf - ${PMG_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch |