[packages/tinyxpath] - initial from FC

arekm arekm at pld-linux.org
Sun Jan 21 19:30:50 CET 2018


commit 211717848652866aa8d9a4e345e89a82b8f193c7
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Jan 21 19:30:34 2018 +0100

    - initial from FC

 tinyxpath.fix_test.patch               | 14 +++++
 tinyxpath.remove_bundled_tinyxml.patch | 21 ++++++++
 tinyxpath.spec                         | 97 ++++++++++++++++++++++++++++++++++
 3 files changed, 132 insertions(+)
---
diff --git a/tinyxpath.spec b/tinyxpath.spec
new file mode 100644
index 0000000..7359a7b
--- /dev/null
+++ b/tinyxpath.spec
@@ -0,0 +1,97 @@
+Summary:	Small XPath syntax decoder
+Name:		tinyxpath
+Version:	1.3.1
+Release:	1
+License:	zlib
+Group:		Libraries
+URL:		http://tinyxpath.sourceforge.net/
+Source0:	http://downloads.sourceforge.net/tinyxpath/%{name}_1_3_1.zip
+# Source0-md5:	043f9b3e2e7cca3e98324ce41983e7a3
+# tinyxpath include a bundled version of tinyxml
+Patch0:		%{name}.remove_bundled_tinyxml.patch
+# Fix false-positive of the binary test (see https://sourceforge.net/p/tinyxpath/support-requests/7/ )
+Patch1:		%name.fix_test.patch
+BuildRequires:	autoconf
+BuildRequires:	automake
+BuildRequires:	tinyxml-devel
+
+%description
+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} = %{version}-%{release}
+Requires:	tinyxml-devel
+
+%description    devel
+The %{name}-devel package contains library and header files for
+developing applications that use %{name}.
+
+%prep
+%setup -q -c %{name}-%{version}
+%patch0
+%patch1
+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
+
+%build
+%{__make} -f Makefile.configure
+# Build with -fPIC for the library
+%configure \
+   CPPFLAGS="-fPIC %{rpmcppflags}"
+%{__make}
+
+# 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
+
+
+%check
+./tinyxpath
+grep -q '<em>' out.htm && false
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+# Install headers by hands.
+install -d $RPM_BUILD_ROOT%{_includedir}/%{name}
+install -pDm644 *.h $RPM_BUILD_ROOT%{_includedir}/%{name}
+
+#Install lib by hands.
+install -d $RPM_BUILD_ROOT%{_libdir}
+cp -p lib%{name}.so.0.1 $RPM_BUILD_ROOT%{_libdir}
+ln -s lib%{name}.so.0.1 $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so.0
+ln -s lib%{name}.so.0.1 $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so
+
+# binary, whicih is only for test
+rm $RPM_BUILD_ROOT%{_bindir}/tinyxpath
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS
+%attr(755,root,root) %{_libdir}/lib%{name}.so.0
+%attr(755,root,root) %{_libdir}/lib%{name}.so.0.*
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/%{name}
+%attr(755,root,root) %{_libdir}/lib%{name}.so
diff --git a/tinyxpath.fix_test.patch b/tinyxpath.fix_test.patch
new file mode 100644
index 0000000..64aaa76
--- /dev/null
+++ b/tinyxpath.fix_test.patch
@@ -0,0 +1,14 @@
+--- test.xml.orig	2015-07-30 21:32:20.408994533 +0200
++++ test.xml	2015-07-30 21:31:12.284580541 +0200
+@@ -2,9 +2,9 @@
+     <b val="123">
+         <b />
+         <c />
+-        <!-- -122.0 -->
++        <!-- 500.0 -->
+         <d />
+     </b>
+-    <!-- 500.0 -->
++    <!-- -122.0 -->
+     <x target='xyz'>sub text</x>
+ </a>
diff --git a/tinyxpath.remove_bundled_tinyxml.patch b/tinyxpath.remove_bundled_tinyxml.patch
new file mode 100644
index 0000000..f2c3890
--- /dev/null
+++ b/tinyxpath.remove_bundled_tinyxml.patch
@@ -0,0 +1,21 @@
+--- Makefile.am.orig	2004-01-18 13:24:50.000000000 +0100
++++ Makefile.am	2015-07-14 19:40:37.331308491 +0200
+@@ -1,16 +1,15 @@
+ bin_PROGRAMS = tinyxpath
+ 
+ tinyxpath_SOURCES = htmlutil.cpp main.cpp \
+-   tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp \
+    action_store.cpp lex_util.cpp node_set.cpp tokenlist.cpp xml_util.cpp \
+    xpath_expression.cpp xpath_processor.cpp xpath_stack.cpp xpath_stream.cpp xpath_syntax.cpp xpath_static.cpp
+ 
+-tinyxpath_LDADD = 
++tinyxpath_LDADD = -ltinyxml
+ 
+ # set the include path found by configure
+ INCLUDES= $(all_includes) 
+ 
+-AM_CXXFLAGS = -Wall
++AM_CXXFLAGS = -Wall --include /usr/include/tinyxml.h 
+ 
+ # the library search path.
+ tinyxpath_LDFLAGS = $(all_libraries)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/tinyxpath.git/commitdiff/211717848652866aa8d9a4e345e89a82b8f193c7



More information about the pld-cvs-commit mailing list