| |
@@ -1,62 +1,80 @@
|
| |
+ # Run tests by default
|
| |
+ %bcond_without tests
|
| |
+
|
| |
%global srcname ansi2html
|
| |
|
| |
- Name: python-ansi2html
|
| |
- Version: 1.5.1
|
| |
- Release: 13%{?dist}
|
| |
+ Name: python-%{srcname}
|
| |
+ Version: 1.6.0
|
| |
+ Release: 1%{?dist}
|
| |
Summary: Python module that converts text with ANSI color to HTML
|
| |
-
|
| |
- License: GPLv3+
|
| |
- URL: http://github.com/ralphbean/ansi2html
|
| |
- Source0: https://pypi.io/packages/source/a/ansi2html/ansi2html-%{version}.tar.gz
|
| |
+ # While the project was previously licensed as GPLv3+, it is now LGPLv3.
|
| |
+ # See https://github.com/pycontribs/ansi2html/issues/72 for more info.
|
| |
+ # In this issue, all of the previous contributors agreed to relicense their code.
|
| |
+ # However, the project never removed the GPLv3+ headers from some of the files.
|
| |
+ License: LGPLv3
|
| |
+ URL: http://github.com/pycontribs/%{srcname}
|
| |
+ Source0: %{pypi_source}
|
| |
+ # See https://fedoraproject.org/wiki/Changes/DeprecatePythonMock for more info.
|
| |
+ Patch0: 0000-replace-mock.patch
|
| |
|
| |
BuildArch: noarch
|
| |
|
| |
BuildRequires: python3-devel
|
| |
- BuildRequires: python3-setuptools
|
| |
- BuildRequires: python3-nose
|
| |
- BuildRequires: python3-mock
|
| |
- BuildRequires: python3-six
|
| |
-
|
| |
- %global _description\
|
| |
- The ansi2html module can convert text with ANSI color codes to HTML.
|
| |
+ # Needed for building manpages
|
| |
+ BuildRequires: /usr/bin/make
|
| |
+ BuildRequires: /usr/bin/a2x
|
| |
|
| |
- %description %_description
|
| |
+ %global _description %{expand:
|
| |
+ The ansi2html module can convert text with ANSI color codes to HTML.}
|
| |
|
| |
- %package -n python3-ansi2html
|
| |
- Summary: %summary
|
| |
- %{?python_provide:%python_provide python3-ansi2html}
|
| |
+ %description %{_description}
|
| |
|
| |
- Requires: python3
|
| |
- Requires: python3-setuptools
|
| |
- Requires: python3-six
|
| |
+ %package -n python3-%{srcname}
|
| |
+ Summary: %{summary}
|
| |
|
| |
- %description -n python3-ansi2html %_description
|
| |
+ %description -n python3-%{srcname} %_description
|
| |
|
| |
%prep
|
| |
- %setup -q -n %{srcname}-%{version}
|
| |
+ %autosetup -n %{srcname}-%{version} -p1
|
| |
|
| |
- # Remove bundled egg-info just in case it is included.
|
| |
- rm -rf *.egg*
|
| |
+ %generate_buildrequires
|
| |
+ # The -t is set if %%{with_tests} is true
|
| |
+ %pyproject_buildrequires %{?with_tests:-t}
|
| |
|
| |
%build
|
| |
- %py3_build
|
| |
+ # Build manpages
|
| |
+ make man/ansi2html.1
|
| |
+
|
| |
+ # Build wheel
|
| |
+ %pyproject_wheel
|
| |
|
| |
%install
|
| |
- mkdir -p %{buildroot}%{_mandir}/man1/
|
| |
- mv man/ansi2html.1 %{buildroot}%{_mandir}/man1/ansi2html.1
|
| |
- %py3_install
|
| |
+ %pyproject_install
|
| |
+ %pyproject_save_files %{srcname}
|
| |
+
|
| |
+ # Install manpage
|
| |
+ install -Dpm 644 man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1
|
| |
|
| |
%check
|
| |
- PYTHONPATH=. nosetests-%{python3_version} tests/*.py
|
| |
+ %if %{with tests}
|
| |
+ %tox
|
| |
+ %endif
|
| |
|
| |
- %files -n python3-ansi2html
|
| |
- %doc LICENSE README.rst
|
| |
- %{python3_sitelib}/ansi2html
|
| |
- %{python3_sitelib}/ansi2html-%{version}-*
|
| |
- %{_bindir}/ansi2html
|
| |
- %{_mandir}/man1/ansi2html.1.gz
|
| |
+ %files -n python3-%{srcname} -f %{pyproject_files}
|
| |
+ %doc README.rst
|
| |
+ %license LICENSE
|
| |
+ %{_bindir}/%{srcname}
|
| |
+ %{_mandir}/man1/%{srcname}.1*
|
| |
|
| |
%changelog
|
| |
+ * Wed Nov 17 2021 Maxwell G <gotmax@e.email> - 1.6.0-1
|
| |
+ - Update to 1.6.0. Fixes rhbz#1888556.
|
| |
+ - Implement new Fedora Python Packaging Guidelines.
|
| |
+ - Fix licensing
|
| |
+ - Replace mock with unittests.mock and use tox.
|
| |
+ - Use %%{srcname} globally
|
| |
+ - Move to new upstream
|
| |
+
|
| |
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-13
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
| |
|
| |
Implement new Fedora Python Packaging Guidelines.
Fix licensing
Replace mock with unittests.mock and use tox.
Use %{srcname} globally
Move to new upstream
Signed-off-by: Maxwell G gotmax@e.email