From 6e648408053ac1ec9cb478436f946fc53772d595 Mon Sep 17 00:00:00 2001 From: Shawn Wang Date: Sat, 8 Apr 2023 14:13:28 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: Shawn Wang --- python-dateutil.spec | 58 ++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/python-dateutil.spec b/python-dateutil.spec index 206c4ef..988c89b 100644 --- a/python-dateutil.spec +++ b/python-dateutil.spec @@ -1,64 +1,49 @@ -%global modname dateutil -%define anolis_release 3 -Name: python-%{modname} +%define anolis_release 4 +%bcond_without tests +%global pypi_name dateutil + +Name: python-%{pypi_name} Version: 2.8.2 Release: %{anolis_release}%{?dist} Epoch: 1 Summary: Powerful extensions to the standard datetime module - -# According to the LICENSE file: -# - BSD License applies to all code, even that also covered by ASL 2.0 -# - ASL 2.0 applies to all contributions after 2017-12-01, as well as -# all contributions that have been re-licensed. License: BSD or (BSD and ASL 2.0) - URL: https://github.com/dateutil/dateutil -Source: %{pypi_source} +Source: https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-%{pypi_name}-%{version}.tar.gz -# Remove deprecated pytest.warns(None) from test_internals.py -# -# Fixes: -# python-dateutil fails to build with pytest 7 Patch1: %{url}/commit/2bdd63158b7f981fc6d70a869680451bdfd8d848.patch -# when bootstrapping dateutil-freezegun, we cannot run tests -%bcond_without tests - BuildArch: noarch BuildRequires: make BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme -%global _description \ +%description The dateutil module provides powerful extensions to the standard datetime\ module available in Python. -%description %_description - -%package -n python3-%{modname} +%package -n python3-%{pypi_name} Summary: %summary BuildRequires: python3-devel %if %{with tests} -BuildRequires: python3-freezegun -BuildRequires: python3-hypothesis -BuildRequires: python3-pytest -BuildRequires: python3-six +BuildRequires: python3-freezegun python3-hypothesis python3-pytest python3-six %endif Requires: tzdata -%{?python_provide:%python_provide python3-%{modname}} +%{?python_provide:%python_provide python3-%{pypi_name}} -%description -n python3-%{modname} %_description +%description -n python3-%{pypi_name} +The dateutil module provides powerful extensions to the standard datetime\ +module available in Python. %package doc -Summary: API documentation for python-dateutil +Summary: API documentation for python-%{pypi_name} + %description doc -This package contains %{summary}. +The %{name}-doc package contains documentation files for %{name}. %prep %autosetup -N -# the tests were moved outside of %%{modname} directory upstream after 2.8.2 -# so we apply the patch with new paths from within it -pushd %{modname}/test +pushd %{pypi_name}/test %patch1 -p2 popd iconv --from=ISO-8859-1 --to=UTF-8 NEWS > NEWS.new @@ -79,17 +64,20 @@ make -C docs html %{__python3} -m pytest -W ignore::pytest.PytestUnknownMarkWarning %endif -%files -n python3-%{modname} +%files -n python3-%{pypi_name} %license LICENSE %doc NEWS README.rst -%{python3_sitelib}/%{modname}/ -%{python3_sitelib}/python_dateutil-%{version}.dist-info/ +%{python3_sitelib}/%{pypi_name}/ +%{python3_sitelib}/python_%{pypi_name}-%{version}.dist-info/ %files doc %license LICENSE %doc docs/_build/html %changelog +* Sat Apr 08 2023 Shawn Wang - 2.8.2-4 +- Optimize the spec file + * Thu Mar 30 2023 mgb01105731 - 2.8.2-3 - Del Specific Fields -- Gitee