## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond tests 1 # Where possible, re-generate test data files? %bcond regenerate_test_data 1 Name: libsonata Version: 0.1.29 # The SONAME version is constructed from the version number (MAJOR.MINOR), but # we repeat it here to avoid undected SONAME version bumps. %global so_version 0.1 Release: %autorelease Summary: A Python and C++ interface to the SONATA format # The entire package is LGPL-3.0-only, except: # # BSL-1.0: # - include/bbp/sonata/optional.hpp, removed in %%prep and replaced with a # dependency on optional-lite; but this is a header-only library, which we # must treat the same as a static library, so its license still contributes # to the licenses of the binary RPMs # - include/bbp/sonata/variant.hpp, removed in %%prep and replaced with a # dependency on variant-lite; a header-only library like optional-lite # MIT AND CC0-1.0 # - extlib/nlohmann/nlohmann/json.hpp, removed in %%prep and replaced with a # dependency on json, another header-only library; the CC0-1.0 portion is a # bundled copy of hedley, another header-only library. While CC0-1.0 is # not-allowed for code in Fedora, hedley falls under the following blanket # exception: “Existing uses of CC0-1.0 on code files in Fedora packages prior # to 2022-08-01, and subsequent upstream versions of those files in those # packages, continue to be allowed. We encourage Fedora package maintainers # to ask upstreams to relicense such files.” # BSD-3-Clause: # - CMake/CodeCoverage.cmake, a build-system file that does not contribute to # the licenses of the binary RPMs License: LGPL-3.0-only AND BSL-1.0 AND MIT AND CC0-1.0 # Additionally, the following are present in the source archive, but do not # contribute to the licenses of the binary RPMs. # # MIT: # - extlib/filesystem.hpp, corresponding to gulrak-filesystem: removed in # %%prep, and made unnecessary by a patch to use std::filesystem instead SourceLicense: %{license} AND BSD-3-Clause URL: https://github.com/openbraininstitute/libsonata Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # Downstream-only: TODO: can/should this be upstreamed? Patch: 0001-Remove-pybind-redeclarations.patch # Use std::filesystem # https://github.com/BlueBrain/libsonata/pull/372 # # This also bumps the minimum C++ standard to C++17 and supports (and requires) # Catch2 >= 3.x rather than 2.x. # # Rebased on v0.1.23. Patch: 0002-Use-std-filesystem.patch Patch: 0003-Substitute-ghc-in-tests.patch # Additional necessary adjustments suggested in # https://github.com/BlueBrain/libsonata/pull/372#issuecomment-2631574780 Patch: 0004-Include-catch-catch_all.hpp-instead-of-catch-catch.h.patch Patch: 0005-Link-Catch2-Catch2WithMain-instead-of-Catch2-Catch2.patch # Use GNUInstallDirs # https://github.com/openbraininstitute/libsonata/pull/1 Patch: %{url}/pull/1.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} # Used in %%prep: BuildRequires: git-core BuildRequires: tomcli BuildRequires: cmake # Faster than make, with no disadvantages: BuildRequires: ninja-build BuildRequires: gcc-c++ BuildRequires: python3-devel BuildRequires: cmake(Catch2) BuildRequires: cmake(fmt) BuildRequires: cmake(HighFive) BuildRequires: hdf5-devel BuildRequires: cmake(pybind11) # Header-only libraries unbundled in %%prep; -static prescribed by guidelines # for tracking of header-only libraries. BuildRequires: (cmake(nlohmann_json) with json-static) BuildRequires: optional-lite-static BuildRequires: variant-lite-static # Test dependencies %if %{with regenerate_test_data} BuildRequires: %{py3_dist h5py} %endif # Tests don’t explicitly require pytest, but it’s a convenient runner. BuildRequires: %{py3_dist pytest} %global _description %{expand: C++ / Python reader for SONATA circuit files. SONATA guide: https://github.com/AllenInstitute/sonata/blob/master/docs/SONATA_DEVELOPER_GUIDE.md } %description %_description %package devel Summary: Development files for %{name} # Since optional-lite and variant-lite are unbundled, they do not appear in the # devel package and do not contribute to its license, even though they are part # of the public API; other header-only dependencies are only used to build # libraries and would not appear in the API (and therefore in the -devel # package) even if they *were* bundled. License: LGPL-3.0-only Requires: %{name}%{?_isa} = %{version}-%{release} # These header-only dependencies are part of the public API. Very formally, # dependent packages should probably depend on the -static packages for these, # although this is getting a bit out of hand. Requires: optional-lite-devel optional-lite-static Requires: variant-lite-devel variant-lite-static %description devel %_description %package -n python3-libsonata Summary: %{summary} %description -n python3-libsonata %_description %prep %autosetup -n libsonata-%{version} -S git rm -rf libsonata.egg-info rm -rf extlib/{Catch2,Highfive,fmt,nlohmann} # Unbundle gulrak-filesystem echo '#include ' > extlib/filesystem.hpp # Unbundle optional-lite echo '#include ' > include/bbp/sonata/optional.hpp # Unbundle variant-lite echo '#include ' > include/bbp/sonata/variant.hpp # Avoid bundling in the Python extension. We must use a patch since we cannot # pass CMake options directly to the build system for the Python extension. sed -r -i 's/(-DEXTLIB_FROM_SUBMODULES=)ON/\1OFF/' setup.py # Comment out to remove /usr/bin/env shebangs # Can use something similar to correct/remove /usr/bin/python shebangs also # find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';' # Upstream builds against an old numpy for binary compatibility on PyPI, but we # just build with the system numpy. tomcli set pyproject.toml lists replace build-system.requires \ oldest-supported-numpy numpy %if %{with regenerate_test_data} # These are the files that generate.py actually writes: pushd tests/data rm nodes1.h5 edges1.h5 spikes.h5 somas.h5 elements.h5 popd %endif %generate_buildrequires %pyproject_buildrequires %build # Equivalent to passing -GNinja, but this way we can also affect CMake while it # is building the Python extension. export CMAKE_GENERATOR='Ninja' %cmake \ -DEXTLIB_FROM_SUBMODULES:BOOL=OFF \ -DSONATA_CXX_WARNINGS:BOOL=OFF \ -DSONATA_PYTHON:BOOL=OFF \ -DSONATA_TESTS:BOOL=ON \ -DSONATA_VERSION="%{version}" %cmake_build export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} # This environment variable affects (only) the Python bindings. export SONATA_BUILD_TYPE='RelWithDebInfo' # CMake environment variables export VERBOSE='' %pyproject_wheel %install %cmake_install # remove static lib rm -rf %{buildroot}/%{_libdir}/libsonata.a %pyproject_install %pyproject_save_files -l libsonata %check %if %{with regenerate_test_data} pushd tests/data %{py3_test_envvars} %{python3} generate.py popd %endif %ctest tests # We need the contents of python/tests to be at a parallel path (same depth # from the top-level directory), but we need to ensure that the tests cannot # find an “un-built” copy of libsonata in the parent directory. mkdir _empty cp -rp python/tests _empty/ %pytest -v _empty/tests %files %license COPYING.LESSER %doc README.rst CHANGELOG.md %{_libdir}/libsonata.so.%{so_version} %{_libdir}/libsonata.so.%{version} %files devel # Potentially co-owned with other Blue Brain Project packages: %dir %{_includedir}/bbp/ # Exclusively owned by this package: %{_includedir}/bbp/sonata/ %{_datadir}/sonata/ %{_libdir}/libsonata.so %files -n python3-libsonata -f %{pyproject_files} %doc README.rst CHANGELOG.md %changelog ## START: Generated by rpmautospec * Tue Feb 04 2025 Benjamin A. Beasley - 0.1.29-1 - Update to 0.1.29 (close RHBZ#2242881) * Tue Feb 04 2025 Benjamin A. Beasley - 0.1.28-1 - Update to 0.1.28 * Tue Feb 04 2025 Benjamin A. Beasley - 0.1.27-1 - Update to 0.1.27 * Tue Feb 04 2025 Benjamin A. Beasley - 0.1.26-1 - Update to 0.1.26 * Tue Feb 04 2025 Benjamin A. Beasley - 0.1.25-1 - Update to 0.1.25 * Tue Feb 04 2025 Benjamin A. Beasley - 0.1.24-1 - Update to 0.1.24 * Tue Feb 04 2025 Benjamin A. Beasley - 0.1.23-35 - Use ninja as the cmake backend; faster than make * Tue Feb 04 2025 Benjamin A. Beasley - 0.1.23-34 - Drop indirect BuildRequires on boost-devel - No longer needed since highfive-devel now correctly depends on boost- devel * Mon Feb 03 2025 Benjamin A. Beasley - 0.1.23-33 - Drop unused BuildRequires on gulrak-filesystem * Mon Feb 03 2025 Benjamin A. Beasley - 0.1.23-32 - Add CC0-1.0 to License for hedley, bundled in json * Mon Feb 03 2025 Benjamin A. Beasley - 0.1.23-31 - Express dependencies as cmake(…) where applicable * Mon Feb 03 2025 Benjamin A. Beasley - 0.1.23-27 - Improved patch for std::filesystem - Uses a patch that was actually offered upstream - Fixes compatibility with current Catch2 - Bumps the minimum C++ standard to C++17, making a few patches obsolete * Mon Feb 03 2025 Benjamin A. Beasley - 0.1.23-26 - Drop “include catch cmake” patch – no longer needed * Mon Feb 03 2025 Benjamin A. Beasley - 0.1.23-25 - Update URL and migrate the latest patch/PR * Sun Feb 02 2025 Benjamin A. Beasley - 0.1.23-24 - Upstream a version of the libdirs patch * Sun Feb 02 2025 Benjamin A. Beasley - 0.1.23-22 - Reorder patches; put upstream patches last * Sun Feb 02 2025 Benjamin A. Beasley - 0.1.23-21 - Make re-generating test data nicer, and conditionalize it * Sun Feb 02 2025 Benjamin A. Beasley - 0.1.23-20 - Build the Python extension as part of the wheel * Sun Feb 02 2025 Benjamin A. Beasley - 0.1.23-19 - Add a SourceLicense field * Sun Feb 02 2025 Benjamin A. Beasley - 0.1.23-18 - Unbundle gulrak-filesystem, optional-lite, and variant-lite * Sun Feb 02 2025 Benjamin A. Beasley - 0.1.23-16 - Generate BuildRequires for the Python extension * Sun Feb 02 2025 Benjamin A. Beasley - 0.1.23-15 - Handle SONAME version a little more explicitly * Mon Jan 20 2025 Fedora Release Engineering - 0.1.23-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Fri Jan 17 2025 Fedora Release Engineering - 0.1.23-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Fri Oct 25 2024 Orion Poplawski - 0.1.23-11 - Rebuild for hdf5 1.14.5 * Thu Jul 18 2024 Fedora Release Engineering - 0.1.23-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sun Jul 14 2024 Kefu Chai - 0.1.23-8 - Rebuilt for fmt 11 * Sat Jun 08 2024 Python Maint - 0.1.23-7 - Rebuilt for Python 3.13 * Thu Jan 25 2024 Fedora Release Engineering - 0.1.23-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 0.1.23-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Jan 02 2024 Benjamin A. Beasley - 0.1.23-4 - Assert that the .dist-info directory contains a license file * Tue Sep 19 2023 Sandro - 0.1.23-2 - Stop building for i686 * Tue Aug 29 2023 Ankur Sinha (Ankur Sinha Gmail) - 0.1.23-1 - feat: update to 0.1.23 (fixes rhbz#2183959) - re does patches - uses spdx license * Thu Jul 20 2023 Fedora Release Engineering - 0.1.11-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Jul 12 2023 Python Maint - 0.1.11-13 - Rebuilt for Python 3.12 * Wed Jun 28 2023 Vitaly Zaitsev - 0.1.11-12 - Rebuilt due to fmt 10 update. * Tue Mar 07 2023 Benjamin A. Beasley - 0.1.11-11 - Work around numpy.int removal (close RHBZ#2176146) * Tue Mar 07 2023 Benjamin A. Beasley - 0.1.11-10 - Ensure the catch2 compat package is used when necessary * Thu Jan 19 2023 Fedora Release Engineering - 0.1.11-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Thu Jul 21 2022 Fedora Release Engineering - 0.1.11-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jun 14 2022 Python Maint - 0.1.11-7 - Rebuilt for Python 3.11 * Fri Mar 18 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.1.11-6 - fix: initial build (fixes rhbz#2061077) - requires highfive version that fixes bug to allow correct building on s390x, aarch64, ppc64le * Thu Mar 17 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.1.11-5 - feat: initial import to repositories * Thu Mar 17 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.1.11-4 - update as per review comments * Thu Mar 17 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.1.11-3 - feat: corrections based on review - fix assertion error - fix python package installation - enable all tests * Thu Mar 17 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.1.11-2 - Add fork URL in comment * Thu Mar 17 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.1.11-1 - feat: ready for review * Thu Mar 17 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.1.8-2 - WIP * Thu Mar 17 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.1.8-1 - init ## END: Generated by rpmautospec