## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## 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 %global desc %{expand: The Virtual Brain Project (TVB Project) has the purpose of offering some modern tools to the Neurosciences community, for computing, simulating and analyzing functional and structural data of human brains. The gdist module is a Cython interface to a C++ library (http://code.google.com/p/geodesic/) for computing geodesic distance which is the length of shortest line between two vertices on a triangulated mesh in three dimensions, such that the line lies on the surface. The algorithm is due Mitchell, Mount and Papadimitriou, 1987; the implementation is due to Danil Kirsanov and the Cython interface to Gaurav Malhotra and Stuart Knock. Original library (published under MIT license): http://code.google.com/p/geodesic/ We added a python wrapped and made small fixes to the original library, to make it compatible with cython. } # Test the C++ library, independent of the Python wrapper? %ifnarch x86_64 %{ix86} # Test failure with GCC/Linux on non-x86 architectures at -O2 # https://github.com/the-virtual-brain/tvb-gdist/issues/76 %bcond_with cxx_tests %else %bcond_without cxx_tests %endif Name: python-tvb-gdist Version: 2.2 Release: %autorelease Summary: Cython interface to geodesic License: GPL-3.0-or-later URL: https://github.com/the-virtual-brain/tvb-gdist # GitHub archive has tests etc., which the PyPI sdist lacks. Source0: %{url}/archive/%{version}/tvb-gdist-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: gcc-c++ # Test dependencies (not well-documented): BuildRequires: python3dist(pytest) %if %{with cxx_tests} BuildRequires: pkgconfig(gtest) %endif %description %{desc} %package -n python3-tvb-gdist Summary: %{summary} # The contents of geodesic_library/ are a header-only C++ library that can be # used on its own. It was originally published at # https://code.google.com/archive/p/geodesic/, but is no longer developed # independently of this package. It was never explicitly versioned; the bundled # code appears to be based on the final release of 2008-03-02. If there were a # need to package it separately, it would probably be best to do so as a # subpackage of this package, perhaps assigning it the same version as the # Python Package. At least this bundled copy is actively maintained. Provides: bundled(geodesic) = 0 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_provides_for_importable_modules %py_provides python3-gdist %description -n python3-tvb-gdist %{desc} %prep %autosetup -n tvb-gdist-%{version} # we don't want to use "oldest-supported-numpy" # https://req.thevirtualbrain.org/browse/TVB-2890 sed -i 's/oldest-supported-numpy/numpy/' pyproject.toml %generate_buildrequires %pyproject_buildrequires %build %set_build_flags %pyproject_wheel %if %{with cxx_tests} "${CXX}" ${CXXFLAGS} -I./tests $(pkgconf --cflags gtest) \ tests/test_geodesic_utils.cpp -o tests/test_geodesic_utils \ ${LDFLAGS} $(pkgconf --libs gtest) %endif %install %pyproject_install %pyproject_save_files gdist %check %pytest -v %if %{with cxx_tests} # The program must be run from inside the tests/ directory. pushd tests >/dev/null ./test_geodesic_utils popd >/dev/null %endif %files -n python3-tvb-gdist -f %{pyproject_files} %doc README.rst %changelog * Mon Feb 27 2023 Ankur Sinha (Ankur Sinha Gmail) - 2.2-1 - feat: update to 2.2 (fixes rhbz#2172942) * Tue Feb 07 2023 Benjamin A. Beasley - 2.1.1-8 - Skip C++ library tests on non-x86 arches for now * Wed Feb 01 2023 Benjamin A. Beasley - 2.1.1-7 - Add %%%%py_provides for the importable module name * Wed Feb 01 2023 Benjamin A. Beasley - 2.1.1-6 - Switch to the GitHub source and run the tests * Wed Feb 01 2023 Benjamin A. Beasley - 2.1.1-5 - Document the bundled C++ header-only library * Wed Feb 01 2023 Benjamin A. Beasley - 2.1.1-4 - Package README.rst * Wed Feb 01 2023 Benjamin A. Beasley - 2.1.1-3 - Fix extra blank line in descriptions * Wed Feb 01 2023 Benjamin A. Beasley - 2.1.1-2 - Remove obsolete set-patches from %%%%prep * Wed Feb 01 2023 Ankur Sinha (Ankur Sinha Gmail) - 2.1.1-1 - feat: update to 2.1.1 (fixes rbhz#2166127) * Wed Feb 01 2023 Ankur Sinha (Ankur Sinha Gmail) - 2.1.0-11 - feat: use SPDX license * Wed Feb 01 2023 Ankur Sinha - 2.1.0-9 - Use pyproject macros * Fri Jan 20 2023 Fedora Release Engineering - 2.1.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Jul 22 2022 Fedora Release Engineering - 2.1.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jun 14 2022 Python Maint - 2.1.0-6 - Rebuilt for Python 3.11 * Fri Jan 21 2022 Fedora Release Engineering - 2.1.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Jul 23 2021 Fedora Release Engineering - 2.1.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 2.1.0-3 - Rebuilt for Python 3.10 * Wed Jan 27 2021 Fedora Release Engineering - 2.1.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sat Nov 28 2020 Ankur Sinha - 2.1.0-1 - Update to 2.1.0 * Fri Sep 04 2020 Ankur Sinha - 2.0.2-1 - Update to new release * Wed Jul 29 2020 Fedora Release Engineering - 2.0.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Tue May 26 2020 Miro Hrončok - 2.0.1-2 - Rebuilt for Python 3.9 * Sat May 02 2020 Ankur Sinha - 2.0.1-1 - Update to latest release * Sun Feb 02 2020 Ankur Sinha - 2.0.0-1 - Update to latest release * Thu Jan 30 2020 Fedora Release Engineering - 1.5.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Mon Aug 19 2019 Miro Hrončok - 1.5.8-2 - Rebuilt for Python 3.8 * Thu Aug 01 2019 Ankur Sinha - 1.5.8-1 - Update to 1.5.8 * Fri Jul 26 2019 Fedora Release Engineering - 1.5.6-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Feb 02 2019 Fedora Release Engineering - 1.5.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Sun Jan 06 2019 Ankur Sinha - 1.5.6-3 - Update license to GPLv3+ * Sun Jan 06 2019 Ankur Sinha - 1.5.6-2 - add setuptools BR - remove empty check section * Sat Dec 29 2018 Ankur Sinha - 1.5.6-1 - Initial build