File Xerces-c.spec of Package Xerces-c

#
# spec file for package Xerces-c (Version 2.8.0)
#
# 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

%define         tarversion  2_8_0
%define         sversion    28
%define         tarname     xerces-c-src_%{tarversion}

Name:           Xerces-c
BuildRequires:  gcc-c++ libicu-devel
License:        The Apache Software License
Group:          Productivity/Publishing/XML
AutoReqProv:    on
Version:        2.8.0
Release:        29.<RELEASE38>
Summary:        A Validating XML Parser
Url:            http://xerces.apache.org/xerces-c/
Source:         %{tarname}.tar.bz2
Patch0:         %{name}-%{version}-lib64.patch
Patch1:         %{name}-%{version}-gcc34.patch
Patch2:         %{name}-%{version}-optflags.patch
Patch3:         %{name}-%{version}-CVE-2009-1885.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Xerces-C is a validating XML parser written in a portable subset of
C++. Xerces-C makes it easy to give your application the ability to
read and write XML data. A shared library is provided for parsing,
generating, manipulating, and validating XML documents. Xerces-C is
faithful to the XML 1.0 recommendation and associated standards ( DOM
1.0, DOM 2.0. SAX 1.0, SAX 2.0, Namespaces).



Authors:
--------
    The Apache Group <apache@apache.org>

%package -n libXerces-c28
License:        The Apache Software License
# Requires:       Xerces-c = %{version}
Group:          Productivity/Publishing/XML
Summary:        Shared libraries for Xerces-c - a validating XML parser
Provides:       libXerces-c-28 = %{version}
Obsoletes:      libXerces-c-28 < %{version}

%description -n libXerces-c28
Xerces-C is a validating XML parser written in a portable subset of
C++. Xerces-C makes it easy to give your application the ability to
read and write XML data. A shared library is provided for parsing,
generating, manipulating, and validating XML documents. Xerces-C is
faithful to the XML 1.0 recommendation and associated standards ( DOM
1.0, DOM 2.0. SAX 1.0, SAX 2.0, Namespaces).

This package contains just the shared libraries.



Authors:
--------
    The Apache Group <apache@apache.org>

%package -n libXerces-c-devel
License:        The Apache Software License
Requires:       libXerces-c28 = %{version}
Provides:       Xerces-c-devel = 2.6.0
Obsoletes:      Xerces-c-devel <= 2.6.0
Group:          Development/Libraries/C and C++
Summary:        A validating XML parser - Development Files

%description -n libXerces-c-devel
Xerces-C is a validating XML parser written in a portable subset of
C++. Xerces-C makes it easy to give your application the ability to
read and write XML data. A shared library is provided for parsing,
generating, manipulating, and validating XML documents.

This package includes files needed for development with Xerces-c



Authors:
--------
    The Apache Group <apache@apache.org>

%prep
%setup -q -n xerces-c-src_%{tarversion}
%patch0
%patch1
%patch2
%patch3

%build
DIRS=$(find -type d)
%{?suse_update_config:%{suse_update_config -f $DIRS}}
export XERCESCROOT=$RPM_BUILD_DIR/%{tarname}
export ICUROOT=%{_prefix}
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
cd $XERCESCROOT/src/xercesc
autoreconf --install --force
%ifarch alpha ppc64 s390x sparc64 x86_64
BITSTOBUILD=64
%else
BITSTOBUILD=32
%endif
./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -ticu -b "$BITSTOBUILD" -P %{_prefix} -C --libdir=%{_libdir}
#make %{?jobs:-j%jobs}
make

%install
export XERCESCROOT=$RPM_BUILD_DIR/%{tarname}
export ICUROOT=%{_prefix}
cd $XERCESCROOT/src/xercesc
make install PREFIX=$RPM_BUILD_ROOT PREFIX_INCLUDE=$RPM_BUILD_ROOT/%{_includedir}/xercesc
# fix libs
cd $RPM_BUILD_ROOT%{_libdir}
for lib in libxerces-c libxerces-depdom; do
  ln -sf $lib.so.%{sversion}.0 $lib.so.%{sversion}
  ln -sf $lib.so.%{sversion}.0 $lib.so
done

%clean
rm -rf $RPM_BUILD_ROOT

%post -n libXerces-c28 -p /sbin/ldconfig

%postun -n libXerces-c28 -p /sbin/ldconfig

%files
%defattr(-, root, root)
%doc LICENSE LICENSE.txt Readme.html credits.txt

%files -n libXerces-c28
%defattr(-, root, root)
%{_libdir}/*.so.*

%files -n libXerces-c-devel
%defattr(-,root,root)
%{_includedir}/xercesc
%{_libdir}/*.so

%changelog
openSUSE Build Service is sponsored by