%global commit 1ad7ddb202ec36f6b486b1f70279329ec0b8cc48 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global datestamp 20170501 %global relstring %{datestamp}git%{shortcommit} Name: libsavitar Version: 0 Release: 0.1.%{relstring}%{?dist} Summary: C++ implementation of 3mf loading with SIP Python bindings License: AGPLv3+ URL: https://github.com/Ultimaker/libSavitar Source0: %{url}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz Patch0: %{name}-no-pugixml.patch BuildRequires: cmake BuildRequires: dos2unix BuildRequires: gcc-c++ BuildRequires: git BuildRequires: pugixml-devel BuildRequires: python3-devel BuildRequires: python3-sip-devel BuildRequires: /usr/bin/sip %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 License: AGPLv3+ and BSD Summary: Development files for libsavitar Requires: %{name}%{?_isa} = %{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 %{?python_provide:%python_provide python3-savitar} %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 %autosetup -n libSavitar-%{commit} -p1 -S git # Wrong end of line encoding dos2unix README.md # Bundling rm pugixml -rf sed -i 's|"../pugixml/src/pugixml.hpp"||g' src/*.cpp src/*.h # Move stuff to lib64 on 64 arches # TODO propose a change to honor -DLIB_SUFFIX=64 sed -i 's|DESTINATION lib|DESTINATION %{_lib}|g' CMakeLists.txt sed -i 's|PYTHON_SITE_PACKAGES_DIR lib|PYTHON_SITE_PACKAGES_DIR %{_lib}|g' CMakeLists.txt %build export CXXFLAGS="%{optflags} -Wl,--as-needed" %{cmake} -DCMAKE_SKIP_RPATH:BOOL=ON . make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license LICENSE %doc README.md %{_libdir}/libSavitar.so.* %files devel %license LICENSE cmake/COPYING-CMAKE-SCRIPTS %{_libdir}/libSavitar.so %{_includedir}/Savitar # Own the dir not to depend on cmake: %{_libdir}/cmake %files -n python3-savitar %license LICENSE %doc README.md %{python3_sitearch}/Savitar.so %changelog * Wed May 03 2017 Miro HronĨok - 0-0.1.20170501git1ad7ddb - New package