[packages/libSavitar] - new

baggins baggins at pld-linux.org
Sun May 14 14:57:56 CEST 2017


commit e332c088a3a0f5eebe267e80157deb4b54959276
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun May 14 14:57:36 2017 +0200

    - new

 lib-suffix.patch     | 30 +++++++++++++++++
 libSavitar.spec      | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 no-pugixml.patch     | 25 ++++++++++++++
 system-pugixml.patch | 42 ++++++++++++++++++++++++
 4 files changed, 190 insertions(+)
---
diff --git a/libSavitar.spec b/libSavitar.spec
new file mode 100644
index 0000000..4d5f8fb
--- /dev/null
+++ b/libSavitar.spec
@@ -0,0 +1,93 @@
+%global commit 1ad7ddb202ec36f6b486b1f70279329ec0b8cc48
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+%global datestamp 20170501
+%global relstring %{datestamp}git%{shortcommit}
+Summary:	C++ implementation of 3mf loading with SIP Python bindings
+Name:		libSavitar
+Version:	0
+Release:	0.1.%{relstring}
+License:	AGPLv3+
+Group:		Libraries
+Source0:	https://github.com/Ultimaker/libSavitar/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
+# Source0-md5:	c9da107ed1e4f954b080258b7811c85e
+Patch0:		no-pugixml.patch
+Patch1:		lib-suffix.patch
+Patch2:		system-pugixml.patch
+URL:		https://github.com/Ultimaker/libSavitar
+BuildRequires:	cmake
+BuildRequires:	libstdc++-devel
+BuildRequires:	pugixml-devel
+BuildRequires:	python3-devel
+BuildRequires:	python3-sip-devel
+BuildRequires:	sip
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Savitar is a C++ implementation of 3mf loading with SIP Python
+bindings. 3mf is a 3D printing file format.
+
+%package devel
+# The cmake scripts are BSD
+Summary:	Development files for libsavitar
+License:	AGPLv3+ and BSD
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+Savitar is a C++ implementation of 3mf loading with SIP Python
+bindings. 3mf is a 3D printing file format.
+
+Development files.
+
+%package -n python3-savitar
+Summary:	Python 3 libSavitar bindings
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+
+%description -n python3-savitar
+Savitar is a C++ implementation of 3mf loading with SIP Python
+bindings. 3mf is a 3D printing file format.
+
+The Python bindings.
+
+%prep
+%setup -q -n %{name}-%{commit}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+%build
+mkdir build
+cd build
+%{cmake} .. \
+	-DCMAKE_SKIP_RPATH:BOOL=ON
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc README.md
+%attr(755,root,root) %{_libdir}/libSavitar.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libSavitar.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libSavitar.so
+%{_includedir}/Savitar
+%{_libdir}/cmake/Savitar
+
+%files -n python3-savitar
+%defattr(644,root,root,755)
+%doc README.md
+%attr(755,root,root) %{py3_sitedir}/Savitar.so
diff --git a/lib-suffix.patch b/lib-suffix.patch
new file mode 100644
index 0000000..8d9111a
--- /dev/null
+++ b/lib-suffix.patch
@@ -0,0 +1,30 @@
+--- libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/CMakeLists.txt~	2017-05-01 22:26:43.000000000 +0200
++++ libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/CMakeLists.txt	2017-05-14 14:51:34.791994861 +0200
+@@ -15,9 +15,9 @@
+     find_package(SIP REQUIRED)
+     if(EXISTS /etc/debian_version)
+         # Running on a debian-based system, which requires special handling for python modules.
+-        set(PYTHON_SITE_PACKAGES_DIR lib/python3/dist-packages CACHE STRING "Directory to install Python bindings to")
++	set(PYTHON_SITE_PACKAGES_DIR lib${LIB_SUFFIX}/python3/dist-packages CACHE STRING "Directory to install Python bindings to")
+     else()
+-        set(PYTHON_SITE_PACKAGES_DIR lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages CACHE STRING "Directory to install Python bindings to")
++        set(PYTHON_SITE_PACKAGES_DIR lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages CACHE STRING "Directory to install Python bindings to")
+     endif()
+     include_directories(python/ src/ ${SIP_INCLUDE_DIR} ${PYTHON_INCLUDE_DIR})
+ endif()
+@@ -56,7 +56,7 @@
+ set(SAVITAR_VERSION 0.1.0)
+ set(SAVITAR_SOVERSION 0)
+ 
+-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
++set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
+ 
+ if(BUILD_STATIC)
+     add_library(Savitar STATIC ${savitar_SRCS})
+@@ -116,4 +116,4 @@
+     ${CMAKE_BINARY_DIR}/SavitarConfig.cmake
+     ${CMAKE_BINARY_DIR}/SavitarConfigVersion.cmake
+     DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Savitar
+-)
+\ No newline at end of file
++)
diff --git a/no-pugixml.patch b/no-pugixml.patch
new file mode 100644
index 0000000..7f828aa
--- /dev/null
+++ b/no-pugixml.patch
@@ -0,0 +1,25 @@
+From da7aea99012720c316881a10cb41ebbb9526d84b Mon Sep 17 00:00:00 2001
+From: rpm-build <rpm-build>
+Date: Wed, 3 May 2017 17:02:08 +0200
+Subject: [PATCH] Don't build pugixml
+
+---
+ CMakeLists.txt | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 040830c..a8f700d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -8,8 +8,6 @@ option(BUILD_PYTHON "Build " ON)
+ option(BUILD_STATIC "Build as a static library" OFF)
+ 
+ 
+-add_subdirectory(pugixml)
+-
+ if(BUILD_PYTHON)
+     set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+     find_package(SIP REQUIRED)
+-- 
+2.11.0
+
diff --git a/system-pugixml.patch b/system-pugixml.patch
new file mode 100644
index 0000000..735dc48
--- /dev/null
+++ b/system-pugixml.patch
@@ -0,0 +1,42 @@
+diff -ur libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48.orig/src/MeshData.cpp libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/src/MeshData.cpp
+--- libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48.orig/src/MeshData.cpp	2017-05-01 22:26:43.000000000 +0200
++++ libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/src/MeshData.cpp	2017-05-14 14:54:16.549302144 +0200
+@@ -1,5 +1,5 @@
+ #include "MeshData.h"
+-#include "../pugixml/src/pugixml.hpp"
++#include <pugixml.hpp>
+ #include <iostream>
+ 
+ using namespace Savitar;
+diff -ur libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48.orig/src/Scene.cpp libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/src/Scene.cpp
+--- libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48.orig/src/Scene.cpp	2017-05-01 22:26:43.000000000 +0200
++++ libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/src/Scene.cpp	2017-05-14 14:54:16.549302144 +0200
+@@ -1,5 +1,5 @@
+ #include "Scene.h"
+-#include "../pugixml/src/pugixml.hpp"
++#include <pugixml.hpp>
+ #include <iostream>
+ #include <string>
+ using namespace Savitar;
+diff -ur libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48.orig/src/SceneNode.cpp libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/src/SceneNode.cpp
+--- libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48.orig/src/SceneNode.cpp	2017-05-01 22:26:43.000000000 +0200
++++ libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/src/SceneNode.cpp	2017-05-14 14:54:16.549302144 +0200
+@@ -1,5 +1,5 @@
+ #include "SceneNode.h"
+-#include "../pugixml/src/pugixml.hpp"
++#include <pugixml.hpp>
+ #include <iostream>
+ using namespace Savitar;
+ 
+diff -ur libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48.orig/src/ThreeMFParser.h libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/src/ThreeMFParser.h
+--- libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48.orig/src/ThreeMFParser.h	2017-05-01 22:26:43.000000000 +0200
++++ libSavitar-1ad7ddb202ec36f6b486b1f70279329ec0b8cc48/src/ThreeMFParser.h	2017-05-14 14:54:16.549302144 +0200
+@@ -21,7 +21,7 @@
+ 
+ #include "SavitarExport.h"
+ #include "SceneNode.h"
+-#include "../pugixml/src/pugixml.hpp"
++#include <pugixml.hpp>
+ 
+ #include <string>
+ namespace Savitar
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libSavitar.git/commitdiff/e332c088a3a0f5eebe267e80157deb4b54959276



More information about the pld-cvs-commit mailing list