2018-01-15 15:43:34 +03:00
LINGUAS = de it fr ja es sv ru tr zh_CN da ca pl sl nb nn pt_BR eu fa gl hu
2017-10-02 08:31:35 +03:00
VERSION = 1.0
2017-10-04 13:14:22 +03:00
PKGREL = 2
2017-10-02 08:31:35 +03:00
PVE_I18N_DEB = pve-i18n_${ VERSION } -${ PKGREL } _all.deb
PMG_I18N_DEB = pmg-i18n_${ VERSION } -${ PKGREL } _all.deb
DEBS = ${ PMG_I18N_DEB } ${ PVE_I18N_DEB }
PMGLOCALEDIR = ${ DESTDIR } /usr/share/pmg-i18n
PVELOCALEDIR = ${ DESTDIR } /usr/share/pve-i18n
PMG_LANG_FILES = $( patsubst %, pmg-lang-%.js, $( LINGUAS) )
PVE_LANG_FILES = $( patsubst %, pve-lang-%.js, $( LINGUAS) )
2017-10-03 16:11:39 +03:00
all : | submodule
2017-10-02 08:31:35 +03:00
.PHONY : deb
deb : $( DEBS )
2017-10-03 16:11:39 +03:00
$(DEBS) : | submodule
2017-10-02 08:31:35 +03:00
rm -rf dest
mkdir dest
rsync -a debian dest
make DESTDIR = dest install
cd dest; dpkg-buildpackage -b -us -uc
lintian ${ PMG_I18N_DEB }
lintian ${ PVE_I18N_DEB }
2017-10-03 16:11:39 +03:00
.PHONY : submodule
submodule :
2017-12-14 14:52:22 +03:00
test -f "pmg-gui/Makefile" || git submodule update --init
2017-10-03 16:11:39 +03:00
2017-10-02 08:31:35 +03:00
.PHONY : install
install : ${PMG_LANG_FILES } ${PVE_LANG_FILES }
install -d ${ PMGLOCALEDIR }
install -m 0644 ${ PMG_LANG_FILES } ${ PMGLOCALEDIR }
install -d ${ PVELOCALEDIR }
install -m 0644 ${ PVE_LANG_FILES } ${ PVELOCALEDIR }
pmg-lang-%.js : proxmox -widget -toolkit -%.po proxmox -mailgateway -%.po
2017-10-02 13:15:11 +03:00
./po2js.pl -o pmg-lang-$* .js $?
2017-10-02 08:31:35 +03:00
pve-lang-%.js : proxmox -widget -toolkit -%.po pve -manager -%.po
2017-10-02 13:15:11 +03:00
./po2js.pl -o pve-lang-$* .js $?
2017-10-02 08:31:35 +03:00
.PHONY : update
update :
2017-10-02 13:46:36 +03:00
./jsgettext.pl -p "proxmox-widget-toolkit 1.0" -o proxmox-widget-toolkit.pot proxmox-widget-toolkit/
2017-12-14 14:52:22 +03:00
./jsgettext.pl -p "proxmox-mailgateway 5.0" -o proxmox-mailgateway.pot -b proxmox-widget-toolkit.pot pmg-gui/js/
2017-10-02 13:46:36 +03:00
./jsgettext.pl -p "pve-manager 5.0" -o pve-manager.pot -b proxmox-widget-toolkit.pot pve-manager/www/manager6/
2017-10-02 08:31:35 +03:00
for j in proxmox-widget-toolkit proxmox-mailgateway pve-manager; do for i in $( LINGUAS) ; do echo -n " $$ j- $$ i: " ; msgmerge -s -v $$ j-$$ i.po $$ j.pot >$$ j-$$ i.po.tmp && mv $$ j-$$ i.po.tmp $$ j-$$ i.po; done ; done
# try to generate po files when someone add a new language
2017-10-02 13:24:49 +03:00
.SECONDARY : # do not delete generated intermediate file
proxmox-widget-toolkit-%.po : proxmox -widget -toolkit .pot
msginit -i proxmox-widget-toolkit.pot -l $* -o proxmox-widget-toolkit-$* .po
.SECONDARY : # do not delete generated intermediate file
proxmox-mailgateway-%.po : proxmox -mailgateway .pot
msginit -i proxmox-mailgateway.pot -l $* -o proxmox-mailgateway-$* .po
.SECONDARY : # do not delete generated intermediate file
2017-10-02 13:46:36 +03:00
pve-manager-%.po : pve -manager .pot
2017-10-02 13:24:49 +03:00
msginit -i pve-manager.pot -l $* -o pve-manager-$* .po
2017-10-02 08:31:35 +03:00
2017-10-04 11:28:34 +03:00
.PHONY : distclean
distclean : clean
2017-10-02 08:31:35 +03:00
.PHONY : clean
clean :
find . -name '*~' -exec rm { } ';'
rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes pve-lang-*.js pmg-lang-*.js
2017-10-04 11:28:34 +03:00
.PHONY : upload -pve
upload-pve : ${PVE_I 18N_DEB }
2017-10-04 11:39:14 +03:00
tar cf - ${ PVE_I18N_DEB } | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch
2017-10-04 11:28:34 +03:00
.PHONY : upload -pmg
upload-pmg : ${PMG_I 18N_DEB }
2017-10-04 11:39:14 +03:00
tar cf - ${ PMG_I18N_DEB } | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch