2019-05-22 21:54:40 +03:00
i n c l u d e / u s r / s h a r e / d p k g / p k g - i n f o . m k
2017-10-02 08:31:35 +03:00
2023-03-27 16:32:10 +03:00
LINGUAS = \
ar \
ca \
da \
de \
es \
eu \
fa \
fr \
gl \
he \
hu \
it \
ja \
kr \
nb \
nl \
nn \
pl \
pt_BR \
ru \
sl \
sv \
tr \
zh_CN \
zh_TW \
2017-10-02 08:31:35 +03:00
2023-05-16 18:36:56 +03:00
BUILDDIR ?= $( DEB_SOURCE) -$( DEB_VERSION)
2023-05-16 18:05:17 +03:00
2023-05-16 18:48:32 +03:00
DSC = $( DEB_SOURCE) _$( DEB_VERSION_UPSTREAM_REVISION) .dsc
2023-05-16 18:36:56 +03:00
PVE_I18N_DEB = pve-i18n_$( DEB_VERSION) _all.deb
PMG_I18N_DEB = pmg-i18n_$( DEB_VERSION) _all.deb
PBS_I18N_DEB = pbs-i18n_$( DEB_VERSION) _all.deb
2017-10-02 08:31:35 +03:00
2023-05-16 18:36:56 +03:00
DEBS = $( PMG_I18N_DEB) $( PVE_I18N_DEB) $( PBS_I18N_DEB)
2017-10-02 08:31:35 +03:00
2023-05-16 18:36:56 +03:00
PMGLOCALEDIR = $( DESTDIR) /usr/share/pmg-i18n
PVELOCALEDIR = $( DESTDIR) /usr/share/pve-i18n
PBSLOCALEDIR = $( DESTDIR) /usr/share/pbs-i18n
2017-10-02 08:31:35 +03:00
PMG_LANG_FILES = $( patsubst %, pmg-lang-%.js, $( LINGUAS) )
PVE_LANG_FILES = $( patsubst %, pve-lang-%.js, $( LINGUAS) )
2020-09-07 14:06:05 +03:00
PBS_LANG_FILES = $( patsubst %, pbs-lang-%.js, $( LINGUAS) )
2017-10-02 08:31:35 +03:00
2018-01-23 11:33:11 +03:00
all :
2017-10-02 08:31:35 +03:00
2023-05-16 18:05:17 +03:00
$(BUILDDIR) : submodule
rm -rf $@ $@ .tmp
rsync -a * $@ .tmp
mv $@ .tmp $@
2017-10-02 08:31:35 +03:00
.PHONY : deb
deb : $( DEBS )
2023-05-16 18:05:17 +03:00
$(DEBS) : build -debs
build-debs : $( BUILDDIR )
cd $( BUILDDIR) ; dpkg-buildpackage -b -us -uc
2018-01-23 11:33:11 +03:00
lintian $( DEBS)
2023-05-16 18:05:17 +03:00
touch " $@ "
2017-10-02 08:31:35 +03:00
2023-05-16 18:58:34 +03:00
sbuild : $( DSC )
sbuild $( DSC)
2023-05-16 18:48:32 +03:00
.PHONY : dsc
dsc : $( DSC )
$(DSC) : $( BUILDDIR )
cd $( BUILDDIR) ; dpkg-buildpackage -S -us -uc -d
lintian $( DSC)
2017-10-03 16:11:39 +03:00
submodule :
2020-10-27 20:26:43 +03:00
test -f pmg-gui/Makefile -a -f proxmox-backup/Makefile -a -f pve-manager/Makefile \
|| git submodule update --init
2017-10-03 16:11:39 +03:00
2017-10-02 08:31:35 +03:00
.PHONY : install
2023-05-16 18:36:56 +03:00
install : $( PMG_LANG_FILES ) $( PVE_LANG_FILES ) $( PBS_LANG_FILES )
install -d $( PMGLOCALEDIR)
install -m 0644 $( PMG_LANG_FILES) $( PMGLOCALEDIR)
install -d $( PVELOCALEDIR)
install -m 0644 $( PVE_LANG_FILES) $( PVELOCALEDIR)
install -d $( PBSLOCALEDIR)
install -m 0644 $( PBS_LANG_FILES) $( PBSLOCALEDIR)
2017-10-02 08:31:35 +03:00
2018-01-19 14:06:47 +03:00
pmg-lang-%.js : %.po
2023-05-16 18:36:56 +03:00
./po2js.pl -t pmg -v " $( DEB_VERSION) " -o pmg-lang-$* .js $?
2017-10-02 08:31:35 +03:00
2018-01-19 14:06:47 +03:00
pve-lang-%.js : %.po
2023-05-16 18:36:56 +03:00
./po2js.pl -t pve -v " $( DEB_VERSION) " -o pve-lang-$* .js $?
2018-01-19 14:06:47 +03:00
2020-09-07 14:06:05 +03:00
pbs-lang-%.js : %.po
2023-05-16 18:36:56 +03:00
./po2js.pl -t pbs -v " $( DEB_VERSION) " -o pbs-lang-$* .js $?
2020-09-07 14:06:05 +03:00
2018-01-19 14:06:47 +03:00
# parameter 1 is the name
# parameter 2 is the directory
d e f i n e p o t u p d a t e
./jsgettext.pl -p " $( 1) $( shell cd $( 2) ; git rev-parse HEAD) " -o $( 1) .pot $( 2)
e n d e f
2017-10-02 08:31:35 +03:00
2021-09-01 11:45:28 +03:00
.PHONY : update update_pot do_update
2018-01-23 11:33:11 +03:00
update_pot : submodule
2018-01-19 14:06:47 +03:00
$( call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/)
$( call potupdate,pve-manager,pve-manager/www/manager6/)
$( call potupdate,proxmox-mailgateway,pmg-gui/js/)
2020-09-07 14:06:05 +03:00
$( call potupdate,proxmox-backup,proxmox-backup/www/)
2018-01-23 11:33:11 +03:00
2021-09-01 11:45:28 +03:00
do_update :
$( MAKE) update_pot
$( MAKE) messages.pot
2018-01-19 14:06:47 +03:00
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 ;
2017-10-02 08:31:35 +03:00
2021-09-01 11:45:28 +03:00
update :
git submodule foreach 'git pull --ff-only origin master'
$( MAKE) do_update
2019-06-11 14:43:50 +03:00
stats :
@for i in $( LINGUAS) ; do echo -n " $$ i: " ; msgfmt --statistics -o /dev/null $$ i.po; done
2018-01-23 11:33:11 +03:00
init-%.po : messages .pot
msginit -i $^ -l $^ -o $* .po --no-translator
.INTERMEDIATE : messages .pot
2020-09-07 14:06:05 +03:00
messages.pot : proxmox -widget -toolkit .pot proxmox -mailgateway .pot pve -manager .pot proxmox -backup .pot
2018-01-23 11:33:11 +03:00
msgcat $^ > $@
2017-10-04 11:28:34 +03:00
.PHONY : distclean
distclean : clean
2017-10-02 08:31:35 +03:00
.PHONY : clean
clean :
2023-05-16 18:48:32 +03:00
rm -rf $( DEB_SOURCE) -[ 0-9] */ *.po.tmp *.js.tmp *.deb *.dsc *.tar.* *.build *.buildinfo *.changes *.js messages.pot
2017-10-04 11:28:34 +03:00
2021-07-05 19:20:42 +03:00
.PHONY : upload -pve upload -pmg upload -pbs upload
2023-05-16 18:05:55 +03:00
upload-% : UPLOAD_DIST ?= $( DEB_DISTRIBUTION )
2023-05-16 18:36:56 +03:00
upload-pve : $( PVE_I 18N_DEB )
2023-05-16 18:05:55 +03:00
tar cf - $^| ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $( UPLOAD_DIST)
2023-05-16 18:36:56 +03:00
upload-pmg : $( PMG_I 18N_DEB )
2023-05-16 18:05:55 +03:00
tar cf - $^| ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $( UPLOAD_DIST)
2023-05-16 18:36:56 +03:00
upload-pbs : $( PBS_I 18N_DEB )
2023-05-16 18:05:55 +03:00
tar cf - $^| ssh -X repoman@repo.proxmox.com -- upload --product pbs --dist $( UPLOAD_DIST)
2021-07-05 19:20:42 +03:00
upload : upload -pve upload -pmg upload -pbs