provide tools without .py extension if python3 [release 0.19-2mamba;Tue Aug 16 2022]

This commit is contained in:
Silvan Calarco 2024-01-06 11:05:50 +01:00
parent 6166550c93
commit f74c9cb29c

View File

@ -1,6 +1,6 @@
Name: python-docutils
Version: 0.19
Release: 1mamba
Release: 2mamba
Summary: Python Documentation Utilities
Group: System/Libraries/Python
Vendor: openmamba
@ -13,18 +13,16 @@ License: Python, BSD, GPL, public domain
BuildRequires: libpython3-devel
BuildRequires: python3.7dist(setuptools)
## AUTOBUILDREQ-END
BuildRequires: python-setuptools
Requires: python >= %python_version
BuildArch: noarch
%description
Docutils is an open-source text processing system for processing plaintext documentation into useful formats, such as HTML or LaTeX.
It includes reStructuredText, the easy to read, easy to use, what-you-see-is-what-you-get plaintext markup language.
%if "%{?with_pyver}"
%if "0%{?with_pyver}" == "03"
%define py_requires_append \
Provides: python-docutils
Obsoletes: python-docutils
Provides: python-docutils \
Obsoletes: python-docutils < 0.19-2mamba
%pyver_package
%endif
@ -45,14 +43,18 @@ CFLAGS="%{optflags}" %{__python} setup.py build
sed -i "\,\.egg-info/,d;s,.*/man/.*,&.gz," %{name}.filelist
## remove .py extension for executable
#for file in %{buildroot}%{_bindir}/*.py; do
#%if "%{?pyappend}" == "py3"
# mv $file %{buildroot}%{_bindir}/$(basename $file .py)
#%else
# mv $file %{buildroot}%{_bindir}/$(basename $file .py)%{?pyappend:-%pyappend}
#%endif
#done
# symlink without .py extension if py_ver==3 or rename to avoid conflicts
for f in %{buildroot}%{_bindir}/*.py; do
%if "0%{?with_pyver}" == "03"
ln -s "$(basename $f)" %{buildroot}%{_bindir}/$(basename $f .py)
%else
mv $f %{buildroot}%{_bindir}/$(basename $file .py)%{?pyappend:-%pyappend}
%endif
done
sed -i "\,%{_bindir},d" %{name}.filelist
%if "0%{?with_pyver}" != "03"
mv %{buildroot}%{_bindir}/docutils %{buildroot}%{_bindir}/docutils-py%{%pyappend}
%endif
# remove no license file
rm -f licenses/docutils.conf
@ -62,11 +64,14 @@ rm -f licenses/docutils.conf
%files %{?pyappend} -f %{name}.filelist
%defattr(-,root,root)
#%{_bindir}/rst*
%{_bindir}/*
%dir %{python_sitearch}/docutils-%{version}-py*.egg-info
%{python_sitearch}/docutils-%{version}-py*.egg-info/*
%changelog
* Tue Aug 16 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 0.19-2mamba
- provide tools without .py extension if python3
* Fri Jul 08 2022 Automatic Build System <autodist@mambasoft.it> 0.19-1mamba
- automatic version update by autodist