LANGUAGES=$(basename $(wildcard *.po)) PACKAGE_NAME=mageiawelcome DESTDIR=$(RPM_BUILD_ROOT) all: qm clean: @echo " **CLEAN**" @rm -rf *.mo *~ tmp/ @for lang in $(LANGUAGES); do \ echo " **CLEANDIR** $$lang"; \ rm -rf $$lang;\ done pot: cat ../usr/share/applications/$(PACKAGE_NAME).desktop.in | grep _ | cut -d "=" --fields=2 | sed 's|^|_("|g' | sed 's|$$|")|g' > ../usr/share/applications/$(PACKAGE_NAME).desktop.tmp xgettext --copyright-holder='Daniel Napora ' --package-name=mageiawelcome --from-code=UTF-8 --add-comments \ -L Python --msgid-bugs-address=http://bugs.mageia.org -o $(PACKAGE_NAME).pot ../qml/mageiawelcome.py ../qml/helpers.py ../usr/share/applications/$(PACKAGE_NAME).desktop.tmp rm -f ../usr/share/applications/$(PACKAGE_NAME).desktop.tmp sed -i "s|desktop.tmp|desktop.in|g" $(PACKAGE_NAME).pot po: @for lang in $(LANGUAGES); do \ echo " Updating po for $$lang"; \ if [ ! -f $$lang.po ]; then \ msginit --input $(PACKAGE_NAME).pot -o $$lang-old.po;\ else \ mv $$lang.po $$lang-old.po; \ fi ; \ msgmerge -o $$lang.po $$lang-old.po $(PACKAGE_NAME).pot; \ rm -f $$lang-old.po; \ done