]> git.proxmox.com Git - proxmox-i18n.git/blobdiff - Makefile
bump version to 3.2.2
[proxmox-i18n.git] / Makefile
index 8005b320b55f7b1c7acc5e1178465d6b46110b24..dd9cfe1d26a5da8ad3b098e28732e4f19a2f1aa3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,10 +11,12 @@ LINGUAS=\
        fr \
        gl \
        he \
+       hr \
        hu \
        it \
        ja \
-       kr \
+       ka \
+       ko \
        nb \
        nl \
        nn \
@@ -24,18 +26,22 @@ LINGUAS=\
        sl \
        sv \
        tr \
+       ukr \
        zh_CN \
        zh_TW \
 
-PVE_I18N_DEB=pve-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
-PMG_I18N_DEB=pmg-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
-PBS_I18N_DEB=pbs-i18n_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+BUILDDIR ?= $(DEB_SOURCE)-$(DEB_VERSION)
 
-DEBS=${PMG_I18N_DEB} $(PVE_I18N_DEB) $(PBS_I18N_DEB)
+DSC=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
+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
 
-PMGLOCALEDIR=${DESTDIR}/usr/share/pmg-i18n
-PVELOCALEDIR=${DESTDIR}/usr/share/pve-i18n
-PBSLOCALEDIR=${DESTDIR}/usr/share/pbs-i18n
+DEBS=$(PMG_I18N_DEB) $(PVE_I18N_DEB) $(PBS_I18N_DEB)
+
+PMGLOCALEDIR=$(DESTDIR)/usr/share/pmg-i18n
+PVELOCALEDIR=$(DESTDIR)/usr/share/pve-i18n
+PBSLOCALEDIR=$(DESTDIR)/usr/share/pbs-i18n
 
 PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS))
 PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS))
@@ -43,38 +49,54 @@ PBS_LANG_FILES=$(patsubst %, pbs-lang-%.js, $(LINGUAS))
 
 all:
 
+$(BUILDDIR): submodule
+       rm -rf $@ $@.tmp
+       rsync -a * $@.tmp
+       mv $@.tmp $@
+
 .PHONY: deb
 deb: $(DEBS)
-$(PMG_I18N_DEB): $(PVE_I18N_DEB)
-$(PBS_I18N_DEB): $(PVE_I18N_DEB)
-$(PVE_I18N_DEB): | submodule
-       rm -rf dest
-       rsync -a * dest
-       cd dest; dpkg-buildpackage -b -us -uc
+$(DEBS): build-debs
+
+build-debs: $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
        lintian $(DEBS)
+       touch "$@"
+
+sbuild: $(DSC)
+       sbuild $(DSC)
+
+.PHONY: dsc
+dsc: $(DSC)
+$(DSC): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
+       lintian $(DSC)
 
-.PHONY: submodule
 submodule:
        test  -f pmg-gui/Makefile -a -f proxmox-backup/Makefile -a -f pve-manager/Makefile \
            || git submodule update --init
 
 .PHONY: install
-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}
+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)
+# compat symlinks for kr -> ko correction.
+       ln -s pmg-lang-ko.js $(PMGLOCALEDIR)/pmg-lang-kr.js
+       ln -s pve-lang-ko.js $(PVELOCALEDIR)/pve-lang-kr.js
+       ln -s pbs-lang-ko.js $(PBSLOCALEDIR)/pbs-lang-kr.js
 
 pmg-lang-%.js: %.po
-       ./po2js.pl -t pmg -v "${VERSION}-${PKGREL}" -o pmg-lang-$*.js $?
+       ./po2js.pl -t pmg -v "$(DEB_VERSION)" -o pmg-lang-$*.js $?
 
 pve-lang-%.js: %.po
-       ./po2js.pl -t pve -v "${VERSION}-${PKGREL}" -o pve-lang-$*.js $?
+       ./po2js.pl -t pve -v "$(DEB_VERSION)" -o pve-lang-$*.js $?
 
 pbs-lang-%.js: %.po
-       ./po2js.pl -t pbs -v "${VERSION}-${PKGREL}" -o pbs-lang-$*.js $?
+       ./po2js.pl -t pbs -v "$(DEB_VERSION)" -o pbs-lang-$*.js $?
 
 # parameter 1 is the name
 # parameter 2 is the directory
@@ -113,15 +135,15 @@ distclean: clean
 
 .PHONY: clean
 clean:
-       find . -name '*~' -exec rm {} ';'
-       rm -rf dest *.po.tmp *.js.tmp *.deb *.buildinfo *.changes *.js messages.pot
+       rm -rf $(DEB_SOURCE)-[0-9]*/ *.po.tmp *.js.tmp *.deb *.dsc *.tar.* *.build *.buildinfo *.changes *.js messages.pot
 
 .PHONY: upload-pve upload-pmg upload-pbs upload
-upload-pve: ${PVE_I18N_DEB}
-       tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye
-upload-pmg: ${PMG_I18N_DEB}
-       tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist bullseye
-upload-pbs: ${PBS_I18N_DEB}
-       tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pbs --dist bullseye
+upload-%: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
+upload-pve: $(PVE_I18N_DEB)
+       tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST)
+upload-pmg: $(PMG_I18N_DEB)
+       tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $(UPLOAD_DIST)
+upload-pbs: $(PBS_I18N_DEB)
+       tar cf - $^|ssh -X repoman@repo.proxmox.com -- upload --product pbs --dist $(UPLOAD_DIST)
 
 upload: upload-pve upload-pmg upload-pbs