# Required-by Slicer: extension manager / app update REST client. # Upstream has no tagged releases — pin to the commit Slicer pins so the # ABI matches what Slicer expects, plus a snapshot-date for clarity. # # (Slicer's External_qRestAPI.cmake explicitly says # "Enabling Slicer_USE_SYSTEM_qRestAPI is not supported !" — meaning it # doesn't expose a system-path build option for itself. We override that # in our Slicer spec by injecting -DSlicer_USE_SYSTEM_qRestAPI=ON; the # underlying CMake module just does find_package(qRestAPI) so the # system-package path works regardless of upstream's warning text.) %global commit 88c02c5d90169dfe065fa068969e59ada314d3cb %global shortcommit %(c=%{commit}; echo ${c:0:8}) %global snapdate 20251018 Name: qRestAPI Version: 0 Release: 0.3.%{snapdate}git%{shortcommit}%{?dist} Summary: Qt-based REST API client library License: Apache-2.0 URL: https://github.com/commontk/qRestAPI Source0: %{url}/archive/%{commit}/qRestAPI-%{shortcommit}.tar.gz BuildRequires: cmake >= 3.5 BuildRequires: ninja-build BuildRequires: gcc-c++ BuildRequires: cmake(Qt6Core) BuildRequires: cmake(Qt6Gui) BuildRequires: cmake(Qt6Network) BuildRequires: cmake(Qt6Qml) BuildRequires: cmake(Qt6Test) Requires: qt6-qtbase Requires: qt6-qtdeclarative %description qRestAPI is a small Qt-based library for invoking REST APIs. It is used by 3D Slicer's extension manager and application-update facility, and by several CommonTK consumers (CTK). %package devel Summary: Development files for qRestAPI Requires: %{name}%{?_isa} = %{version}-%{release} Requires: cmake(Qt6Core) Requires: cmake(Qt6Network) %description devel Headers, the qRestAPIConfig.cmake config file, and the shared library symlink needed to link against qRestAPI from other Qt6 applications. %prep %autosetup -n qRestAPI-%{commit} -p1 # qRestAPI has no SONAME versioning (links with -soname,libqRestAPI.so plain), # so it functionally behaves like an unversioned shared library. The %files # section ships only libqRestAPI.so (no .so.N variant). Consumers should # treat the API as pinned via build-time finding (find_package). %build %cmake -G Ninja \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DBUILD_TESTING:BOOL=OFF \ -DqRestAPI_QT_VERSION:STRING=6 \ -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON %cmake_build %install # Upstream's CMakeLists has zero install() rules — the library and headers # are just produced in the build tree. Hand-install everything. install -d %{buildroot}%{_libdir} install -d %{buildroot}%{_includedir}/qRestAPI install -d %{buildroot}%{_libdir}/cmake/qRestAPI # Shared lib (no SONAME — upstream links with -soname,libqRestAPI.so plain). install -m 0755 %{__cmake_builddir}/libqRestAPI.so %{buildroot}%{_libdir}/libqRestAPI.so # Headers from the source tree plus the generated export header for h in qRestAPI.h qRestAPI_p.h qRestResult.h qGirderAPI.h qMidasAPI.h; do [ -f "$h" ] && install -m 0644 "$h" %{buildroot}%{_includedir}/qRestAPI/ done install -m 0644 %{__cmake_builddir}/qRestAPI_Export.h %{buildroot}%{_includedir}/qRestAPI/ # Generated cmake config (file name is GenerateqRestAPIConfig.cmake-produced # qRestAPIConfig.cmake — globs are forgiving here). for f in %{__cmake_builddir}/qRestAPIConfig*.cmake %{__cmake_builddir}/UseqRestAPI.cmake %{__cmake_builddir}/qRestAPIExports*.cmake; do [ -f "$f" ] && install -m 0644 "$f" %{buildroot}%{_libdir}/cmake/qRestAPI/ done # Upstream's CMakeLists only generates BUILD-tree configs (paths point at # /builddir/.../redhat-linux-build/). Rewrite those paths to install-tree # locations so 3D Slicer's find_package(qRestAPI) gets working values. sed -i \ -e 's|"%{__cmake_builddir}/qRestAPIExports.cmake"|"%{_libdir}/cmake/qRestAPI/qRestAPIExports.cmake"|g' \ -e 's|"%{__cmake_builddir}/UseqRestAPI.cmake"|"%{_libdir}/cmake/qRestAPI/UseqRestAPI.cmake"|g' \ -e 's|set(qRestAPI_LIBRARY_DIRS "%{__cmake_builddir}")|set(qRestAPI_LIBRARY_DIRS "%{_libdir}")|g' \ -e 's|set(qRestAPI_INCLUDE_DIRS "")|set(qRestAPI_INCLUDE_DIRS "%{_includedir}/qRestAPI")|g' \ %{buildroot}%{_libdir}/cmake/qRestAPI/qRestAPIConfig.cmake %files %license LICENSE %doc README.md %{_libdir}/libqRestAPI.so %files devel %{_includedir}/qRestAPI/ %dir %{_libdir}/cmake/qRestAPI %{_libdir}/cmake/qRestAPI/*.cmake %changelog * Fri May 29 2026 Morgan Hough - 0-0.3.20251018git88c02c5d - Rewrite hardcoded /builddir/.../redhat-linux-build/ paths in the shipped qRestAPIConfig.cmake to install-tree locations. Upstream's GenerateqRestAPIConfig.cmake only emits the build-tree variant, so the install carried the build path into the binary RPM. Also install qRestAPIExports.cmake which the Config references. * Wed May 27 2026 Morgan Hough - 0-0.2.20251018git88c02c5d - Hand-install lib + headers + cmake config: upstream's CMakeLists has zero install() rules. Library has no SONAME versioning (built with -soname,libqRestAPI.so plain), so %files ships only libqRestAPI.so without .so.N variants. - License file is LICENSE (not LICENSE_Apache_20.txt). * Wed May 27 2026 Morgan Hough - 0-0.1.20251018git88c02c5d - Initial COPR package. Pinned to the commit 3D Slicer 5.10 expects. - Built against Qt6 (qRestAPI_QT_VERSION=6). - BUILD_TESTING off — upstream tests hit live REST endpoints.