%global commit 16ea1366df8dac6cafe744b134dffc1635e5146d %global shortcommit %(c=%{commit}; echo ${c:0:7}) %define debug_package %{nil} Name: c3d Version: 1.4.6 Release: 4%{?dist} Summary: Medical image format conversion and processing tool License: GPL-3.0-or-later URL: https://github.com/pyushkevich/c3d Source0: https://github.com/pyushkevich/c3d/archive/%{commit}/%{name}-%{commit}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: InsightToolkit5-devel >= 5.4 # Pin the ITK this was BUILT against. ITK freezes its sonames across releases # while ADDING symbols: libITKFFT-5.4.so.1 is identical in name in 5.4.7-2 and # 5.4.7-8, but -8 enabled FFTW and exports # _ZN3itk46FFTWFFTImageFilterInitFactoryRegister__PrivateEv. rpm derives # dependencies from sonames, so it cannot tell them apart -- c3d installs cleanly # over the older ITK and then exits 127 on EVERY invocation. Measured on a real # host by the framework session, then confirmed per object here: 3 of c3d's 4 # shipped ELF objects need that symbol (c3d, c2d, c4d). # # A floor, not an equality: the breakage is additive, so a newer ITK is fine. # # The two-part %%{?itk_ver}%%{!?itk_ver:UNSET} expansion is required, not # stylistic. ">= UNSET" is SATISFIED -- rpm ranks a numeric segment above an # alphabetic one -- so an undefined macro makes this floor vacuous, which is what # the %%build guard catches. It must also be this shape rather than a parse-time # %%global check: a parse-time guard once killed every SCM build before a chroot # existed (python-simpleitk 10980296, "can't parse specfile", 0 minutes). Requires: InsightToolkit5%{?_isa} >= %{?itk_ver}%{!?itk_ver:UNSET} BuildRequires: hdf5-devel BuildRequires: eigen3-devel # VTK transitive deps (ITK5 cmake config loads ITKVtkGlue → find_package(VTK)) # vtk-devel should Require these but does not yet BuildRequires: python3-devel BuildRequires: qt6-qtdeclarative-devel %if 0%{?fedora} BuildRequires: libminc-devel %endif %description Convert3D (c3d) is a command-line tool for converting between medical image formats and performing various image processing operations. It supports NIfTI, DICOM, MetaImage, Analyze, and other common formats. The suite includes c3d (3D), c2d (2D), c4d (4D), and c3d_affine_tool for working with affine transformations. %prep %setup -q -n c3d-%{commit} %build test -n "%{?itk_ver}" || { echo "ERROR: itk_ver undefined - add 'BuildRequires: InsightToolkit5-devel'" >&2; exit 1; } export CXXFLAGS="%{optflags} -std=c++17 -include cstdint -fpermissive" %cmake \ -DCMAKE_CXX_STANDARD:STRING=17 \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DBUILD_GUI:BOOL=OFF \ -DBUILD_TESTING:BOOL=OFF \ -DCONVERT3D_USE_ITK_REMOTE_MODULES:BOOL=OFF \ -DITK_DIR:PATH=%{_prefix}/lib/cmake/ITK-5.4 \ -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON %cmake_build %install %cmake_install # Remove cmake export files generated in build dir (triggers check-files error) find %{_builddir} -name "Convert3DTargets*.cmake" -delete # Remove development files — no -devel subpackage rm -rf %{buildroot}%{_includedir} rm -rf %{buildroot}%{_libdir}/cmake rm -rf %{buildroot}/usr/lib/cmake rm -f %{buildroot}%{_libdir}/*.a rm -f %{buildroot}/usr/lib/*.a rm -f %{buildroot}%{_libdir}/*.so rm -f %{buildroot}/usr/lib/*.so %files %license COPYING.txt %doc README.md %{_bindir}/c2d %{_bindir}/c3d %{_bindir}/c4d %{_bindir}/c3d_affine_tool %changelog * Fri Sep 25 2026 Morgan Hough - 1.4.2-4 - Pin the ITK built against, with a %%build guard. c3d had NO runtime ITK dependency beyond sonames and a vacuous "InsightToolkit5-devel >= 5.4" -- a devel floor on a runtime package, pinned six releases stale. - Without this, c3d installs over ITK 5.4.7-2 and exits 127 on every invocation: 3 of its 4 shipped ELF objects (c3d, c2d, c4d) need the FFTW registration symbol that only 5.4.7-8 and later export, and the SONAME does not change, so rpm cannot see it. Found by the framework session on a real host. - Ownership: legion, assigned by Morgan 2026-09-25. Previously unowned. * Sat Sep 19 2026 Morgan Hough - 1.4.6-3 - Rebuild against InsightToolkit5 5.4.7-8, which unbundles Eigen3, VXL and double-conversion. No source or spec change; the Release bump is what makes the rebuild reach anyone. COPR adds a sibling at an already-published NVR rather than replacing it, and dnf then serves the older copy -- so a rebuild at the same NVR would leave this package linked against the bundled ITK while appearing to succeed. - Validated against -8 in mhough/neurofedora-itk5-test before this bump. * Wed Apr 23 2026 Morgan Hough - 1.4.6-2 - Update to 1.4.6 - Add eigen3-devel BuildRequires (ITK5 cmake config requires Eigen3) * Wed Mar 18 2026 Morgan Hough - 1.4.2-4 - Remove cmake export target files from build dir (unpackaged files error) - Add VTK transitive BuildRequires (python3-devel, qt6-qtdeclarative-devel) * Wed Mar 18 2026 Morgan Hough - 1.4.2-1 - Initial package of Convert3D 1.4.2 (git snapshot %{shortcommit}) - Built against system InsightToolkit5 with static internal libraries