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