# VTK library implementing the IEC 61217 radiotherapy coordinate-system # transform hierarchy (gantry / collimator / patient support / table top). # # Packaged for 3dslicer-rt (SlicerRT), whose # DrrImageComputation/Logic/CMakeLists.txt:3 does # find_package(vtkIECTransformLogic REQUIRED) # and whose SuperBuild/External_vtkIECTransformLogic.cmake otherwise clones it # from git at configure time -- impossible in mock/COPR. # # Upstream pins "origin/main" with no tag or release, so we pin the commit # ourselves. Upstream declares no version in project(), hence the 0 Version and # a snapshot Release. %global commit b81c2de2e8e55037d8721da87aae35463ced1e97 %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20260529 Name: vtkIECTransformLogic Version: 0 Release: 0.3.%{snapdate}git%{shortcommit}%{?dist} Summary: VTK implementation of the IEC 61217 radiotherapy transform hierarchy License: BSD-3-Clause URL: https://github.com/EBATINCA/RadiotherapyTransformsIEC Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildRequires: cmake >= 3.20 BuildRequires: ninja-build BuildRequires: gcc-c++ BuildRequires: vtk-devel >= 9.6.2 # VTK's cmake config runs find_package for every module dependency at # find_package(VTK) time; these are the ones a minimal consumer still needs. BuildRequires: freetype-devel BuildRequires: pugixml-devel BuildRequires: fmt-devel BuildRequires: utf8cpp-devel BuildRequires: PEGTL-devel BuildRequires: jsoncpp-devel BuildRequires: cli11-devel BuildRequires: viskores-devel # COPR vtk 9.6.2 and Fedora's vtk 9.5.x share the libvtk*.so.1 SONAME, so an # unpinned Requires can resolve to an ABI-incompatible build. Requires: vtk >= 9.6.2 %description vtkIECTransformLogic provides the coordinate-system transform hierarchy defined by IEC 61217 for radiotherapy treatment machines: the fixed reference, gantry, beam limiting device, wedge filter, patient support, table top eccentric and table top systems, and the transforms between them. %package devel Summary: Development files for vtkIECTransformLogic Requires: %{name}%{?_isa} = %{version}-%{release} Requires: vtk-devel >= 9.6.2 %description devel Headers and CMake package configuration for building against vtkIECTransformLogic. %prep %autosetup -n RadiotherapyTransformsIEC-%{commit} # Upstream declares no version anywhere and builds a bare, unversioned # libvtkIECTransformLogic.so -- fine inside Slicer's private bundled layout, # but Fedora requires a versioned SONAME for a library in %%{_libdir}. # Inject VERSION/SOVERSION after the add_library() call. Since upstream has no # version of its own, SOVERSION 0 starts the ABI counter here; bump it by hand # if a future snapshot breaks ABI. sed -i 's|^add_library(${lib_name} SHARED ${srcs}).*$|&\nset_target_properties(${lib_name} PROPERTIES VERSION 0.0.0 SOVERSION 0)|' \ CMakeLists.txt grep -q 'SOVERSION 0' CMakeLists.txt # The header install globs only the top level: # file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h") # which picks up vtkIECTransformLogicExport.h but NOT src/vtkIECTransformLogic.h # -- the actual class header, and the only one consumers include (SlicerRT does # so in 3 places). Upstream never noticed because its superbuild consumes this # from the build tree, where the source dir is on the include path anyway. # Add src/ to the glob. sed -i 's|^ file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/\*\.h")$| file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")|' CMakeLists.txt grep -q 'src/\*\.h' CMakeLists.txt # src/vtkIECTransformLogic.h:26 reaches its export header with a relative # #include "../vtkIECTransformLogicExport.h" # which is only correct in the source tree (src/ -> top level). The install # flattens both headers into the same directory, so "../" then points one level # above the include dir and no consumer can compile the header. Make it a plain # sibling include, which resolves in both layouts. sed -i 's|^#include "\.\./vtkIECTransformLogicExport\.h"$|#include "vtkIECTransformLogicExport.h"|' \ src/vtkIECTransformLogic.h ! grep -q '"\.\./vtkIECTransformLogicExport\.h"' src/vtkIECTransformLogic.h %build %cmake -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DBUILD_TESTING:BOOL=OFF \ `# CMakeLists.txt:95 defaults INSTALL_NO_DEVELOPMENT to ON, so the headers` \ `# are never installed -- upstream expects to be consumed from its build` \ `# tree by SlicerRT's superbuild. A -devel package needs them.` \ -DvtkIECTransformLogic_INSTALL_NO_DEVELOPMENT:BOOL=OFF \ `# Upstream defaults the library to lib/vtkIECTransformLogic (a private` \ `# subdir aimed at Slicer's bundled layout) and the headers to` \ `# include/vtkIECTransformLogic. Put the library in the normal libdir so` \ `# ldconfig finds it and no RPATH is needed.` \ -DvtkIECTransformLogic_INSTALL_LIB_DIR:STRING=%{_lib} \ -DvtkIECTransformLogic_INSTALL_BIN_DIR:STRING=bin \ -DvtkIECTransformLogic_INSTALL_INCLUDE_DIR:STRING=include/%{name} \ -DvtkIECTransformLogic_INSTALL_CMAKE_DIR:STRING=%{_lib}/cmake/%{name} \ -DvtkIECTransformLogic_WRAP_PYTHON:BOOL=OFF \ -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON %cmake_build %install %cmake_install %ldconfig_scriptlets %files %license LICENSE %doc README.md %{_libdir}/lib%{name}.so.* %files devel %{_includedir}/%{name}/ %{_libdir}/lib%{name}.so %{_libdir}/cmake/%{name}/ %changelog * Mon Aug 03 2026 Morgan Hough - 0-0.1.20260529gitb81c2de2 - Initial package, to unblock 3dslicer-rt (SlicerRT requires find_package(vtkIECTransformLogic) and its superbuild cannot run in mock/COPR) - Commit pinned locally: upstream tracks origin/main with no tags or releases