# # spec file for package insighttoolkit # # Copyright (c) 2020 SUSE LLC # Copyright (c) 2016 Angelos Tzotsos . # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global __builder ninja %define tarname InsightToolkit %define baseversion 5.0 %define libname lib%{name}5 Name: insighttoolkit Version: 5.0.1 Release: 0 Summary: Insight Segmentation and Registration Toolkit License: Apache-2.0 Group: Development/Libraries/C and C++ URL: https://www.itk.org Source: https://github.com/InsightSoftwareConsortium/ITK/releases/download/v%{version}/%{tarname}-%{version}.tar.gz Patch0: dcmtk-cmake.patch # PATCH-FIX-UPSTREAM proper linking against math library Patch1: nrrdio-linking.patch # PATCH-FIX-UPSTREAM proper linking against math library Patch3: itklbfgs-linking.patch BuildRequires: CastXML-devel BuildRequires: cmake BuildRequires: dcmtk BuildRequires: dcmtk-devel BuildRequires: fdupes BuildRequires: fftw3-threads-devel BuildRequires: gcc-c++ BuildRequires: gdcm-devel BuildRequires: gtest BuildRequires: hdf5-devel BuildRequires: libnsl-devel BuildRequires: memory-constraints BuildRequires: ninja BuildRequires: pkgconfig BuildRequires: python3-devel BuildRequires: swig # Indirect DCMTK dep. Should DCMTK be fixed? # tcpd-devel is needed for libwrap.so on Tumbleweed (> Leap 42.3) BuildRequires: tcpd-devel BuildRequires: vtk-devel BuildRequires: vtk-qt BuildRequires: xz BuildRequires: cmake(double-conversion) BuildRequires: pkgconfig(eigen3) BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(fftw3) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(zlib) %description ITK is a suite of software tools for image analysis. %package devel Summary: Development files for ITK Group: Development/Libraries/C and C++ Requires: %{libname} = %{version} Requires: dcmtk-devel Requires: fftw3-devel Requires: fftw3-threads-devel Requires: hdf5-devel Requires: libexpat-devel Requires: libjpeg-devel Requires: libpng-devel Requires: libtiff-devel Requires: vtk-devel Requires: zlib-devel Provides: lib%{name}-devel %description devel Development files for the ITK library. ITK is a suite of software tools for image analysis. %package -n %{libname} Summary: Insight Segmentation and Registration Toolkit Group: System/Libraries %description -n %{libname} Shared ITK library. ITK is a suite of software tools for image analysis. %package -n python3-itk Summary: Python bindings for itk Group: Development/Libraries/C and C++ %description -n python3-itk ITK is a suite of software tools for image analysis. This package provides the python3 bindings for ITK. %prep %setup -q -n %{tarname}-%{version} %patch0 -p1 %patch1 -p1 %patch3 -p1 %build %limit_build -m 2000 # HAS TROUBLE LOCATING gdcm INCLUDEDIRS, ADD IT TO CXXFLAGS export CXXFLAGS+=" -I%{_includedir}/gdcm/" %cmake \ -DITK_INSTALL_LIBRARY_DIR:PATH=%{_lib}/ \ -DITK_INSTALL_INCLUDE_DIR:PATH=include/%{name}/ \ -DITK_INSTALL_PACKAGE_DIR:PATH=%{_lib}/cmake/%{name}/ \ -DITK_INSTALL_RUNTIME_DIR:PATH=%{_bindir} \ -DITK_INSTALL_DOC_DIR=share/doc/packages/%{name}/ \ -DBUILD_EXAMPLES:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DBUILD_TESTING:BOOL=OFF \ -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \ -DITK_USE_FFTWD:BOOL=ON \ -DITK_USE_FFTWF:BOOL=ON \ -DITK_USE_SYSTEM_LIBRARIES:BOOL=ON \ -DITK_USE_SYSTEM_GDCM:BOOL=ON \ -DITK_USE_SYSTEM_CASTXML:BOOL=ON \ -DITK_USE_STRICT_CONCEPT_CHECKING:BOOL=ON \ -DITK_USE_SYSTEM_VXL:BOOL=OFF \ -DVCL_INCLUDE_CXX_0X:BOOL=ON \ -DITK_WRAPPING:BOOL=OFF \ -DITK_FORBID_DOWNLOADS=ON \ -DITK_WRAP_PYTHON:BOOL=ON %cmake_build %install %cmake_install %fdupes %{buildroot}/%{_prefix} %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %files -n %{libname} %license LICENSE %{_libdir}/*.so.1 %files devel %{_includedir}/%{name}/ %{_libdir}/lib*.so %{_libdir}/cmake/ %{_bindir}/itkTestDriver %doc %{_docdir}/%{name}/ %files -n python3-itk %{python3_sitearch}/*.py %{python3_sitearch}/itk/ %changelog