]>
Commit | Line | Data |
---|---|---|
5c0bd157 | 1 | include /usr/share/dpkg/pkg-info.mk |
3f7b1143 | 2 | |
89e1fee7 | 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 |
3f7b1143 | 4 | |
5c0bd157 TL |
5 | PVE_I18N_DEB=pve-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb |
6 | PMG_I18N_DEB=pmg-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb | |
31f04d6b | 7 | PBS_I18N_DEB=pbs-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb |
3f7b1143 | 8 | |
31f04d6b | 9 | DEBS=${PMG_I18N_DEB} $(PVE_I18N_DEB) $(PBS_I18N_DEB) |
3f7b1143 DM |
10 | |
11 | PMGLOCALEDIR=${DESTDIR}/usr/share/pmg-i18n | |
12 | PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n | |
31f04d6b | 13 | PBSLOCALEDIR=${DESTDIR}/usr/share/pbs-i18n |
3f7b1143 DM |
14 | |
15 | PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS)) | |
16 | PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS)) | |
31f04d6b | 17 | PBS_LANG_FILES=$(patsubst %, pbs-lang-%.js, $(LINGUAS)) |
3f7b1143 | 18 | |
ee60f2d8 | 19 | all: |
3f7b1143 DM |
20 | |
21 | .PHONY: deb | |
22 | deb: $(DEBS) | |
31f04d6b TL |
23 | $(PMG_I18N_DEB): $(PVE_I18N_DEB) |
24 | $(PBS_I18N_DEB): $(PVE_I18N_DEB) | |
25 | $(PVE_I18N_DEB): | submodule | |
3f7b1143 | 26 | rm -rf dest |
ee60f2d8 | 27 | rsync -a * dest |
3f7b1143 | 28 | cd dest; dpkg-buildpackage -b -us -uc |
ee60f2d8 | 29 | lintian $(DEBS) |
3f7b1143 | 30 | |
42d82cd2 DM |
31 | .PHONY: submodule |
32 | submodule: | |
80273b30 | 33 | test -f "pmg-gui/Makefile" || git submodule update --init |
42d82cd2 | 34 | |
3f7b1143 | 35 | .PHONY: install |
31f04d6b | 36 | install: ${PMG_LANG_FILES} ${PVE_LANG_FILES} ${PBS_LANG_FILES} |
3f7b1143 DM |
37 | install -d ${PMGLOCALEDIR} |
38 | install -m 0644 ${PMG_LANG_FILES} ${PMGLOCALEDIR} | |
39 | install -d ${PVELOCALEDIR} | |
40 | install -m 0644 ${PVE_LANG_FILES} ${PVELOCALEDIR} | |
31f04d6b TL |
41 | install -d ${PBSLOCALEDIR} |
42 | install -m 0644 ${PBS_LANG_FILES} ${PBSLOCALEDIR} | |
3f7b1143 DM |
43 | |
44 | ||
c1ae7daa DC |
45 | pmg-lang-%.js: %.po |
46 | ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $? | |
3f7b1143 | 47 | |
c1ae7daa DC |
48 | pve-lang-%.js: %.po |
49 | ./po2js.pl -t pve -v "${VERSION}-${PKGREL}" -o pve-lang-$*.js $? | |
50 | ||
31f04d6b TL |
51 | pbs-lang-%.js: %.po |
52 | ./po2js.pl -t pbs -v "${VERSION}-${PKGREL}" -o pbs-lang-$*.js $? | |
53 | ||
c1ae7daa DC |
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 | |
3f7b1143 | 59 | |
ee60f2d8 TL |
60 | .PHONY: update update_pot |
61 | update_pot: submodule | |
c1ae7daa DC |
62 | git submodule foreach 'git pull --ff-only origin master' |
63 | $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/) | |
64 | $(call potupdate,pve-manager,pve-manager/www/manager6/) | |
65 | $(call potupdate,proxmox-mailgateway,pmg-gui/js/) | |
31f04d6b | 66 | $(call potupdate,proxmox-backup,proxmox-backup/www/) |
ee60f2d8 TL |
67 | |
68 | update: | update_pot messages.pot | |
c1ae7daa | 69 | 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; |
3f7b1143 | 70 | |
16b20080 RV |
71 | stats: |
72 | @for i in $(LINGUAS); do echo -n "$$i: "; msgfmt --statistics -o /dev/null $$i.po; done | |
73 | ||
ee60f2d8 TL |
74 | init-%.po: messages.pot |
75 | msginit -i $^ -l $^ -o $*.po --no-translator | |
76 | ||
77 | .INTERMEDIATE: messages.pot | |
31f04d6b | 78 | messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot proxmox-backup.pot |
ee60f2d8 | 79 | msgcat $^ > $@ |
cbc629ce DM |
80 | |
81 | .PHONY: distclean | |
82 | distclean: clean | |
83 | ||
3f7b1143 DM |
84 | .PHONY: clean |
85 | clean: | |
86 | find . -name '*~' -exec rm {} ';' | |
ee60f2d8 | 87 | rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes *.js messages.pot |
cbc629ce | 88 | |
31f04d6b | 89 | .PHONY: upload-pve upload-pmg upload-pbs |
cbc629ce | 90 | upload-pve: ${PVE_I18N_DEB} |
31f04d6b | 91 | tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist buster |
cbc629ce | 92 | upload-pmg: ${PMG_I18N_DEB} |
31f04d6b TL |
93 | tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist buster |
94 | upload-pbs: ${PBS_I18N_DEB} | |
95 | tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pbs --dist buster |