File gettext-runtime.spec of Package gettext-runtime

# spec file for package gettext-runtime (Version 0.17)
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

Name:           gettext-runtime
%define pacname gettext
Version:        0.17
Release:        60
BuildRequires:  gcc-c++ perl-libintl-perl tcl
# To get an updated (in case there are new dupes), temproarily enable:
#BuildRequires: fdupes
License:        GPL v3 or later; LGPL v2.0 or later
Group:          Development/Tools/Other
#Rename done for openSUSE 11.0
Provides:       gettext = %{version}
Obsoletes:      gettext < %{version}
Summary:        Tools for Native Language Support (NLS)
PreReq:         %{install_info_prereq}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         %pacname-%version.tar.bz2
Source1:        gettext-rpmlintrc
Source2:        suse-start-po-mode.el
Patch:          gettext-0.12.1-sigfpe.patch
Patch2:         gettext-0.12.1-gettextize.patch
Patch3:         gettext-codecleanup.patch
Patch4:         po-mode.diff
Patch5:         gettext-initialize_vars.patch
Patch6:         gettext-0.15-docdir.diff
Patch7:         gettext-autotools.patch
Patch8:         gettext-gl_AC_TYPE_LONG_LONG.patch
Patch9:         gettext-needlessly_init_vars.patch
Patch10:        gettext-open_missing_mode.patch
Patch11:        gettext-typo_to_segfault.patch
Patch12:        gettext-0.17-no-autoconf-tests.diff

This package contains the intl library as well as tools that ease the
creation and maintenance of message catalogs. It allows you to extract
strings from source code. The supplied Emacs mode (po-mode.el) helps
editing these catalogs (called PO files, for portable object) and
adding translations. A special compiler turns these PO files into
binary catalogs.

    Ulrich Drepper <>
    Bruno Haible <>

%package -n gettext-tools
License:        LGPL v2.1 or later
Summary:        Tools for Native Language Support (NLS)
Group:          Development/Tools/Other
Requires:       %{name} = %{version}, cvs
PreReq:         info
Provides:       gettext-devel = %{version}
Obsoletes:      gettext-devel < %{version}

%description -n gettext-tools
This package contains the `intl' library as well as tools that ease the
creation and maintenance of message catalogs. With it you can extract
strings from source code. The supplied Emacs mode (po-mode.el) will aid
in editing these catalogs (called PO files, for portable object) and
add translations. A special compiler will turn these PO files into
binary catalogs.

    Ulrich Drepper <>
    Bruno Haible <>

%setup -q -n %{pacname}-%{version}
%patch6 -p1
pushd gettext-tools/misc
tar xfz archive.tar.gz
find . -name gettext.m4,v -print0 | xargs -0 perl -spi -e 's/\(int\) /\(long\) /g'
tar cfz archive.tar.gz archive/

# expect a couple "You should update your `aclocal.m4' by running aclocal."
autoreconf -fiv
export CFLAGS="$RPM_OPT_FLAGS -pipe -W -Wall -Dgcc_is_lint"
export CXXFLAGS="$CFLAGS -Dgcc_is_lint"
%configure --enable-shared
make GMSGFMT=../src/msgfmt
# use texinfo.tex supplied by the system (texinfo)
# make -C gettext-tools/doc gettext.pdf

%define my_docdir %{_defaultdocdir}/%{name}
export LC_CTYPE=ISO-8859-15
make install DESTDIR=$RPM_BUILD_ROOT docdir=%{my_docdir}
mkdir -p $RPM_BUILD_ROOT/usr/share/emacs/site-lisp
install -m 644 %SOURCE2 $RPM_BUILD_ROOT/usr/share/emacs/site-lisp
install -m 644 gettext-tools/misc/po-compat.el $RPM_BUILD_ROOT/usr/share/emacs/site-lisp
install -m 644 gettext-tools/misc/po-mode.el $RPM_BUILD_ROOT/usr/share/emacs/site-lisp
install -m 644 gettext-tools/misc/start-po.el $RPM_BUILD_ROOT/usr/share/emacs/site-lisp
#make -C gettext-tools/doc docdir=$RPM_BUILD_ROOT/%{my_docdir} install-pdf
if [ -e $RPM_BUILD_ROOT/%{_libdir}/ ];then
	chmod 755 $RPM_BUILD_ROOT/%{_libdir}/
# fix rpmlint invalid-lc-messages-dir:
rm -rf $RPM_BUILD_ROOT/%_datadir/locale/en@{bold,}quot
%{find_lang} gettext-tools
%{find_lang} gettext-runtime
#remove unwanted stuff
rm -f $RPM_BUILD_ROOT/usr/share/doc/packages/gettext/README.{mingw,vms,woe32}
rm -f %_datadir/%name/gettext.jar
#find $RPM_BUILD_ROOT -maxdepth 2 -name '*html' | xargs rm -f
# hardlink the dupes in the documentation:
cd $RPM_BUILD_ROOT/%{my_docdir}/examples
sh %{SOURCE3}
# moved to gettext-java and gettext-csharp:
rm -rf *csharp* *java* ../javadoc* ../csharpdoc*
rm -f %{buildroot}%{_defaultdocdir}/%name/README.woe32
cd $RPM_BUILD_ROOT/%{_mandir}/man3
echo ".so man3/dngettext.3" > dcngettext.3
echo ".so man3/dgettext.3" > dcgettext.3

# s390s fails this test, 
# Starting test_recursive_lock ...test-lock: pthread_mutex_lock.c:66: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
make check || {
%ifarch s390x
	echo "got this during mbuild testing on s390x (on both times which make check ran):"
	echo "Starting test_recursive_lock ...test-lock: pthread_mutex_lock.c:66: __pthread_mutex_lock: Assertion mutex->__data.__owner == 0 failed."
	echo "s390x needs kernel/glibc/gcc fix, but let it continue bootstrap for now!"
	echo "make check failed, check it!"
	exit 5


%post -p /sbin/ldconfig

%postun  -p /sbin/ldconfig

%post -n gettext-tools
%install_info --info-dir=%{_infodir} %{_infodir}/
%install_info --info-dir=%{_infodir} %{_infodir}/

%postun -n gettext-tools
%install_info_delete --info-dir=%{_infodir} %{_infodir}/
%install_info_delete --info-dir=%{_infodir} %{_infodir}/

%files -f gettext-runtime.lang
%dir %_prefix/share/gettext
%doc %dir %_defaultdocdir/%name
%doc %_defaultdocdir/%name/gettext.1.html
%doc %_defaultdocdir/%name/ngettext.1.html
%doc %_defaultdocdir/%name/envsubst.1.html
%doc %_defaultdocdir/%name/*.3.html
%doc %_defaultdocdir/%name/AUTHORS
%doc %_defaultdocdir/%name/COPYING
%doc %_defaultdocdir/%name/NEWS
%doc %_defaultdocdir/%name/README
%doc %_defaultdocdir/%name/FAQ.html
%doc %_mandir/man1/gettext.1.gz
%doc %_mandir/man1/ngettext.1.gz
%doc %_mandir/man1/envsubst.1.gz
%doc %_mandir/man1/msgfmt.1.gz
%doc %_mandir/man3/*
%dir %_prefix/share/emacs
%dir %_prefix/share/emacs/site-lisp

%files -n gettext-tools -f gettext-tools.lang
%doc %_defaultdocdir/%name/examples
%doc %_defaultdocdir/%name/auto*.html
%doc %_defaultdocdir/%name/gettext_*.html
%doc %_defaultdocdir/%name/gettextize*.html
%doc %_defaultdocdir/%name/msg*.html
%doc %_defaultdocdir/%name/tutorial*.html
%doc %_defaultdocdir/%name/xgettext*.html
%doc %_defaultdocdir/%name/recode-sr-latin.1.html
%doc %_mandir/man1/msg[a-eg-u]*.1.gz
%doc %_mandir/man1/msgfilter.1.gz
%doc %_mandir/man1/xgettext.1.gz
%doc %_mandir/man1/gettextize.1.gz
%doc %_mandir/man1/autopoint.1.gz
%doc %_mandir/man1/recode-sr-latin.1.gz
%doc %_infodir/*
%doc %_infodir/*

* Tue Oct 14 2008
- Never install files in %%check section
- Disable autoconf/libtool tests
* Mon Oct 13 2008
- Fix autoreconf call
* Sun May 18 2008
- Fix segmentation fault in msgmerge (bnc#391372).
- Get rid of %%run_ldconfig
* Wed May 07 2008
- provide gettext-<arch> too
* Tue Apr 29 2008
- obsolete gettext-<arch> via baselibs.conf
* Thu Apr 10 2008
- added baselibs.conf file to build xxbit packages
  for multilib support
* Tue Jan 22 2008
- Define version before using it.
- Fix Provides and Obsoletes for gettext-tools
* Tue Jan 15 2008
- Update rpmlintrc.
* Tue Dec 04 2007
- Add patch from upstreams to add the missing mode for the open call.
* Fri Nov 23 2007
- Reenable msgmerge-compendium-5 now that gcc has been fixed.
- Change Provides/Obsoletes to match guidelines
- Add Comment as to when the rename happened.
* Thu Nov 15 2007
- Rename packages: gettext -> gettext-runtime and
  gettext-devel -> gettext->tools
  Packaging closely follows uptream recommendation with a few
- Initialize variable to shut up gcc.
- Disable msgmerge-compendium-5 for now.
- Update to 0.17:
  * License:
  The gettext related programs and tools are now licensed under the GPL
  version 3, instead of the GPL version 2.
  * PO file format:
  The Project-Id-Version field in the header entry may now already be filled
  in the POT file. In this case, the translators don't need to fill it in.
  xgettext has new options --package-name and --package-version that allow
  to specify the package name and version from a Makefile.
  * Colorized PO files:
  The msgcat program has new options --color and --style that produce a
  colorized PO file output, where keywords, strings, comments, or format
  directives can be highlighted.  See the documentation section
  "Highlighting parts of PO files" for more info.
  * gettextize now has a --po-dir option that allows several PO directories to
  be updated all together.
  * Programming languages support:
   - Contexts (msgctxt) are now also supported for Java and C#.
   - C# with Qt: The support for Qt format strings has been updated for Qt 4.
   - C++ with KDE:
  xgettext has a new option --kde that triggers the recognition and marking
  of KDE 4 format strings.
  * Autoconf macros:
   - A new macro AM_XGETTEXT_OPTION can be used as an alternative to modifying
  * libgettextpo library:
   - New functions are available for querying the list of supported format
   - The functions po_message_comments and po_message_extracted_comments
  return a multiline string where each line no longer starts with a
  redundant space. The leading space in every comment line is now stripped
  while reading the PO file.
   - Conversely, when you pass a multiline string to the function
  po_message_set_comments or po_message_set_extracted_comments, you normally
  don't pass a space at the beginning of each line, because such spaces are
  no longer trimmed during output.
  * Documentation:
   - The "Users" chapter has been completely rewritten.
   - New section "Highlighting parts of PO files".
 - A complete example showing the use of GNU gettext in Java with the Qt/Jambi
  GUI toolkit has been added.
- Add tcl and perl-libintl-perl to BuildRequires (testsuite needs
- Remove call to gl_AC_TYPE_LONG_LONG from libasprintf's
* Mon Nov 05 2007
- Fix ordering of gettext.changes entries.
* Wed Oct 31 2007
- renamed rpmlintrc to gettext-rpmlintrc and added it to the spec
  as source 1
* Mon Sep 03 2007
- Incorporate upstream patch that correctly fixes the expat
  dynloading code (
* Wed Aug 15 2007
- do not set the version to 0.16.1
* Fri Aug 10 2007
- Update to gettext 0.16.1, required by GnuPG 2.0.5
* Thu Aug 09 2007
- apply the fixes from gettext-0.16.1, noticeable changes:
  * gettext.m4: changequote instead of pairs of brackets
  * add a few function protoypes and update polish translations
- extract missing ycp comments (fix from upstream maintainer, #287150)
- re-enable make check to identify possible toolchain bugs
- move java and csharp documentation to gettext-{java,csharp}
- hardlink duplicate example files in documentation
* Sat May 26 2007
- added rpmlintrc for gettext-devel (examples executable)
* Fri Apr 20 2007
- Make inclusion of expat.h independent of dynamic loading so
  that XML_MAJOR_VERSION is actually defined (#264110).
* Fri Mar 30 2007
- Fix use of uninitialized variables.
- Set CXXFLAGS to get C++ code compiled with RPM_BUILD_OPTS
- sync .spec files
* Thu Mar 29 2007
- Add site-lisp directories to package.
* Tue Mar 20 2007
- Remove unused expat BuildRequires.
* Thu Mar 08 2007
- Add cvs Requires to gettext-devel as autopoint requires it.
* Tue Jan 16 2007
- Update to gettext 0.16
  * Interoperability with automake-1.10.
  * msgmerge has a new option --previous that has the effect of saving the
  previous msgid of message when making them fuzzy.
  * msgcmp now ignores fuzzy and untranslated messages in the PO file.
  * gettextize, when invoked without --intl option, now installs only the .m4
  files that are needed.
  * gettextize no longer creates symbolic links by default; it makes file copies
  * Autoconf macros:
    - The gettext autoconf macros now require autoconf 2.52 or newer.
    - New autoconf macro AM_GNU_GETTEXT_INTL_SUBDIR
    - A new autoconf macro AM_GNU_GETTEXT_NEED is added.
  * The libgettextpo library no longer exports symbols that could clash with
  symbols of the application that uses it.
* Mon Sep 18 2006
- Build java tools from a separate spec file gettext-java.
- Remove gcc-java and gcc-objc build dependencies.
* Tue Sep 05 2006
- Remove build dependency on emacs.
- Remove install dependency on libstdc++-devel for gettext-devel.
* Wed Jul 26 2006
- Version 0.15:
  * Enhance PO file format.  Messages constrained to a certain context
  are possible.  The syntax is:
  msgctxt "context"
  msgid "original"
  msgstr "translation"
  The xgettext program can be told through the --keyword flag which
  function/macro argument has the role of a context.  It also supports
  the GNOME glib convention to specify the context and original string
  in the same string literal: "context|original".
  The (non-public) include file gettext.h defines macros pgettext, dpgettext
  etc. that take a context argument.
  For more information, see the node "Contexts" in the manual.
  * msgfmt's format string checking is now stricter in the presence of plural
  * Enhancements to msggrep, xgettext, msgmerge (much faster now!).
  * New program recode-sr-latin, that converts Serbian text from
  the Cyrillic script to the Latin script.
  * Programming languages support:
    - C++ with Boost:
    - Python: xgettext now recognizes the source encoding from a
  "coding:" comment among the first two lines.  The default encoding
  is now ASCII, no longer ISO-8859-1.
  * libgettextpo library: Incompatible change with the error handler
  type passed to functions.
- Remove strict aliasing patch which seems to be obsolete because of
  code changes.
- Require expat, but still no-op?
* Wed Jan 25 2006
- converted neededforbuild to BuildRequires
* Tue Jan 03 2006
- Fixed info installation scriptlets (#141183).
- Use %%doc, where appropriate.
- Moved to devel subpackage.
- Move emacs-lisp files to main package.
- Fixed devel splitting and requirements.
* Mon Sep 19 2005
- Update to 0.14.5
- Fix strict aliasing issues
* Sat Apr 16 2005
- Move libgettextsrc-*.so and libgettextlib-*.so to main package as needed
  by msgfmt.
* Thu Apr 14 2005
- Move msgfmt into main package for LSB support
* Wed Apr 06 2005
- Fix documentation packaging
* Tue Apr 05 2005
- Remove the stupid casts.
* Mon Apr 04 2005
- Introduce incredibly gross hack to make sure (int) casts are
  changed to (long)
- Update to gettext-0.14.3
- Move many files to the -devel package, trying to conform with
  gettext authors recommendation of split runtime/tools [#66614]
* Wed Feb 09 2005
- Revise the tmp file race patch:
  - Make umask not so strict [#50437]
  - Use mktemp in more places
* Tue Jan 11 2005
- Fix placement of po-mode-line-entry in mode-line-format for CVS Emacs.
* Thu Nov 25 2004
- add fixes for tmp file races [#47724]
* Tue Oct 19 2004
- locale-rename: no -> nb
* Tue Apr 20 2004
- Add autoreconf -fi
* Tue Mar 02 2004
- Update to 0.14.1 [#34491] including:
  - C#: xgettext now also supports C#.
  - Bugfixes
* Sat Jan 10 2004
- add %%run_ldconfig
* Fri Jan 09 2004
- Fix makefiles.
* Fri Dec 19 2003
- Update to 0.13
  - New languages support: shell, Perl, PHP ObjectiveC,
  the special format strings used in the gcc sources and
  C++ with Qt.
  - Complete examples for all supported programing languages
  added to the documentation.
* Tue Dec 09 2003
- Don't build PDF docu
- Remove lots of obsolete packages from neededforbuild
* Tue Jun 17 2003
- Update to 0.12.1
* Thu Apr 24 2003
- fix install_info --delete call and move from preun to postun
* Thu Feb 06 2003
- Use install-info macros
* Thu Aug 08 2002
- Update to 0.11.5
  From NEWS: Bug fixes in the gettext.m4 autoconf macros.
- Remove patches obsoleted by the update and adapt those
  still needed.
* Sat Jul 27 2002
- Fix filelist.
- Install missing m4 macros.
- Remove interaction in gettextize.
- Fix unwanted expansion in AM_PO_SUBDIRS.
* Fri Jul 26 2002
- Update to gettext 0.11.4
  - The tools now know about the ISO C 99 <inttypes.h> format
  string directive macros PRId64, PRIxMAX etc.
  - remove patches obsoleted by this new version
* Wed Jul 24 2002
- Remove texinfo.tex from source files and make use of texinfo.tex
  provided by the system.
- Install gettext.pdf under $RPM_BUILD_ROOT.
* Tue Jul 23 2002
- Update to gettext 0.11.3.
- Force checking for division by zero.
* Tue Jul 09 2002
- Fix autoload for po-mode.
* Thu Jun 13 2002
- mark msgfmt-6 as SKIP, division by 0 is not exactly well defined.
* Tue May 21 2002
- suse-start-po-mode.el: Load po-compat if "po-find-file-coding-system"
  doesn't come with stock Emacs.
* Thu Apr 25 2002
- Update to 0.11.2.
  From NEWS:
  - Bug fixes in the gettext.m4 autoconf macros.
  - New documentation section: Preparing Translatable Strings.
  - xgettext now also supports Python, Tcl, Awk and Glade.
  - msgfmt can create (and msgunfmt can dump) Tcl message catalogs.
  - msggrep has a new option -C that allows to search for strings
  in translator comments.
- Run gettext testsuite.
* Wed Apr 03 2002
- Move suse-start-po-mode.el here from po-utils.
- Remove ia64 workaround.
* Thu Mar 28 2002
- Use %%{_libdir}
* Mon Feb 18 2002
- Update %%files.
* Mon Feb 04 2002
- Update to 0.11
  This is a major update with lots of new features and new tools.
- Integrate a patch from Bruno Haible to make libtool regard
  DESTDIR when installing.
- Don't use the included libintl but rather the one in libc.
- Build dynamically linked binaries.
- Added the current texinfo.tex as otherwise gettext.pdf won't build.
* Fri Feb 01 2002
- changed neededforbuild <libpng> to <libpng-devel-packages>
* Wed Oct 31 2001
- Include manual pages
* Tue Oct 30 2001
- Update to 0.10.40
* Mon Aug 27 2001
- Update German translation from UMontreal Translation Project.
- Make sure to compile and install 'po-mode'.
* Fri May 11 2001
- Update to 0.10.37.
  Remove manual.diff as most of the fixes have been incorporated.
* Wed May 09 2001
- repacked sources with bzip2
* Thu Apr 12 2001
- Don't list directories shared with other packages in
  spec file.
* Mon Apr 09 2001
- Update to 0.10.36
- Drop msghack patch
- Improve gettext manual ( hopefully :)
- Now provides po-mode.el
* Thu Mar 08 2001
- Use more rpm macros.
- Build and install a printable manual (PDF).
* Fri Mar 02 2001
- Compile with -O1 on ia64 to work around compiler bug.
* Tue Sep 19 2000
- add patch from Bruno Haible. This allows statically linking
  programs with libintl.a on glibc systems.
* Tue Jun 20 2000
- xgettext.c: format YCP automatically set for .ycp extension
- gettext.spec: allow building on systems where gettext.m4 etc.
  are installed.
* Thu Jun 15 2000
- add patches from Paul Eggert needed for NLS in gcc
- add patch from Martin v. Loewis to allow searching
  inside of #define
* Fri May 05 2000
- Fix Bug 2812
- Add DESTDIR to intl/ and po/
- Use BuildRoot
* Mon May 01 2000
- Add msghack from RH's package: gettext-0.10.35-hacks.patch
* Wed Apr 26 2000
- Fix configure call (add %%{_target_cpu} macro)
* Thu Apr 06 2000
- replace config.{guess,sub} against config update macro for s390
* Thu Feb 03 2000
- Update config.{guess,sub} to latest version.
* Fri Jan 28 2000
- Do not even try to install po-mode.el.
* Tue Jan 25 2000
- Fix permissions of locale dirs.
- Move /usr/info -> /usr/share/info.
- Remove po-mode, now in extra package.
* Mon Dec 13 1999
- Remove libintl.a from file list, everything is in libc.
* Tue Nov 30 1999
- Add format checking for YCP strings.
- Don't declare getline and getdelim.
* Sat Nov 13 1999
- Clean up spec file and old, obsolete patches
* Fri Oct 15 1999
- Handle \v.
* Tue Oct 12 1999
- patched for use with YaST2 YCP scripts, new option
* Sat Oct 09 1999
- fixed to build on any arch
* Mon Sep 13 1999
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Sun Aug 15 1999
- update po-mode.el.
* Thu Mar 11 1999
- don't link against libintl.a on glibc systems
* Sun Feb 14 1999
- update po-mode.el.
* Thu Jan 07 1999
- respect alpha in specfile
* Thu Jan 07 1999
- don't redeclare getline
* Mon Dec 07 1998
- update to gettext 0.10.35
* Mon Dec 07 1998
- added locale.alias to file list for libc5 systems.
* Thu Nov 26 1998
- skipped /usr/share/locale/locale.alias from file list (is in localedb)
* Fri Sep 11 1998
- switch detection of GLIBC to automake
* Thu Aug 13 1998
- added export LC_CTYPE to build an install section in spec file.
* Wed Aug 12 1998
- new po-mode.el from
- and install po-mode.el.
* Fri Jun 19 1998
- dirty hack should at least work now
* Fri Jun 19 1998
- don't include libintl.h if glibc is used.
  did it with a dirty hack.  Will be done better in a while.
* Mon Mar 09 1998
- added some documentation
* Thu Feb 05 1998
- add missing m4 macro files in /usr/share/aclocal
* Fri Oct 10 1997
- update to version 0.10.32
* Thu Jan 23 1997
- update to version 0.10.26