Blob Blame Raw
Name:           tinyxpath
Version:        1.3.1
Release:        3%{?dist}
Summary:        Small XPath syntax decoder

License:        zlib
# tinyxpath include a bundled version of tinyxml
Patch0:         %{name}.remove_bundled_tinyxml.patch
# Fix false-positive of the binary test (see )
Patch1:         %name.fix_test.patch

BuildRequires:  tinyxml-devel autoconf automake

TinyXPath is a small footprint XPath syntax decoder, written in C++.
- Syntax decoding
- Application to a TinyXML tree
- Function to extract a result from a tree (string, node set or integer)

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       tinyxml-devel

%description    devel
The %{name}-devel package contains library and header files for
developing applications that use %{name}.

%setup -q -c %{name}-%{version}
rm -rf tinyxml* tinystr*

# Correct some errors due to bundled tinyxml
sed -i 's+TiXmlNode::+TiXmlNode::TINYXML_+g' *.cpp
sed -i 's+#include "tinystr.h"+//#include "tinystr.h"+g' *.h

# Fix wrong EOF encoding
sed -i 's/\r$//' AUTHORS

make -f Makefile.configure
# Build with -fPIC for the library
%configure CPPFLAGS="-fPIC"
make %{?_smp_mflags}

# Not really designed to be build as lib, DYI
g++ $RPM_OPT_FLAGS -shared -o lib%{name}.so.0.1 \
   -Wl,-soname,lib%{name}.so.0.1 `ls *.o | grep -v main.o` -ltinyxml

grep -q '<em>' out.htm && false


# Install headers by hands.
mkdir -p %{buildroot}%{_includedir}/%{name}
install -pDm644 *.h %{buildroot}%{_includedir}/%{name}

#Install lib by hands.
mkdir -p %{buildroot}%{_libdir}
install -m 755 lib%{name}.so.0.1 %{buildroot}%{_libdir}
ln -s lib%{name}.so.0.1 %{buildroot}%{_libdir}/lib%{name}.so.0
ln -s lib%{name}.so.0.1 %{buildroot}%{_libdir}/lib%{name}.so

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

# Exclude binary, whicih is only for test
%exclude %{_bindir}/tinyxpath


%files devel

* Fri Jul 31 2015 Alexandre Moine <> 1.3.1-3
- Add tinyxml-devel as a Requires for tinyxpath-devel
- Remove by-hands installation of AUTHORS

* Thu Jul 30 2015 Alexandre Moine <> 1.3.1-2
- Remove wrong license link
- Add AUTHORS to %%doc
- Exclude %%{_bindir}/tinyxpath beceause it is not useful
- Remove explicit dependency tinyxml
- Change soname to 

* Tue Jul 14 2015 Alexandre Moine <> 1.3.1-1
- Initial spec