File gettext-csharp.spec of Package gettext-runtime

# spec file for package gettext-csharp (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-csharp
BuildRequires:  fdupes mono-devel perl-libintl-perl tcl
Requires:       mono
License:        LGPL v2.1 or later
Group:          Development/Tools/Other
AutoReqProv:    on
Version:        0.17
Release:        93
Summary:        Native Language Support (NLS) for C#
PreReq:         %{install_info_prereq}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         gettext-%{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

Mono with its 'resgen' program uses a design that Microsoft created and
that gives the power to the software vendor and not to the user: it
doesn't allow the end-user to create his own localisations for existing
programs. As documented in the gettext manual:

The advantages of the .dll' format over the .resources' format are:

1. 1. Freedom to localize: Users can add their own translations to an
   application after it has been built and distributed.  Whereas
   when the programmer uses a ResourceManager' constructor provided
   by the system, the set of .resources' files for an application
   must be specified when the application is built and cannot be
   extended afterwards.

2., 3., 4. ...

The included GNU.Gettext.dll gives the user this freedom back and the
also included and handle PO files more
reliably than 'resgen'.

    Bruno Haible <>

%setup -q -n gettext-%{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/
autoreconf -fiv

export CFLAGS="$RPM_OPT_FLAGS -pipe -W -Wall -Dgcc_is_lint"
export CXXFLAGS="$RPM_OPT_FLAGS -pipe -W -Wall -Dgcc_is_lint"
%configure --enable-shared --enable-csharp 
make GMSGFMT=../src/msgfmt 

export LC_CTYPE=ISO-8859-15
mkdir examples
mv $RPM_BUILD_ROOT/%{_datadir}/doc/gettext/examples/*csharp* examples
mv $RPM_BUILD_ROOT/%{_datadir}/doc/gettext/csharpdoc         csharpdoc
cd examples
fdupes -r *|while read dupe; do
	if [ -z "$dupe" ]; then
	elif [ -z "$startlink" ]; then
		ln -f "$startlink" "$dupe"
cd ..
rm -rf	     $RPM_BUILD_ROOT/%{_datadir}/*
mkdir -p     $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}
mv examples  $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}
mv csharpdoc $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}


%doc %{_defaultdocdir}/%{name}
%exclude %_bindir
%exclude %_libdir/lib*
%exclude %_libdir/gettext/hostname
%exclude %_libdir/gettext/project-id
%exclude %_libdir/gettext/urlget
%exclude %_libdir/gettext/user-email
%exclude %_includedir
%exclude %_libdir/

* 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).
* Tue Dec 04 2007
- Add patch from upstreams to add the missing mode for the open call.
* Fri Nov 23 2007
- Remove the patch for disabling a test.
* Fri Nov 16 2007
- Don't run the testsuite.
* 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
* Wed Oct 31 2007
- renamed rpmlintrc to gettext-rpmlintrc and added it to the spec
  as source 1
* Fri Aug 10 2007
- Update to gettext 0.16.1, required by GnuPG 2.0.5
* Thu Aug 09 2007
- re-enable make check
* Tue Jul 10 2007
- Split .NET/Mono support into a package with its own spec
  to avoid making the base gettext package dependent on mono(-devel).