]>
Commit | Line | Data |
---|---|---|
5c0bd157 | 1 | include /usr/share/dpkg/pkg-info.mk |
3f7b1143 | 2 | |
5c0bd157 | 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 |
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 | |
3f7b1143 | 7 | |
4ee74b5e WB |
8 | DEB1=${PMG_I18N_DEB} |
9 | DEB2=$(PVE_I18N_DEB) | |
10 | DEBS=$(DEB1) $(DEB2) | |
3f7b1143 DM |
11 | |
12 | PMGLOCALEDIR=${DESTDIR}/usr/share/pmg-i18n | |
13 | PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n | |
14 | ||
15 | PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS)) | |
16 | PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS)) | |
17 | ||
ee60f2d8 | 18 | all: |
3f7b1143 DM |
19 | |
20 | .PHONY: deb | |
21 | deb: $(DEBS) | |
4ee74b5e WB |
22 | $(DEB2): $(DEB1) |
23 | $(DEB1): | submodule | |
3f7b1143 | 24 | rm -rf dest |
ee60f2d8 | 25 | rsync -a * dest |
3f7b1143 | 26 | cd dest; dpkg-buildpackage -b -us -uc |
ee60f2d8 | 27 | lintian $(DEBS) |
3f7b1143 | 28 | |
42d82cd2 DM |
29 | .PHONY: submodule |
30 | submodule: | |
80273b30 | 31 | test -f "pmg-gui/Makefile" || git submodule update --init |
42d82cd2 | 32 | |
3f7b1143 | 33 | .PHONY: install |
ee60f2d8 | 34 | install: ${PMG_LANG_FILES} ${PVE_LANG_FILES} |
3f7b1143 DM |
35 | install -d ${PMGLOCALEDIR} |
36 | install -m 0644 ${PMG_LANG_FILES} ${PMGLOCALEDIR} | |
37 | install -d ${PVELOCALEDIR} | |
38 | install -m 0644 ${PVE_LANG_FILES} ${PVELOCALEDIR} | |
39 | ||
40 | ||
c1ae7daa DC |
41 | pmg-lang-%.js: %.po |
42 | ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $? | |
3f7b1143 | 43 | |
c1ae7daa DC |
44 | pve-lang-%.js: %.po |
45 | ./po2js.pl -t pve -v "${VERSION}-${PKGREL}" -o pve-lang-$*.js $? | |
46 | ||
47 | # parameter 1 is the name | |
48 | # parameter 2 is the directory | |
49 | define potupdate | |
50 | ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2) | |
51 | endef | |
3f7b1143 | 52 | |
ee60f2d8 TL |
53 | .PHONY: update update_pot |
54 | update_pot: submodule | |
c1ae7daa DC |
55 | git submodule foreach 'git pull --ff-only origin master' |
56 | $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/) | |
57 | $(call potupdate,pve-manager,pve-manager/www/manager6/) | |
58 | $(call potupdate,proxmox-mailgateway,pmg-gui/js/) | |
ee60f2d8 TL |
59 | |
60 | update: | update_pot messages.pot | |
c1ae7daa | 61 | 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 | 62 | |
ee60f2d8 TL |
63 | init-%.po: messages.pot |
64 | msginit -i $^ -l $^ -o $*.po --no-translator | |
65 | ||
66 | .INTERMEDIATE: messages.pot | |
67 | messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot | |
68 | msgcat $^ > $@ | |
cbc629ce DM |
69 | |
70 | .PHONY: distclean | |
71 | distclean: clean | |
72 | ||
3f7b1143 DM |
73 | .PHONY: clean |
74 | clean: | |
75 | find . -name '*~' -exec rm {} ';' | |
ee60f2d8 | 76 | rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes *.js messages.pot |
cbc629ce DM |
77 | |
78 | .PHONY: upload-pve | |
79 | upload-pve: ${PVE_I18N_DEB} | |
ded3002e | 80 | tar cf - ${PVE_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch |
cbc629ce DM |
81 | |
82 | .PHONY: upload-pmg | |
83 | upload-pmg: ${PMG_I18N_DEB} | |
ded3002e | 84 | tar cf - ${PMG_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch |