Blame python-opentype-sanitizer.spec

1f2286a
Name:           python-opentype-sanitizer
1f2286a
# Upstream version is kept in sync with opentype-sanitizer
1f2286a
# (https://github.com/khaledhosny/ots), which is normally built and bundled as
1f2286a
# part of the Python wheel build. Similarly, we should update this package
1f2286a
# together with the opentype-sanitizer package in the distribution, ideally as
1f2286a
# a multi-build update (i.e., in a side tag).
1f2286a
#
1f2286a
# See https://github.com/googlefonts/ots-python/issues/3 for the process to
1f2286a
# update the source for a new opentype-sanitizer release; send upstream a PR if
1f2286a
# they are lagging.
d25a75f
Version:        9.0.0
7aa47c1
Release:        %autorelease
1f2286a
Summary:        Python wrapper for the OpenType Sanitizer
1f2286a
4fb7e9f
License:        BSD-3-Clause
09fea8b
URL:            https://github.com/googlefonts/ots-python
09fea8b
Source0:        %{url}/archive/v%{version}/ots-python-%{version}.tar.gz
1f2286a
1f2286a
BuildArch:      noarch
1f2286a
b96a515
Patch:          python-opentype-sanitizer-8.2.1-no-bundled-executable.patch
1f2286a
3d973d4
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
3d973d4
ExcludeArch:    %{ix86}
3d973d4
1f2286a
BuildRequires:  python3-devel
1f2286a
BuildRequires:  opentype-sanitizer = %{version}
1f2286a
1f2286a
Requires:       opentype-sanitizer = %{version}
1f2286a
1f2286a
%global common_description %{expand:
1f2286a
%{summary}.}
1f2286a
1f2286a
%description %{common_description}
1f2286a
1f2286a
1f2286a
%package -n     python3-opentype-sanitizer
1f2286a
Summary:        %{summary}
1f2286a
1f2286a
# The package was renamed due to PyPI parity requirements. Provide a compatible
1f2286a
# upgrade path. We must do this for three releases. Since the renaming occurred
1f2286a
# prior to the release of Fedora 36, we can remove this after Fedora 38 reaches
1f2286a
# end-of-life.
1f2286a
Obsoletes:      python3-ots < 8.2.1-9
1f2286a
Provides:       python3-ots = %{version}-%{release}
1f2286a
1f2286a
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_provides_for_importable_modules
1f2286a
%py_provides python3-ots
1f2286a
1f2286a
%description -n python3-opentype-sanitizer %{common_description}
1f2286a
1f2286a
1f2286a
%prep
09fea8b
%autosetup -n ots-python-%{version} -p1
1f2286a
1f2286a
1f2286a
%generate_buildrequires
1f2286a
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
1f2286a
%pyproject_buildrequires -x testing
1f2286a
1f2286a
1f2286a
%build
1f2286a
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
1f2286a
%pyproject_wheel
1f2286a
1f2286a
1f2286a
%install
1f2286a
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
1f2286a
export BINDIR=/usr/bin
1f2286a
%pyproject_install
1f2286a
# Fix the symlink, which was dereferenced during “wheelification”:
1f2286a
ln -svf '%{_bindir}/ots-sanitize' '%{buildroot}%{python3_sitelib}/ots/'
1f2286a
%pyproject_save_files ots
1f2286a
1f2286a
1f2286a
%check
1f2286a
%pytest
1f2286a
1f2286a
1f2286a
%files -n python3-opentype-sanitizer -f %{pyproject_files}
1f2286a
%doc README.md
1f2286a
1f2286a
1f2286a
%changelog
1f2286a
%autochangelog