From 93ea4e47f6b3f544cf5e7304f51268a7cdd61823 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Thu, 1 Dec 2016 21:02:53 +0100 Subject: [PATCH] separate rebuild-translations and building locale/ 'make' (or 'make all', if one is interested in the apidoc) should now do everything needed to run from a git checkout. At the same time, it no longer rebuilds all translations (xgettext run etc.). This can be done with 'make translations'. --- .gitignore | 2 +- Makefile | 25 ++++++++++++++++++------- debian/rules | 3 +-- scripts/po/rebuild-translations.sh | 8 -------- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 02743efb..1cd52769 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ rscds.bfproject davical.bfproject locale built-docs -built-po +built-locale .settings *~ testing/dumps diff --git a/Makefile b/Makefile index 213ad732..66a6fd02 100755 --- a/Makefile +++ b/Makefile @@ -11,18 +11,22 @@ snapshot : version = $(majorversion)-git$(gitrev) snapshot : issnapshot = 1 .PHONY: nodocs -nodocs: htdocs/always.php built-po +nodocs: htdocs/always.php built-locale .PHONY: all -all: htdocs/always.php built-docs built-po +all: htdocs/always.php built-docs built-locale built-docs: docs/phpdoc.ini htdocs/*.php inc/*.php docs/translation.rst - apigen generate --title=DAViCal --todo --tree --deprecated -s inc -s htdocs -d docs/api || phpdoc -c docs/phpdoc.ini || echo "NOTICE: Failed to build API docs" + apigen generate --quiet --title=DAViCal --todo --tree --deprecated -s inc -s htdocs -d docs/api || phpdoc -c docs/phpdoc.ini || echo "NOTICE: Failed to build API docs" rst2pdf docs/translation.rst || echo "NOTICE: Failed to build ReST docs" touch $@ -built-po: htdocs/always.php scripts/po/rebuild-translations.sh po/*.po - scripts/po/rebuild-translations.sh +built-locale: po/*.po + for LOCALE in `ls po/*.po | cut -f2 -d/ | cut -f1 -d.` ; do \ + [ "$${LOCALE}" = "en" ] && continue; \ + mkdir -p locale/$${LOCALE}/LC_MESSAGES; \ + msgfmt po/$${LOCALE}.po -o locale/$${LOCALE}/LC_MESSAGES/davical.mo; \ + done touch $@ # @@ -31,6 +35,13 @@ built-po: htdocs/always.php scripts/po/rebuild-translations.sh po/*.po htdocs/always.php: inc/always.php.in scripts/build-always.sh VERSION dba/davical.sql scripts/build-always.sh <$< >$@ +# +# recreate translations +# +.PHONY: translations +translations: + scripts/po/rebuild-translations.sh + # # Build a release .tar.gz file in the directory above us # @@ -67,8 +78,8 @@ test: .PHONY: clean clean: - rm -f built-docs built-po - rm -rf docs/api + rm -f built-docs built-locale + rm -rf docs/api locale -find . -name "*~" -delete rm -f docs/translation.pdf rm -f davical.spec diff --git a/debian/rules b/debian/rules index 85b682cf..afebf849 100755 --- a/debian/rules +++ b/debian/rules @@ -10,8 +10,7 @@ get-orig-source: dh $@ override_dh_auto_build: - @echo "NOTE: not calling make, do this before building the package and review / commit the result" - make built-docs + make all override_dh_installchangelogs: dh_installchangelogs ChangeLog diff --git a/scripts/po/rebuild-translations.sh b/scripts/po/rebuild-translations.sh index 8bed8dbf..cf768acd 100755 --- a/scripts/po/rebuild-translations.sh +++ b/scripts/po/rebuild-translations.sh @@ -8,8 +8,6 @@ [ -n "${DEBUG}" ] && set -o xtrace PODIR="po" -LOCALEDIR="locale" -APPLICATION="davical" awldirs="../awl `find .. -type d -name 'awl-*.*'` @@ -69,9 +67,3 @@ for LOCALE in `locale_list` ; do msgmerge --no-fuzzy-matching --quiet --width 105 --update ${PODIR}/${LOCALE}.po ${PODIR}/messages.pot done -for LOCALE in `locale_list` ; do - [ "${LOCALE}" = "en" ] && continue - mkdir -p ${LOCALEDIR}/${LOCALE}/LC_MESSAGES - msgfmt ${PODIR}/${LOCALE}.po -o ${LOCALEDIR}/${LOCALE}/LC_MESSAGES/${APPLICATION}.mo -done -