From 538801c6959eb6d899f5808680b48ea84e14fbc6 Mon Sep 17 00:00:00 2001 From: tigro Date: Mon, 16 Dec 2024 22:36:33 +0300 Subject: [PATCH] import python-cffsubr-0.2.9.post1-13.el10 --- .gitignore | 1 + .python-cffsubr.metadata | 1 + SOURCES/24.patch | 36 +++++++++ SOURCES/cffsubr.1 | 39 +++++++++ SPECS/python-cffsubr.spec | 163 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 240 insertions(+) create mode 100644 .gitignore create mode 100644 .python-cffsubr.metadata create mode 100644 SOURCES/24.patch create mode 100644 SOURCES/cffsubr.1 create mode 100644 SPECS/python-cffsubr.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b11692f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/cffsubr-0.2.9.post1.tar.gz diff --git a/.python-cffsubr.metadata b/.python-cffsubr.metadata new file mode 100644 index 0000000..c2f66ec --- /dev/null +++ b/.python-cffsubr.metadata @@ -0,0 +1 @@ +a9d2b9be6eebc54c2664ef610c69778530db54c3 SOURCES/cffsubr-0.2.9.post1.tar.gz diff --git a/SOURCES/24.patch b/SOURCES/24.patch new file mode 100644 index 0000000..442c405 --- /dev/null +++ b/SOURCES/24.patch @@ -0,0 +1,36 @@ +From 822a00d2001fa4de06ca854c3047b8687d6c1a32 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Wed, 29 Nov 2023 08:14:32 -0500 +Subject: [PATCH] Handle importlib.resources.path removal in Python 3.13 + +--- + src/cffsubr/__init__.py | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/src/cffsubr/__init__.py b/src/cffsubr/__init__.py +index 4428dcd..1d4eef2 100644 +--- a/src/cffsubr/__init__.py ++++ b/src/cffsubr/__init__.py +@@ -8,10 +8,19 @@ + import sys + + try: +- from importlib.resources import path ++ # Python >= 3.9 ++ from importlib.resources import as_file, files + except ImportError: +- # use backport for python < 3.7 +- from importlib_resources import path ++ try: ++ # python >= 3.7, deprecated in python 3.11, removed in 3.13 ++ from importlib.resources import path ++ except ImportError: ++ # use backport for python < 3.7 ++ from importlib_resources import path ++else: ++ # https://docs.python.org/3.11/library/importlib.resources.html#importlib.resources.as_file ++ def path(package, resource): ++ return as_file(files(package).joinpath(resource)) + + from fontTools import ttLib + diff --git a/SOURCES/cffsubr.1 b/SOURCES/cffsubr.1 new file mode 100644 index 0000000..c792c3d --- /dev/null +++ b/SOURCES/cffsubr.1 @@ -0,0 +1,39 @@ +.TH CFFSUBR "1" "October 2021" "" "User Commands" +.SH NAME +.B cffsubr +\(en compress OpenType Font\(cqs CFF or CFF2 table by computing subroutines +.SH SYNOPSIS +.B cffsubr +.RB [ \-h ] +.RB [ \-o \ \fIOUTPUT_FILE \ |\ \-i ] +.RB [ \-f \ { 1 , 2 }] +.RB [ \-N ] +.RB [ \-d ] +.I input_file +.SH OPTIONS +.SS "POSITIONAL ARGUMENTS" +.TP +.I input_file +Input font file. +Must contain either CFF or CFF2 table +.SS "OPTIONAL ARGUMENTS" +.TP +.BR \-h ,\ \-\-help +Show a help message and exit. +.TP +.B \-o\ \fIOUTPUT_FILE\fR,\ \fB\-\-output\-file\ \fIOUTPUT_FILE +Optional path to output file. +By default, dump binary data to +.IR stdout . +.TP +.BR \-i ,\ \-\-inplace +Whether to overwrite the input file. +.TP +.B \-f\ \fR{\fB1\fR,\fB2\fR},\fB\ \-\-cff\-version\ \fR{\fB1\fR,\fB2\fR} +Output CFF table format version. +.TP +.BR \-N ,\ \-\-no\-glyph\-names +Whether to drop postscript glyph names when converting from CFF to CFF2. +.TP +.BR \-d ,\ \-\-desubroutinize +Don\(cqt subroutinize, instead remove all subroutines (in any). diff --git a/SPECS/python-cffsubr.spec b/SPECS/python-cffsubr.spec new file mode 100644 index 0000000..8c70ec4 --- /dev/null +++ b/SPECS/python-cffsubr.spec @@ -0,0 +1,163 @@ +Name: python-cffsubr +Version: 0.2.9.post1 +Release: 13%{?dist} +Summary: Standalone CFF subroutinizer based on the AFDKO tx tool + +# The entire source is Apache-2.0, except: +# - These are derived from fonts licened OFL-1.1, but are not packaged, so they +# do not contribute to the licenses of the binary RPMs: +# • tests/data/SourceSansPro-Regular.subset.ttx +# • tests/data/SourceSansVariable-Regular.subset.ttx +# See NOTICE. +License: Apache-2.0 +URL: https://pypi.org/project/cffsubr +Source0: %{pypi_source cffsubr} +# Written for Fedora in groff_man(7) format based on the output of “cffsubr --help” +Source1: cffsubr.1 + +# Handle importlib.resources.path removal in Python 3.13 +# https://github.com/adobe-type-tools/cffsubr/pull/24 +Patch: https://github.com/adobe-type-tools/cffsubr/pull/24.patch + +BuildArch: noarch + +BuildRequires: python3-devel +# From setup_requires in setup.py: +BuildRequires: python3dist(setuptools-scm) + +%global txbin /usr/bin/tx +# For the unbundled “tx” executable: +BuildRequires: adobe-afdko +BuildRequires: symlinks + +%description +Standalone CFF subroutinizer based on the AFDKO tx tool. + +%generate_buildrequires +%pyproject_buildrequires -x testing + +%package -n python3-cffsubr +Summary: %{summary} + +# For the unbundled “tx” executable: +Requires: adobe-afdko + +%description -n python3-cffsubr +Standalone CFF subroutinizer based on the AFDKO tx tool. + +%prep +%autosetup -n cffsubr-%{version} -p1 + +# Patch out setuptools-git-ls-files dependency +sed -r -i '/setuptools-git-ls-files/d' setup.py pyproject.toml + +# Do not build the extension, which is a copy of the “tx” executable from +# adobe-afdko: +sed -r -i 's/(ext_modules=)/# \1/' setup.py + +# Remove bundled adobe-afdko: +rm -rf external + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files -l cffsubr + +# Workaround to prevent a dangling symlink: +install -d "%{buildroot}$(dirname '%{txbin}')" +ln -s '%{txbin}' '%{buildroot}%{txbin}' + +# Build a relative symbolic link: +ln -s '%{buildroot}%{txbin}' %{buildroot}/%{python3_sitelib}/cffsubr/tx +symlinks -c -o %{buildroot}/%{python3_sitelib}/cffsubr/tx + +install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}' + +%check +%pytest + +%files -n python3-cffsubr -f %{pyproject_files} +# pyproject-rpm-macros handles the LICENSE file; verify with “rpm -qL -p …” +%doc README.md + +# Symbolic link to the “tx” executable; we patched out building a separate copy +# for the Python package, so the Python build does not know about this and we +# must list it explicitly. +%{python3_sitelib}/cffsubr/tx +# This was just a workaround: +%exclude %{txbin} + +%{_bindir}/cffsubr +%{_mandir}/man1/cffsubr.1* + +%changelog +* Mon Dec 16 2024 Arkady L. Shane - 0.2.9.post1-13 +- Rebuilt for MSVSphere 10 + +* Tue Oct 29 2024 Troy Dawson - 0.2.9.post1-13 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Mon Jun 24 2024 Troy Dawson - 0.2.9.post1-12 +- Bump release for June 2024 mass rebuild + +* Fri Jan 26 2024 Fedora Release Engineering - 0.2.9.post1-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 0.2.9.post1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 01 2024 Benjamin A. Beasley - 0.2.9.post1-9 +- Assert %%pyproject_files contains a license file +- Remove an obsolete conditional +- Simplify the spec file by reducing macro indirection + +* Fri Jul 21 2023 Fedora Release Engineering - 0.2.9.post1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jun 19 2023 Python Maint - 0.2.9.post1-7 +- Rebuilt for Python 3.12 + +* Fri Jan 20 2023 Fedora Release Engineering - 0.2.9.post1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Nov 29 2022 Benjamin A. Beasley - 0.2.9.post1-5 +- Update License to SPDX + +* Fri Jul 22 2022 Fedora Release Engineering - 0.2.9.post1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jun 15 2022 Python Maint - 0.2.9.post1-3 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 0.2.9.post1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Oct 26 2021 Benjamin A. Beasley - 0.2.9-1 +- Update to 0.2.9 (close RHBZ#2017405) +- Add a man page for the new “cffsubr” CLI entry point + +* Tue Oct 26 2021 Benjamin A. Beasley - 0.2.8-5 +- Drop python3dist(setuptools) BR because it is implied by pyproject-rpm-macros, + and pyproject-rpm-macros BR because it is (now) implied by python3-devel +- Use the full set of pyproject-rpm-macros + +* Fri Jul 23 2021 Fedora Release Engineering - 0.2.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 0.2.8-3 +- Rebuilt for Python 3.10 + +* Mon Mar 1 2021 Benjamin A. Beasley - 0.2.8-2 +- New upstream version 0.2.8 +- Simplify files list +- Patch out (missing) setuptools-git-ls-files BR; add missing setuptool-scm BR +- Unbundle tx executable from adobe-afdko and switch package to noarch +- Drop obsolete python_provide macro +- Use %%pytest macro to run the tests +- Use generated BR’s + +* Mon Feb 15 2021 Rajeesh KV - 0.2.7-1 +- Initial packaging