Update build and translation handling

This commit is contained in:
2026-08-28 14:50:11 +02:00
parent 8d2fa0be77
commit 52d7ee4ba1
3 changed files with 311 additions and 33 deletions
+34 -1
View File
@@ -1,5 +1,29 @@
# Translation helper
# Targets
.PHONY: all prepare translation orig deb clean
# Package information
VERSION := $(shell dpkg-parsechangelog -S Version | sed 's/-.*//')
PACKAGE := yms
# Default target
all: prepare
# Debian source archive
orig:
git archive \
--format=tar \
--prefix=$(PACKAGE)-$(VERSION)/ \
HEAD \
':(exclude)debian' \
':(exclude)locale/*.pot' \
':(exclude)locale/de/LC_MESSAGES' \
| xz -9 > ../$(PACKAGE)_$(VERSION).orig.tar.xz
# Debian package
deb: orig
dpkg-buildpackage -us -uc
# Translation files
prepare: ymsgui.py yms/*.py yms/ui/*.ui
xgettext -L Python -o locale/program.pot ymsgui.py yms/*.py
xgettext -L Glade -o locale/ui.pot yms/ui/*.ui
@@ -11,3 +35,12 @@ translation: locale/de/LC_MESSAGES/ymsgui.mo
locale/de/LC_MESSAGES/ymsgui.mo: locale/de.po
mkdir -p locale/de/LC_MESSAGES
msgfmt locale/de.po -o locale/de/LC_MESSAGES/ymsgui.mo
# Clean generated files
clean:
rm -f locale/program.pot
rm -f locale/ui.pot
rm -f locale/combined.pot
rm -f locale/de/LC_MESSAGES/ymsgui.mo