[projects/template-specs] - drop overmacroization and unify with other python*.spec; there is even no single pypi name variant

qboosh qboosh at pld-linux.org
Mon Jul 14 21:08:35 CEST 2025


commit 0bdf69750b6acf3da412849321abb1c8423f7cb2
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Jul 14 21:10:14 2025 +0200

    - drop overmacroization and unify with other python*.spec; there is even no single pypi name variant for some packages

 python.spec | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/python.spec b/python.spec
index e537741..dd69ab7 100644
--- a/python.spec
+++ b/python.spec
@@ -10,13 +10,8 @@
 %bcond_without	python2 # CPython 2.x module
 %bcond_without	python3 # CPython 3.x module
 
-# NOTES:
-# - 'module' should match the Python import path (first component?)
-# - 'egg_name' should equal to Python egg name
-# - 'pypi_name' must match the Python Package Index name
-%define		module		crispy_forms
-%define		egg_name	django_crispy_forms
-%define		pypi_name	django-crispy-forms
+# - 'module' should match the Python import path or pypi name
+%define		module		template
 Summary:	-
 Summary(pl.UTF-8):	-
 Name:		python-%{module}
@@ -25,10 +20,10 @@ Release:	0.1
 License:	- (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
 Group:		Libraries/Python
 # if pypi:
-#Source0Download: https://pypi.org/simple/PYPI_NAME/
-Source0:	https://files.pythonhosted.org/packages/source/P/PYPI_NAME/%{pypi_name}-%{version}.tar.gz
+#Source0Download: https://pypi.org/simple/MODULE/
+Source0:	https://files.pythonhosted.org/packages/source/M/MODULE/%{module}-%{version}.tar.gz
 # Source0-md5:	-
-#URL:		https://pypi.org/project/PYPI_NAME/
+#URL:		https://pypi.org/project/MODULE/
 URL:		-
 %if %{with python2}
 BuildRequires:	python-modules >= 1:2.5
@@ -49,7 +44,10 @@ BuildRequires:	rpmbuild(macros) >= 1.714
 # when using /usr/bin/env or other in-place substitutions
 #BuildRequires:        sed >= 4.0
 %if %{with doc}
-BuildRequires:	sphinx-pdg # -2 or -3
+# if there is separate python3-MODULE.spec, prefer python2 based Sphinx
+BuildRequires:	sphinx-pdg-2
+# else prefer python3 based Sphinx
+BuildRequires:	sphinx-pdg-3
 %endif
 # replace with other requires if defined in setup.py
 Requires:	python-modules >= 1:2.5
@@ -82,7 +80,7 @@ API documentation for Python %{module} module.
 Dokumentacja API modułu Pythona %{module}.
 
 %prep
-%setup -q -n %{pypi_name}-%{version}
+%setup -q -n %{module}-%{version}
 
 # fix #!/usr/bin/env python -> #!/usr/bin/python:
 #%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
@@ -162,7 +160,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc AUTHORS CREDITS ChangeLog NEWS README THANKS TODO
 %{py_sitescriptdir}/%{module}
-%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
+%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
 %{_examplesdir}/python-%{module}-%{version}
 %endif
 
@@ -171,7 +169,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 # copy %doc from python2 package here
 %{py3_sitescriptdir}/%{module}
-%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
+%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
 %{_examplesdir}/python3-%{module}-%{version}
 %endif
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/template-specs.git/commitdiff/0bdf69750b6acf3da412849321abb1c8423f7cb2



More information about the pld-cvs-commit mailing list