[Gpg4win-commits] r747 - in trunk: . src
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Mar 20 19:19:31 CET 2008
Author: werner
Date: 2008-03-20 19:19:31 +0100 (Thu, 20 Mar 2008)
New Revision: 747
Added:
trunk/src/potomo
Modified:
trunk/ChangeLog
trunk/src/Makefile.am
trunk/src/inst-gnupg.nsi
trunk/src/inst-gnupg2.nsi
trunk/src/uninst-gnupg2.nsi
Log:
Install po files for all available languages. Only for GnuPG-2. The
de.po for gpg will not be installed anymore.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-03-20 08:42:59 UTC (rev 746)
+++ trunk/ChangeLog 2008-03-20 18:19:31 UTC (rev 747)
@@ -1,5 +1,12 @@
2008-03-20 Werner Koch <wk at g10code.com>
+ * src/potomo: New.
+ * src/Makefile.am (gpg4win_pkg_gnupg_post_install): Remove mo file
+ creation.
+ (gpg4win_pkg_gnupgw_post_install): Convert po files.
+ (EXTRA_DIST): Include potomo.
+ * src/inst-gnupg2.nsi: Install all available mo files.
+
* src/inst-gnupg2.nsi: Do not install com-certs.pem.
2008-03-19 Werner Koch <wk at g10code.com>
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2008-03-20 08:42:59 UTC (rev 746)
+++ trunk/src/Makefile.am 2008-03-20 18:19:31 UTC (rev 747)
@@ -22,7 +22,7 @@
installer-options.ini.in libiconv.def libintl.def loreley.mid \
gpg4win-splash.wav gpgwrap.c exdll.h g4wihelp.c g4wihelp.nsi \
inst-sections.nsi installer.nsi installer-finish.nsi \
- qt.conf kleowrap.c \
+ qt.conf kleowrap.c potomo \
inst-gpg4win.nsi uninst-gpg4win.nsi \
inst-atk.nsi uninst-atk.nsi \
inst-cairo.nsi uninst-cairo.nsi \
@@ -97,19 +97,19 @@
sed -e 's/$$$$/\r/' > $$$${pkgidir}/share/man/man1/gpgv.man; \
man -Tlatin1 -l $$$${pkgidir}/share/man/man7/gnupg.7 | \
sed `printf "s/_\b//g;s/\b.//g"` | \
- sed -e 's/$$$$/\r/' > $$$${pkgidir}/share/man/man7/gnupg.man; \
-for i in de; do \
- msgfmt --output-file=$$$${pkgidir}/share/gnupg/$$$${i}.mo \
- $$$${pkgsdir}/po/$$$${i}.po; \
- done)
+ sed -e 's/$$$$/\r/' > $$$${pkgidir}/share/man/man7/gnupg.man)
endef
# The fields FAQ and faq.html conflict with those in GnuPG1.
-# For now removes them.
+# For now remove them.
define gpg4win_pkg_gnupg2_post_install
( rm $$$${pkgidir}/share/gnupg/FAQ; \
- rm $$$${pkgidir}/share/gnupg/faq.html )
+ rm $$$${pkgidir}/share/gnupg/faq.html; \
+ for i in `$(tsdir)/src/potomo --get-linguas $$$${pkgsdir}/po` ; do \
+ $(tsdir)/src/potomo $$$${pkgsdir}/po/$$$${i}.po \
+ $$$${pkgidir}/share/gnupg/$$$${i}.mo ; \
+ done)
endef
Modified: trunk/src/inst-gnupg.nsi
===================================================================
--- trunk/src/inst-gnupg.nsi 2008-03-20 08:42:59 UTC (rev 746)
+++ trunk/src/inst-gnupg.nsi 2008-03-20 18:19:31 UTC (rev 747)
@@ -59,9 +59,14 @@
# Install the language files for gpg. Note that the PO files are
# required to be UTF-8 encoded and that the post-install macro in
# Makefile.am needs to build them.
- SetOutPath "$INSTDIR\gnupg.nls"
- File "${prefix}/share/gnupg/de.mo"
+ # Note that we do not install the mo files for gpg1 anymore. This
+ # is because the build systems can't cope with it (stow conflicts)
+ # and becuase translations for the server version are usually not
+ # required. Instead we install the gnupg2 mo files.
+ #SetOutPath "$INSTDIR\gnupg.nls"
+
+
# If requested, install the configured gpg.conf.
Var /GLOBAL ConfigGPGConf
g4wihelp::config_fetch "gpg.conf"
Modified: trunk/src/inst-gnupg2.nsi
===================================================================
--- trunk/src/inst-gnupg2.nsi 2008-03-20 08:42:59 UTC (rev 746)
+++ trunk/src/inst-gnupg2.nsi 2008-03-20 18:19:31 UTC (rev 747)
@@ -77,8 +77,8 @@
# Install the language files for gpg. Note that the PO files are
# required to be UTF-8 encoded and that the post-install macro in
# Makefile.am needs to build them.
-# SetOutPath "$INSTDIR\gnupg2.nls"
-# File "${prefix}/share/gnupg2/de.mo"
+ SetOutPath "$INSTDIR\gnupg2.nls"
+ File /nonfatal "${prefix}/share/gnupg/*.mo"
# If requested, install the configuration files.
ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
Added: trunk/src/potomo
===================================================================
--- trunk/src/potomo 2008-03-20 08:42:59 UTC (rev 746)
+++ trunk/src/potomo 2008-03-20 18:19:31 UTC (rev 747)
@@ -0,0 +1,52 @@
+#!/bin/sh
+# potomo - Convert a .po file to an utf-8 encoded .mo file.
+#
+# This script is used to create the mo files for applications using
+# the simplegetext implementaion as used by GnuPG and some other
+# tools. That gettext can only cope with utf-8 encoded mo files; thus
+# we make this sure while creating the mo. A vonversion is not done
+# if the source file does not exist or if it is not newer than the mo
+# file.
+
+if [ "$1" = "--get-linguas" -a $# -eq 2 ]; then
+ if [ ! -f "$2/LINGUAS" ]; then
+ echo "potomo: directory '$2' has no LINGUAS file" >&2
+ exit 1
+ fi
+ echo $(sed -e "/^#/d" -e "s/#.*//" "$2"/LINGUAS)
+ exit 0
+fi
+
+if [ $# -ne 2 ]; then
+ echo "usage: potomo infile.po outfile.mo" >&2
+ exit 1
+fi
+infile="$1"
+outfile="$2"
+
+if [ ! -f "$infile" ]; then
+ echo "potomo: '$infile' not found - ignored" 2>&1
+ exit 0
+fi
+
+if [ "$outfile" -nt "$infile" ]; then
+ echo "potomo: '$outfile' is newer than source - keeping" 2>&1
+ exit 0
+fi
+
+fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' \
+ "$infile"`
+
+case "$fromset" in
+ utf8|utf-8|UTF8|UTF-8)
+ echo "potomo: '$infile' keeping $fromset" >&2
+ msgfmt --output-file="$outfile" "$infile"
+ ;;
+ *)
+ echo "potomo: '$infile' converting from $fromset to utf-8" >&2
+ iconv --silent --from-code=$fromset --to-code=utf-8 < "$infile" |\
+ sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/"|\
+ msgfmt --output-file="$outfile" -
+ ;;
+esac
+
Property changes on: trunk/src/potomo
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/src/uninst-gnupg2.nsi
===================================================================
--- trunk/src/uninst-gnupg2.nsi 2008-03-20 08:42:59 UTC (rev 746)
+++ trunk/src/uninst-gnupg2.nsi 2008-03-20 18:19:31 UTC (rev 747)
@@ -60,8 +60,8 @@
RMDir "$INSTDIR\etc\gnupg"
RMDir "$INSTDIR\etc"
-# Delete "$INSTDIR\gnupg.nls\de.mo"
-# RMDir "$INSTDIR\gnupg.nls"
+ Delete "$INSTDIR\gnupg.nls\*.mo"
+ RMDir "$INSTDIR\gnupg.nls"
RMDir "$INSTDIR"
More information about the Gpg4win-commits
mailing list