700c000
%global srcname cffsubr
700c000
700c000
Name:           python-%{srcname}
700c000
Version:        0.2.8
700c000
Release:        2%{?dist}
700c000
Summary:        Standalone CFF subroutinizer based on the AFDKO tx tool
700c000
700c000
License:        ASL 2.0
700c000
URL:            https://pypi.org/project/%{srcname}
700c000
Source0:        %{pypi_source}
700c000
700c000
BuildArch:      noarch
700c000
700c000
BuildRequires:  python3-devel
700c000
BuildRequires:  pyproject-rpm-macros
700c000
BuildRequires:  python3dist(setuptools)
700c000
# From setup_requires in setup.py:
700c000
BuildRequires:  python3dist(setuptools-scm)
700c000
700c000
%global txbin /usr/bin/tx
700c000
700c000
BuildRequires:  %{txbin}
700c000
BuildRequires:  symlinks
700c000
700c000
%description
700c000
Standalone CFF subroutinizer based on the AFDKO tx tool.
700c000
700c000
%generate_buildrequires
700c000
%pyproject_buildrequires -x testing
700c000
700c000
%package -n python3-%{srcname}
700c000
Summary:        %{summary}
700c000
700c000
Requires:       %{txbin}
700c000
700c000
%description -n python3-%{srcname}
700c000
Standalone CFF subroutinizer based on the AFDKO tx tool.
700c000
700c000
%prep
700c000
%autosetup -n %{srcname}-%{version}
700c000
700c000
# Patch out setuptools-git-ls-files dependency
700c000
sed -r -i '/setuptools-git-ls-files/d' setup.py pyproject.toml
700c000
700c000
# Do not build the extension, which is a copy of the “tx” executable from
700c000
# adobe-afdko:
700c000
sed -r -i 's/(ext_modules=)/# \1/' setup.py
700c000
700c000
# Remove bundled adobe-afdko:
700c000
rm -rf external
700c000
700c000
%build
700c000
%py3_build
700c000
700c000
%install
700c000
%py3_install
700c000
700c000
# Workaround to prevent a dangling symlink:
700c000
install -d "%{buildroot}$(dirname '%{txbin}')"
700c000
ln -s '%{txbin}' '%{buildroot}%{txbin}'
700c000
700c000
# Build a relative symbolic link:
700c000
ln -s '%{buildroot}%{txbin}' %{buildroot}/%{python3_sitelib}/%{srcname}/tx
700c000
symlinks -c -o %{buildroot}/%{python3_sitelib}/%{srcname}/tx
700c000
700c000
%check
700c000
%if 0%{?fedora} == 33
700c000
# Fixing this would require an adobe-afdko update; see
700c000
# https://github.com/adobe-type-tools/cffsubr/issues/13.
700c000
%global koption -k 'not (TestSubroutinize and test_non_standard_upem_mute_font_matrix_warning)'
700c000
%endif
700c000
%pytest %{?koption}
700c000
700c000
%files -n python3-%{srcname}
700c000
%license LICENSE
700c000
%doc README.md
700c000
%{python3_sitelib}/%{srcname}
700c000
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
700c000
# This was just a workaround:
700c000
%exclude %{txbin}
700c000
700c000
%changelog
700c000
* Mon Mar  1 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.2.8-2
700c000
- New upstream version 0.2.8
700c000
- Simplify files list
700c000
- Patch out (missing) setuptools-git-ls-files BR; add missing setuptool-scm BR
700c000
- Unbundle tx executable from adobe-afdko and switch package to noarch
700c000
- Drop obsolete python_provide macro
700c000
- Use %%pytest macro to run the tests
700c000
- Use generated BR’s
700c000
700c000
* Mon Feb 15 2021 Rajeesh KV <rajeeshknambiar@fedoraproject.org> - 0.2.7-1
700c000
- Initial packaging