]> git.proxmox.com Git - proxmox-i18n.git/blob - Makefile
bump version to 1.0-4
[proxmox-i18n.git] / Makefile
1 LINGUAS=de it fr ja es sv ru tr zh_CN da ca pl sl nb nn pt_BR eu fa gl hu
2
3 VERSION=1.0
4 PKGREL=4
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
17 all:
18
19 .PHONY: deb
20 deb: $(DEBS)
21 $(DEBS): | submodule
22 rm -rf dest
23 rsync -a * dest
24 cd dest; dpkg-buildpackage -b -us -uc
25 lintian $(DEBS)
26
27 .PHONY: submodule
28 submodule:
29 test -f "pmg-gui/Makefile" || git submodule update --init
30
31 .PHONY: install
32 install: ${PMG_LANG_FILES} ${PVE_LANG_FILES}
33 install -d ${PMGLOCALEDIR}
34 install -m 0644 ${PMG_LANG_FILES} ${PMGLOCALEDIR}
35 install -d ${PVELOCALEDIR}
36 install -m 0644 ${PVE_LANG_FILES} ${PVELOCALEDIR}
37
38
39 pmg-lang-%.js: %.po
40 ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $?
41
42 pve-lang-%.js: %.po
43 ./po2js.pl -t pve -v "${VERSION}-${PKGREL}" -o pve-lang-$*.js $?
44
45 # parameter 1 is the name
46 # parameter 2 is the directory
47 define potupdate
48 ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2)
49 endef
50
51 .PHONY: update update_pot
52 update_pot: submodule
53 git submodule foreach 'git pull --ff-only origin master'
54 $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/)
55 $(call potupdate,pve-manager,pve-manager/www/manager6/)
56 $(call potupdate,proxmox-mailgateway,pmg-gui/js/)
57
58 update: | update_pot messages.pot
59 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;
60
61 init-%.po: messages.pot
62 msginit -i $^ -l $^ -o $*.po --no-translator
63
64 .INTERMEDIATE: messages.pot
65 messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot
66 msgcat $^ > $@
67
68 .PHONY: distclean
69 distclean: clean
70
71 .PHONY: clean
72 clean:
73 find . -name '*~' -exec rm {} ';'
74 rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes *.js messages.pot
75
76 .PHONY: upload-pve
77 upload-pve: ${PVE_I18N_DEB}
78 tar cf - ${PVE_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch
79
80 .PHONY: upload-pmg
81 upload-pmg: ${PMG_I18N_DEB}
82 tar cf - ${PMG_I18N_DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch