python-pymapvbvd/python-pymapvbvd.spec
Benjamin A. Beasley 30d1e29638 Initial import
2023-07-24 09:44:36 -04:00

107 lines
3.1 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# In the releases mentioned in the expression, the system versioneer is too old
# for the generated _version.py to have the get_version() function, and too old
# for the License tag to be accurate. We must use the bundled, amalgamated
# versioneer.py to generate _version.py.
#
# Otherwise, we can use the system versioneer to generate _version.py, and can
# remove the bundled, amaglamated versioneer.py to indicate we arent using it.
%bcond bundled_versioneer %{expr:0%{?fc37} || 0%{?fc38} || 0%{?el9}}
Name: python-pymapvbvd
Version: 0.5.3
Release: %autorelease
Summary: Python twix file reader
# The entire source is MIT, except:
# - The script versioneer.py and the file pymapvbvd/_version.py, which was
# generated by it, are both Unlicense.
License: MIT AND Unlicense
URL: https://github.com/wtclarke/pymapvbvd
Source0: %{pypi_source pyMapVBVD}
# Generated with Source2: ./get_test_data.sh %%{version}
Source1: pyMapVBVD-%{version}-test-data.tar.xz
Source2: get_test_data.sh
# Do not install tests in site-packages
# https://github.com/wtclarke/pymapvbvd/pull/34
Patch: %{url}/pull/34.patch
BuildArch: noarch
# The library assumes that the host and the file format are both little-endian.
# The necessary patch would not be trivial. Queried upstream:
#
# Big-endian host support?
# https://github.com/wtclarke/pymapvbvd/issues/35
#
# A bug will be filed blocking F-ExcludeArch-s390x, per
# https://docs.fedoraproject.org/en-US/packaging-guidelines/#_architecture_build_failures,
# once the package is imported.
ExcludeArch: s390x
BuildRequires: python3-devel
%global common_description %{expand:
Python port of the Matlab mapVBVD tool for reading Siemens raw data 'twix'
(.dat) files.}
%description %{common_description}
%package -n python3-pymapvbvd
Summary: %{summary}
# Provides for the actual importable module name, which is unfortunately
# different from the PyPI package name (pyMapVBVD).
%py_provides python3-mapvbvd
# The generated _version.py has the same license as python3dist(versioneer),
# but we do not consider it to be bundled from Versioneer.
%if %{with bundled_versioneer}
# While versioneer.py is a bundled copy of python3dist(versioneer) = 0.28, it
# is not included in the binary RPMs, so we still do not treat it as bundled,
# and there is no corresponding virtual Provides.
%endif
%description -n python3-pymapvbvd %{common_description}
%prep
%autosetup -n pyMapVBVD-%{version} -p1
%setup -q -T -D -b 1 -n pyMapVBVD-%{version}
%if %{without bundled_versioneer}
rm -v versioneer.py
%endif
%generate_buildrequires
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
%if %{with bundled_versioneer}
export PYTHONPATH="${PWD}"
%endif
%pyproject_buildrequires -x tests
%build
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
%if %{with bundled_versioneer}
export PYTHONPATH="${PWD}"
%endif
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files mapvbvd
%check
%pytest -v
%files -n python3-pymapvbvd -f %{pyproject_files}
# pyproject_files handles LICENSE; verify with “rpm -qL -p …”
%doc README.md
%changelog
%autochangelog