Name: opentopas Version: 4.2.3 Release: 2%{?dist} Summary: Monte Carlo tool for particle simulation License: MIT URL: https://github.com/OpenTOPAS/OpenTOPAS Source0: https://github.com/OpenTOPAS/OpenTOPAS/archive/refs/tags/v%{version}.tar.gz#/OpenTOPAS-%{version}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: make BuildRequires: geant4-devel >= 11.3.2 BuildRequires: qt6-qtbase-devel BuildRequires: qt6-qt3d-devel BuildRequires: gdcm-devel BuildRequires: expat-devel BuildRequires: xerces-c-devel BuildRequires: zlib-devel BuildRequires: libX11-devel BuildRequires: libXmu-devel BuildRequires: libXpm-devel BuildRequires: libXft-devel BuildRequires: mesa-libGL-devel BuildRequires: mesa-libGLU-devel # Floor must track the geant4 this was BUILT against, not the oldest that once # worked. Geant4's libraries carry UNVERSIONED sonames (libG4run.so, not # libG4run.so.N), so RPM's auto-generated deps are bare `libG4run.so()(64bit)` # which every geant4 satisfies -- there is no ABI tracking whatsoever. With the # old `>= 11.3.2` floor the shipped 4.2.3-1 (built Jun 14 against 11.3.x) # installed happily against 11.4.2 and then /usr/bin/topas -- the only binary in # the package -- died on # undefined symbol: _ZN22G4ParallelWorldProcess16SetParallelWorldE8G4String # because SetParallelWorld's signature changed in 11.4. An explicit floor at the # build-time version is the only guard available; bump it with every geant4 bump. Requires: geant4 >= 11.4.2 Requires: gdcm Requires: qt6-qtbase %description OpenTOPAS is a Monte Carlo tool for particle simulation, designed for medical physics applications. It wraps the Geant4 Simulation Toolkit to provide an easier-to-use interface for complex simulations. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: geant4-devel Requires: gdcm-devel %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup -q -n OpenTOPAS-%{version} %build %cmake \ -DGeant4_DIR=%{_libdir}/Geant4-11.4.0/ \ -DTOPAS_USE_SYSTEM_GDCM=ON \ -DTOPAS_USE_QT6=ON \ -DBUILD_SHARED_LIBS=OFF \ -DTOPAS_INSTALL_EXAMPLES=OFF \ %cmake_build %install %cmake_install # --- Fix Library Locations and Cleanup --- # OpenTOPAS installs libraries to /usr/lib by default, ignoring -DLIB_INSTALL_DIR on some paths. # We must move static libs to %{_libdir} (e.g. /usr/lib64) and remove bundled shared libs. # 1. Move static libraries (.a) to the correct libdir if they ended up in /usr/lib if [ "%{_prefix}/lib" != "%{_libdir}" ] && [ -d %{buildroot}%{_prefix}/lib ]; then mkdir -p %{buildroot}%{_libdir} mv %{buildroot}%{_prefix}/lib/*.a %{buildroot}%{_libdir}/ 2>/dev/null || : fi # 3. Cleanup artifacts # Remove internal CMakeLists.txt that gets installed rm -f %{buildroot}%{_prefix}/CMakeLists.txt # Remove system hmac files that might have been copied/bundled rm -f %{buildroot}%{_libdir}/.lib*.hmac rm -f %{buildroot}%{_prefix}/lib/.lib*.hmac # 4. Cleanup Bundled System Libraries (.so) in %{_prefix}/lib as well rm -f %{buildroot}%{_prefix}/lib/*.so* # 5. Cleanup Bundled System Static Libraries (.a) # OpenTOPAS accidentally bundles glibc/system static libs. We must verify and remove them. # We whitelist known OpenTOPAS libs or blacklist system ones. Blacklist is safer for now. # System libs to remove: libanl.a, libc_nonshared.a, libdl.a, libg.a, libmcheck.a, libpthread.a, librt.a, libutil.a, libsysprof-capture-4.a for lib in libanl.a libc_nonshared.a libdl.a libg.a libmcheck.a libpthread.a librt.a libutil.a libsysprof-capture-4.a; do rm -f %{buildroot}%{_libdir}/$lib done # --- Fix FHS Compliance --- # OpenTOPAS installs files directly to %{_prefix} (e.g., /usr/LICENSE.txt), which is invalid. # 1. License (handled by %license macro) rm -f %{buildroot}%{_prefix}/LICENSE.txt # 2. Move SDK/Data files to %{_datadir}/opentopas mkdir -p %{buildroot}%{_datadir}/opentopas mv %{buildroot}%{_prefix}/topas.cc %{buildroot}%{_datadir}/opentopas/ mv %{buildroot}%{_prefix}/CMakeHandleExtensions.cmake %{buildroot}%{_datadir}/opentopas/ mv %{buildroot}%{_prefix}/rundemos.csh %{buildroot}%{_datadir}/opentopas/ mv %{buildroot}%{_prefix}/extensions %{buildroot}%{_datadir}/opentopas/ # Fix permissions chmod +x %{buildroot}%{_datadir}/opentopas/rundemos.csh # 3. Move Headers to namespace directory mkdir -p %{buildroot}%{_includedir}/opentopas mv %{buildroot}%{_includedir}/*.hh %{buildroot}%{_includedir}/opentopas/ mv %{buildroot}%{_includedir}/*.icc %{buildroot}%{_includedir}/opentopas/ mv %{buildroot}%{_includedir}/TsTopasConfig.hh %{buildroot}%{_includedir}/opentopas/ 2>/dev/null || : # 4. Remove unwanted artifacts # Remove cmake install manifest if present? often fine. # We disabled examples via cmake flag, verify they are gone. rm -rf %{buildroot}%{_prefix}/examples %files %license LICENSE.txt %doc README.md %{_bindir}/topas %{_datadir}/opentopas/ %files devel %{_includedir}/opentopas/ %{_libdir}/*.a %changelog * Sat Aug 01 2026 Morgan Hough - 4.2.3-2 - Rebuild against geant4 11.4.2 and raise the floor to match. The shipped 4.2.3-1 was built 2026-06-14 against geant4 11.3.x. geant4 moved to 11.4.2 on 2026-07-19 and G4ParallelWorldProcess::SetParallelWorld changed signature, so /usr/bin/topas -- the package's only binary -- now fails with undefined symbol: _ZN22G4ParallelWorldProcess16SetParallelWorldE8G4String It still INSTALLS, because Geant4's libraries have unversioned sonames (libG4run.so, not libG4run.so.N) and RPM's auto-generated deps are therefore bare libG4run.so()(64bit) that any geant4 satisfies. There is no ABI tracking to rely on, so the Requires floor has to be maintained by hand and must track the geant4 actually built against. Verified by mock on intel-skullcandy: rebuilt against 11.4.2 in 9m56s and ldd -r on the resulting topas reports 0 undefined symbols (was 1). * Wed Apr 23 2026 Morgan Hough - 4.2.3-1 - Update to 4.2.3 * Mon Feb 02 2026 Antigravity - 4.2.2-1 - Initial package for OpenTOPAS 4.2.2