File gettext-runtime.spec of Package gettext-runtime

#
# spec file for package gettext-runtime (Version 0.17)
#
# Copyright (c) 2009 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 http://bugs.opensuse.org/
#

# norootforbuild


Name:           gettext-runtime
%define pacname gettext
Version:        0.17
Release:        64
BuildRequires:  gcc-c++ perl-libintl-perl tcl
# To get an updated linkdupes.sh (in case there are new dupes), temproarily enable:
#BuildRequires: fdupes
Url:            http://www.gnu.org/software/gettext/
License:        GPL v3 or later ; LGPL v2.0 or later
Group:          Development/Tools/Other
# bug437293
%ifarch ppc64
Obsoletes:      gettext-64bit
%endif
#
#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
Source3:        gettext-linkdupes.sh
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
Patch13:        po-mode-cvs-2009-07-23.patch

%description
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.



Authors:
--------
    Ulrich Drepper <drepper@cygnus.com>
    Bruno Haible <bruno@clisp.org>

%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
# bug437293
%ifarch ppc64
Obsoletes:      gettext-devel-64bit
%endif
#
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.



Authors:
--------
    Ulrich Drepper <drepper@cygnus.com>
    Bruno Haible <bruno@clisp.org>

%prep
%setup -q -n %{pacname}-%{version}
%patch
%patch2
%patch3
%patch4
%patch5
%patch6 -p1
%patch7
%patch8
%patch9
%patch10
%patch11
%patch12
%patch13 -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/
popd
# force rebuild with non-broken makeinfo
rm -f gettext-tools/doc/*.info

%build
# expect a couple "You should update your `aclocal.m4' by running aclocal."
autoreconf -fiv
#sh autogen.sh
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

%install
%define my_docdir %{_defaultdocdir}/%{name}
export LC_CTYPE=ISO-8859-15
make install DESTDIR=$RPM_BUILD_ROOT docdir=%{my_docdir}
cp -pr AUTHORS COPYING NEWS README*	$RPM_BUILD_ROOT/%{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}/preloadable_libintl.so ];then
	chmod 755 $RPM_BUILD_ROOT/%{_libdir}/preloadable_libintl.so
fi
# 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

%check
# 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!"
%else
	echo "make check failed, check it!"
	exit 5
%endif
}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun  -p /sbin/ldconfig

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

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

%files -f gettext-runtime.lang
%defattr(-,root,root)
%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
%_bindir/gettext
%_bindir/ngettext
%_bindir/envsubst
%_bindir/gettext.sh
%_bindir/msgfmt
%_libdir/libgettextlib-*.so
%_libdir/libgettextsrc-*.so
%_libdir/libasprintf.so.*
%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/*
%_datadir/gettext/ABOUT-NLS
%dir %_prefix/share/emacs
%dir %_prefix/share/emacs/site-lisp
%_prefix/share/emacs/site-lisp/po-compat.*
%_prefix/share/emacs/site-lisp/po-mode.*
%_prefix/share/emacs/site-lisp/start-po.*
%_prefix/share/emacs/site-lisp/suse-start-po-mode.el

%files -n gettext-tools -f gettext-tools.lang
%defattr(-,root,root)
%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
%_bindir/msg[a-eg-u]*
%_bindir/msgfilter
%_bindir/xgettext
%_bindir/gettextize
%_bindir/autopoint
%_bindir/recode-sr-latin
%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/gettext.info*
%doc %_infodir/autosprintf.info*
%_includedir/gettext-po.h
%_includedir/autosprintf.h
%_libdir/libasprintf.*a
%_libdir/libasprintf.so
%_libdir/libgettextlib.*
%_libdir/libgettextsrc.*
%_libdir/libgettextpo*
%_libdir/preloadable_libintl.so
%_libdir/gettext
%_datadir/%pacname/config.rpath
%_datadir/%pacname/intl
%_datadir/%pacname/po
%_datadir/%pacname/projects
%_datadir/%pacname/gettext.h
%_datadir/%pacname/msgunfmt.tcl
%_datadir/%pacname/javaversion.class
%_datadir/%pacname/archive.tar.gz
%_datadir/%pacname/styles
%_datadir/aclocal/*

%changelog
openSUSE Build Service is sponsored by