[packages/pugixml] - updated to 1.8 - use cmake build system - added pc patch, package .pc file

qboosh qboosh at pld-linux.org
Sat Feb 25 14:52:56 CET 2017


commit 92afb597eb75aed24010b8b0c0cb6a8110ada0d3
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Feb 25 14:54:53 2017 +0100

    - updated to 1.8
    - use cmake build system
    - added pc patch, package .pc file

 pugixml-pc.patch | 35 +++++++++++++++++++++++++++++++++++
 pugixml.spec     | 53 +++++++++++++++++++++++++++++++++++++++--------------
 2 files changed, 74 insertions(+), 14 deletions(-)
---
diff --git a/pugixml.spec b/pugixml.spec
index b9312c4..dc9a585 100644
--- a/pugixml.spec
+++ b/pugixml.spec
@@ -1,16 +1,22 @@
+#
+# Conditional build:
+%bcond_without	static_libs	# static library
+#
 Summary:	C++ XML processing library
 Summary(pl.UTF-8):	Biblioteka C++ do przetwarzania XML-a
 Name:		pugixml
-Version:	1.6
-Release:	2
+Version:	1.8
+Release:	1
 License:	MIT
 Group:		Libraries
-Source0:	http://github.com/zeux/pugixml/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	35d942d58bec80058f7641c6604729ea
+#Source0Download: http://pugixml.org/
+Source0:	http://github.com/zeux/pugixml/releases/download/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	ffa59ee4853958e243050e6b690b4f2e
 Patch0:		longlong.patch
+Patch1:		%{name}-pc.patch
 URL:		http://pugixml.org/
+BuildRequires:	cmake >= 2.6
 BuildRequires:	libstdc++-devel
-BuildRequires:	libtool
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -60,18 +66,34 @@ Statyczna biblioteka pugixml.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
-cd src
-libtool --mode=compile %{__cxx} %{rpmcxxflags} -c pugixml.cpp
-libtool --mode=link %{__cxx} %{rpmldflags} %{rpmcxxflags} -o libpugixml.la pugixml.lo -rpath %{_libdir}
+install -d build
+cd build
+%cmake .. \
+	-DBUILD_PKGCONFIG=ON \
+	-DBUILD_SHARED_LIBS=ON
+cd ..
+
+%if %{with static_libs}
+install -d build-static
+cd build-static
+%cmake .. \
+	-DBUILD_SHARED_LIBS=OFF
+cd ..
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
 
-libtool --mode=install install src/libpugixml.la $RPM_BUILD_ROOT%{_libdir}
-install src/pugi*.hpp $RPM_BUILD_ROOT%{_includedir}
+%if %{with static_libs}
+%{__make} -C build-static install \
+	DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -82,17 +104,20 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc readme.txt
-%attr(755,root,root) %{_libdir}/libpugixml.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libpugixml.so.0
+%attr(755,root,root) %{_libdir}/libpugixml.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libpugixml.so.1
 
 %files devel
 %defattr(644,root,root,755)
 %doc docs/*
 %attr(755,root,root) %{_libdir}/libpugixml.so
-%{_libdir}/libpugixml.la
 %{_includedir}/pugiconfig.hpp
 %{_includedir}/pugixml.hpp
+%{_pkgconfigdir}/pugixml.pc
+%{_libdir}/cmake/pugixml
 
+%if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libpugixml.a
+%endif
diff --git a/pugixml-pc.patch b/pugixml-pc.patch
new file mode 100644
index 0000000..365cc5d
--- /dev/null
+++ b/pugixml-pc.patch
@@ -0,0 +1,35 @@
+--- pugixml-1.8/CMakeLists.txt.orig	1970-01-01 01:00:00.000000000 +0100
++++ pugixml-1.8/CMakeLists.txt	2017-02-25 14:36:09.707346051 +0100
+@@ -50,11 +50,6 @@
+ set_target_properties(pugixml PROPERTIES VERSION 1.8 SOVERSION 1)
+ get_target_property(PUGIXML_VERSION_STRING pugixml VERSION)
+ 
+-if(BUILD_PKGCONFIG)
+-	# Install library into its own directory under LIBDIR
+-	set(INSTALL_SUFFIX /pugixml-${PUGIXML_VERSION_STRING})
+-endif()
+-
+ install(TARGETS pugixml EXPORT pugixml-config
+ 	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX}
+ 	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX}
+@@ -64,7 +59,7 @@
+ 
+ if(BUILD_PKGCONFIG)
+ 	configure_file(scripts/pugixml.pc.in ${PROJECT_BINARY_DIR}/pugixml.pc @ONLY)
+-	install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
++	install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig)
+ endif()
+ 
+ if(BUILD_TESTS)
+--- pugixml-1.8/scripts/pugixml.pc.in.orig	1970-01-01 01:00:00.000000000 +0100
++++ pugixml-1.8/scripts/pugixml.pc.in	2017-02-25 14:44:49.164006784 +0100
+@@ -1,7 +1,7 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-includedir=${prefix}/include/pugixml- at PUGIXML_VERSION_STRING@
+-libdir=${exec_prefix}/lib/pugixml- at PUGIXML_VERSION_STRING@
++includedir=${prefix}/include
++libdir=@CMAKE_INSTALL_LIBDIR@
+ 
+ Name: pugixml
+ Description: Light-weight, simple and fast XML parser for C++ with XPath support.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pugixml.git/commitdiff/92afb597eb75aed24010b8b0c0cb6a8110ada0d3



More information about the pld-cvs-commit mailing list