diff --git a/gettext-xgettext-python-unicode-surrogate-473946.patch b/gettext-xgettext-python-unicode-surrogate-473946.patch new file mode 100644 index 0000000..6bf188e --- /dev/null +++ b/gettext-xgettext-python-unicode-surrogate-473946.patch @@ -0,0 +1,23 @@ +2008-08-03 Bruno Haible + + * x-python.c (mixed_string_buffer_append): Replace a lone high + surrogate with U+FFFD. + Reported by Yann + via Santiago Vila . + +*** gettext-tools/src/x-python.c 20 Apr 2008 05:23:52 -0000 1.32 +--- gettext-tools/src/x-python.c 3 Aug 2008 19:56:58 -0000 +*************** +*** 930,935 **** +--- 930,940 ---- + + if (c >= UNICODE (0xd800) && c < UNICODE (0xdc00)) + bp->utf16_surr = UNICODE_VALUE (c); ++ else if (c >= UNICODE (0xdc00) && c < UNICODE (0xe000)) ++ { ++ /* A half surrogate is invalid, therefore use U+FFFD instead. */ ++ mixed_string_buffer_append_unicode (bp, 0xfffd); ++ } + else + mixed_string_buffer_append_unicode (bp, UNICODE_VALUE (c)); + } diff --git a/gettext.spec b/gettext.spec index 09826a6..bbdbaee 100644 --- a/gettext.spec +++ b/gettext.spec @@ -1,10 +1,12 @@ # libintl.jar requires gcj >= 4.3 to build %define buildjar 1 +%define buildjava 1 +%define buildcheck 1 Summary: GNU libraries and utilities for producing multi-lingual messages Name: gettext Version: 0.17 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv3 and LGPLv2+ Group: Development/Tools URL: http://www.gnu.org/software/gettext/ @@ -16,22 +18,24 @@ Requires(preun): /sbin/install-info BuildRequires: automake >= 1.8 %endif BuildRequires: autoconf >= 2.5 -BuildRequires: libtool, bison, gcc-c++, gcc-java, libgcj +BuildRequires: libtool, bison, gcc-c++ +%if %{buildjava} +BuildRequires: gcc-java, libgcj # For javadoc BuildRequires: java-1.6.0-openjdk-devel -# need expat for xgettext on glade -Buildrequires: expat-devel %if %{buildjar} BuildRequires: %{_bindir}/fastjar # require zip and unzip for brp-java-repack-jars BuildRequires: zip, unzip %endif -# for autopoint -Requires: cvs +%endif +# need expat for xgettext on glade +Buildrequires: expat-devel Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Patch5: gettext-0.17-open-args.patch Patch6: gettext-0.17-autopoint-CVS-441481.patch Patch7: gettext-0.17-rpathFix.patch +Patch8: gettext-xgettext-python-unicode-surrogate-473946.patch %description The GNU gettext package provides a set of tools and documentation for @@ -77,18 +81,26 @@ This package contains libraries used internationalization support. %patch5 -p0 -b .5-open-args~ %patch6 -p0 -b .6-autopoint~ %patch7 -p0 -b .rpathFix~ +%patch8 -p0 -b .unicode~ %build [ -f %{_datadir}/automake/depcomp ] && cp -f %{_datadir}/automake/{depcomp,ylwrap} . +%if %{buildjava} export JAVAC=gcj %if %{buildjar} export JAR=fastjar %endif +%endif %configure --without-included-gettext --enable-nls --disable-static \ - --enable-shared --with-pic-=yes --disable-csharp --enable-java \ - --disable-rpatha + --enable-shared --with-pic-=yes --disable-csharp \ +%if %{buildjava} + --enable-java \ +%else + --disable-java \ +%endif + --disable-rpath make %{?_smp_mflags} GCJFLAGS="-findirect-dispatch" # For generating gettext-tools/src/gnu.gettext.* @@ -157,14 +169,16 @@ cat %{name}-*.lang > %{name}.lang rm -rf ${RPM_BUILD_ROOT} +%if %{buildcheck} %check ## For Koji build problem cp ${RPM_BUILD_ROOT}%{_libdir}/libgettext*-%{version}.so ${RPM_BUILD}gettext-tools/src/.libs cp ${RPM_BUILD_ROOT}%{_libdir}/libgettext*-%{version}.so ${RPM_BUILD}gettext-tools/tests/.libs cp ${RPM_BUILD_ROOT}%{_libdir}/libasprintf.so* ${RPM_BUILD}gettext-tools/src/.libs cp ${RPM_BUILD_ROOT}%{_libdir}/libasprintf.so* ${RPM_BUILD}gettext-tools/tests/.libs - +# this takes quite a lot of time to run make check +%endif %define install_info /sbin/install-info @@ -216,7 +230,9 @@ fi %{_infodir}/gettext* %{_mandir}/man1/* %{_libdir}/%{name} +%if %{buildjava} %exclude %{_libdir}/%{name}/gnu.gettext.* +%endif %dir %{_datadir}/%{name} %{_datadir}/%{name}/archive.tar.gz %{_datadir}/%{name}/styles @@ -246,8 +262,9 @@ fi %{_mandir}/man3/* %{_datadir}/%{name}/javaversion.class %doc gettext-runtime/intl-java/javadoc* +%if %{buildjava} %{_libdir}/%{name}/gnu.gettext.* - +%endif %files libs %defattr(-,root,root,-) @@ -257,8 +274,12 @@ fi %changelog -* Wed Nov 5 2008 Jens Petersen -- move cvs Requires for autopoint to base package (Karl Lattimer, #469555) +* Thu Feb 12 2009 Jens Petersen - 0.17-9 +- add buildjava switch to allow turning off the java bits completely +- add buildcheck to allow turning off make check +- drop cvs requires for autopoint (Karl Lattimer, #469555) +- add upstream gettext-xgettext-python-unicode-surrogate-473946.patch by + Bruno Haible to fix xgettext handling of utf16 surrogates in python (#473946) * Fri Aug 29 2008 Ding-Yi Chen - 0.17-8 - Fix the build failure with koji.