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