A new user interface for you! Read more...

File xerces-c.spec of Package xerces-c

%if 0%{?rhel_version} == 600
%define with_icu 0
%else
%define with_icu 1
%endif

Name:		xerces-c
Summary:	Validating XML Parser
Version:	3.1.1
Release:	1
License:	Apache-2.0
Group:		Productivity/Publishing/XML
URL:		http://xml.apache.org/xerces-c/
Source0:	http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-%{version}.tar.gz
Source1:	%{name}-rpmlintrc
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	dos2unix gcc-c++ pkgconfig
%if 0%{?with_icu}
BuildRequires:	libicu-devel
%endif


%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: XML 1.0 (Third Edition), XML 1.1 (First
Edition), DOM Level 1, 2, 3 Core, DOM Level 2.0 Traversal and Range,
DOM Level 3.0 Load and Save, SAX 1.0 and SAX 2.0, Namespaces in XML,
Namespaces in XML 1.1, XML Schema, XML Inclusions).


%package	devel
Summary:	Header files, libraries and development documentation for %{name}
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}

%description devel
This package contains the header files, static libraries and development
documentation for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-devel.

%package doc
Group:		Documentation
Summary:	Documentation for Xerces-C++ validating XML parser
# BuildArch:	noarch

%description doc
Documentation for Xerces-C++.

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.

%prep
%setup -q 
# Copy samples before build to avoid including built binaries in -doc package
mkdir -p _docs
cp -a samples/ _docs/

%build
# --disable-sse2 makes sure explicit -msse2 isn't passed to gcc so
# the binaries would be compatible with non-SSE2 i686 hardware.
# This only affects i686, as on x86_64 the compiler uses SSE2 by default.
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS"
%configure --disable-static \
  --disable-pretty-make \
%if 0%{?with_icu} == 0
  --without-icu \
%endif
  --disable-sse2
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR="$RPM_BUILD_ROOT"
# Correct errors in encoding
iconv -f iso8859-1 -t utf-8 CREDITS > CREDITS.tmp && mv -f CREDITS.tmp CREDITS
# Correct errors in line endings
pushd doc; dos2unix -k *.xml; popd
# Remove unwanted binaries
rm -rf $RPM_BUILD_ROOT%{_bindir}
# Remove .la files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc LICENSE
%{_libdir}/libxerces-c-3.*.so


%files devel
%defattr(-,root,root,-)
%{_libdir}/libxerces-c.so
%{_libdir}/pkgconfig/xerces-c.pc
%{_includedir}/xercesc/


%files doc
%defattr(-,root,root,-)
%doc README LICENSE NOTICE CREDITS doc _docs/*


%changelog
* Tue Jan 28 2014 Holger Manthey <holger.manthey@bertelsmann.de>
- inital version