]>
Commit | Line | Data |
---|---|---|
1 | include /usr/share/dpkg/pkg-info.mk | |
2 | ||
3 | LINGUAS=de it fr ja es sv ru tr zh_CN zh_TW da ca pl sl nb nn pt_BR eu fa gl hu he ar nl kr | |
4 | ||
5 | PVE_I18N_DEB=pve-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb | |
6 | PMG_I18N_DEB=pmg-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb | |
7 | PBS_I18N_DEB=pbs-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb | |
8 | ||
9 | DEBS=${PMG_I18N_DEB} $(PVE_I18N_DEB) $(PBS_I18N_DEB) | |
10 | ||
11 | PMGLOCALEDIR=${DESTDIR}/usr/share/pmg-i18n | |
12 | PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n | |
13 | PBSLOCALEDIR=${DESTDIR}/usr/share/pbs-i18n | |
14 | ||
15 | PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS)) | |
16 | PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS)) | |
17 | PBS_LANG_FILES=$(patsubst %, pbs-lang-%.js, $(LINGUAS)) | |
18 | ||
19 | all: | |
20 | ||
21 | .PHONY: deb | |
22 | deb: $(DEBS) | |
23 | $(PMG_I18N_DEB): $(PVE_I18N_DEB) | |
24 | $(PBS_I18N_DEB): $(PVE_I18N_DEB) | |
25 | $(PVE_I18N_DEB): | submodule | |
26 | rm -rf dest | |
27 | rsync -a * dest | |
28 | cd dest; dpkg-buildpackage -b -us -uc | |
29 | lintian $(DEBS) | |
30 | ||
31 | .PHONY: submodule | |
32 | submodule: | |
33 | test -f pmg-gui/Makefile -a -f proxmox-backup/Makefile -a -f pve-manager/Makefile \ | |
34 | || git submodule update --init | |
35 | ||
36 | .PHONY: install | |
37 | install: ${PMG_LANG_FILES} ${PVE_LANG_FILES} ${PBS_LANG_FILES} | |
38 | install -d ${PMGLOCALEDIR} | |
39 | install -m 0644 ${PMG_LANG_FILES} ${PMGLOCALEDIR} | |
40 | install -d ${PVELOCALEDIR} | |
41 | install -m 0644 ${PVE_LANG_FILES} ${PVELOCALEDIR} | |
42 | install -d ${PBSLOCALEDIR} | |
43 | install -m 0644 ${PBS_LANG_FILES} ${PBSLOCALEDIR} | |
44 | ||
45 | pmg-lang-%.js: %.po | |
46 | ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $? | |
47 | ||
48 | pve-lang-%.js: %.po | |
49 | ./po2js.pl -t pve -v "${VERSION}-${PKGREL}" -o pve-lang-$*.js $? | |
50 | ||
51 | pbs-lang-%.js: %.po | |
52 | ./po2js.pl -t pbs -v "${VERSION}-${PKGREL}" -o pbs-lang-$*.js $? | |
53 | ||
54 | # parameter 1 is the name | |
55 | # parameter 2 is the directory | |
56 | define potupdate | |
57 | ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2) | |
58 | endef | |
59 | ||
60 | .PHONY: update update_pot do_update | |
61 | update_pot: submodule | |
62 | $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/) | |
63 | $(call potupdate,pve-manager,pve-manager/www/manager6/) | |
64 | $(call potupdate,proxmox-mailgateway,pmg-gui/js/) | |
65 | $(call potupdate,proxmox-backup,proxmox-backup/www/) | |
66 | ||
67 | do_update: | |
68 | $(MAKE) update_pot | |
69 | $(MAKE) messages.pot | |
70 | 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; | |
71 | ||
72 | update: | |
73 | git submodule foreach 'git pull --ff-only origin master' | |
74 | $(MAKE) do_update | |
75 | ||
76 | stats: | |
77 | @for i in $(LINGUAS); do echo -n "$$i: "; msgfmt --statistics -o /dev/null $$i.po; done | |
78 | ||
79 | init-%.po: messages.pot | |
80 | msginit -i $^ -l $^ -o $*.po --no-translator | |
81 | ||
82 | .INTERMEDIATE: messages.pot | |
83 | messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot proxmox-backup.pot | |
84 | msgcat $^ > $@ | |
85 | ||
86 | .PHONY: distclean | |
87 | distclean: clean | |
88 | ||
89 | .PHONY: clean | |
90 | clean: | |
91 | find . -name '*~' -exec rm {} ';' | |
92 | rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes *.js messages.pot | |
93 | ||
94 | .PHONY: upload-pve upload-pmg upload-pbs upload | |
95 | upload-pve: ${PVE_I18N_DEB} | |
96 | tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye | |
97 | upload-pmg: ${PMG_I18N_DEB} | |
98 | tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist bullseye | |
99 | upload-pbs: ${PBS_I18N_DEB} | |
100 | tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pbs --dist bullseye | |
101 | ||
102 | upload: upload-pve upload-pmg upload-pbs |