Name: SimpleITK Summary: Simplified layer build on top of the Insight Toolkit (ITK) Version: 1.2.3 Release: 1%{?dist} License: ASL 2.0 URL: http://www.simpleitk.org/ Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz # Upstream PR: https://github.com/SimpleITK/SimpleITK/pull/850 # Here we use rebased version for v1.2.3 release Patch0: https://github.com/dwrobel/%{name}/commit/394937f00396820c7998b91d06e3de368abdb10b.patch#/%{name}-1.2.3-Add-support-for-lua-v5.3.x-fixes-849.patch BuildRequires: /usr/bin/git Buildrequires: gcc-c++ BuildRequires: cmake >= 3.10 BuildRequires: lua-devel >= 5.3 BuildRequires: tcl-devel BuildRequires: swig BuildRequires: tk-devel BuildRequires: python3-devel BuildRequires: InsightToolkit-devel BuildRequires: gdcm-devel BuildRequires: libminc-devel BuildRequires: vxl-devel BuildRequires: fftw-devel BuildRequires: gtest-devel %description SimpleITK is a simplified, open source, interface to the National Library of Medicine’s Insight Segmentation and Registration Toolkit (ITK), a C++ open source image analysis toolkit which is widely used in academia and industry. SimpleITK is available for eight programming languages including C++, Python, R, Java, C#, Lua, Ruby, and TCL. Binary distributions of SimpleITK are currently available for all three major operating systems (Linux, OS X, and Windows). %package devel Summary: SimpleITK Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary}. Install this if you want to develop applications that use SimpleITK. %package examples Summary: C++, Tcl and Python example programs/scripts for SimpleITK Requires: %{name}%{?_isa} = %{version}-%{release} %description examples SimpleITK examples %prep %autosetup -S git # Fix shebang find Examples -name '*.py' | xargs -n 1 sed -i 'sx#!/usr/bin/env\ pythonx#!/usr/bin/python3xg' %build mkdir -p build pushd build # TODO enable python bindings %cmake \ -DCMAKE_CXX_FLAGS:STRING="%{optflags} -DITK_LEGACY_FUTURE_REMOVE=1" \ -DBUILD_SHARED_LIBS=ON \ -DSimpleITK_BUILD_DISTRIBUTE:BOOL=ON \ -DSimpleITK_EXPLICIT_INSTANTIATION=OFF \ -DSimpleITK_INSTALL_LIBRARY_DIR=%{_libdir} \ -DSimpleITK_INSTALL_ARCHIVE_DIR=%{_libdir} \ -DWRAP_DEFAULT:BOOL=OFF \ -DWRAP_PYTHON:BOOL=OFF \ -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 \ -DSWIG_EXECUTABLE:PATH=/usr/bin/swig \ -DCMAKE_PREFIX_PATH=%{_libdir}/cmake/InsightToolkit/ \ -DBUILD_DOXYGEN:BOOL=OFF \ .. %make_build VERBOSE=1 popd %install %make_install -C build VERBOSE=1 # Install examples install -p -m 0775 -d %{buildroot}%{_datadir}/%{name}/examples cp -av Examples/* %{buildroot}%{_datadir}/%{name}/examples # Remove duplicate LICENSE, NOTICE and Readme.md rm -rf %{buildroot}%{_docdir} %files %license LICENSE %doc NOTICE Readme.md %{_libdir}/*.so.* %files devel %{_libdir}/*.so %{_libdir}/cmake/%{name}*/ %{_includedir}/%{name}*/ %exclude %{_includedir}/%{name}*/SimpleITKBasicFiltersGeneratedHeaders.i %files examples %{_datadir}/%{name}*/examples %changelog * Mon Oct 21 2019 Damian Wrobel - 1.2.3-1 - Initial RPM Release