remove macros for %__python and add pythondeps27.sh [release 2.7.18-3mamba;Tue Jan 25 2022]

This commit is contained in:
Silvan Calarco 2024-01-05 16:58:22 +01:00
parent 202cade2c7
commit c92cdace47
2 changed files with 62 additions and 39 deletions

View File

@ -7,16 +7,17 @@
%define __libdir %{_libdir} %define __libdir %{_libdir}
Name: python27 Name: python27
Version: 2.7.18 Version: 2.7.18
Release: 2mamba Release: 3mamba
Summary: An interpreted, interactive, object-oriented programming language Summary: An interpreted, interactive, object-oriented programming language
Group: Applications/Development Group: Applications/Development
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.python.org URL: https://www.python.org/
Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
Source1: python-2.7-macros.python Source1: python-2.7-macros.python
Source2: python-macros.python Source2: python-macros.python
Source3: pythondeps27.sh
Patch1: %{name}-2.7.3-cgi.patch Patch1: %{name}-2.7.3-cgi.patch
Patch2: %{name}-2.7.3-platform_add_openmamba_distro.patch Patch2: %{name}-2.7.3-platform_add_openmamba_distro.patch
# Cross-compile patches available from: # Cross-compile patches available from:
@ -56,7 +57,7 @@ Provides: python-abi = %{majversion}
Provides: python(abi) = %{majversion} Provides: python(abi) = %{majversion}
Provides: /usr/bin/python Provides: /usr/bin/python
Provides: python = %{?epoch:epoch:}%{version}-%{release} Provides: python = %{?epoch:epoch:}%{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root Obsoletes: python27-doc <= 2.7.18-2mamba
%description %description
Python is an interpreted, interactive, object-oriented programming language. Python is an interpreted, interactive, object-oriented programming language.
@ -72,7 +73,7 @@ The Python implementation is portable: it runs on many brands of UNIX, on Window
Group: System/Libraries/Python Group: System/Libraries/Python
Summary: Libraries for Python Summary: Libraries for Python
Provides: libpython Provides: libpython
Obsoletes: libpython Obsoletes: libpython < 2.7.18-3mamba
%description -n %{libname} %description -n %{libname}
Python is an interpreted, interactive, object-oriented programming language. Python is an interpreted, interactive, object-oriented programming language.
@ -83,7 +84,6 @@ There are interfaces to many system calls and libraries, as well as to various w
New built-in modules are easily written in C or C++. New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface. Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga... The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
This package contains the libraries for Python. This package contains the libraries for Python.
%package -n %{libname}-devel %package -n %{libname}-devel
@ -91,11 +91,11 @@ Group: Development/Libraries/Python
Summary: Devel package for Python Summary: Devel package for Python
Requires: %{libname} = %{?epoch:epoch:}%{version}-%{release} Requires: %{libname} = %{?epoch:epoch:}%{version}-%{release}
Provides: %{name}-devel = %{version} Provides: %{name}-devel = %{version}
Obsoletes: %{name}-devel Obsoletes: %{name}-devel < 2.7.18-3mamba
Provides: libpython-devel Provides: libpython-devel
Obsoletes: libpython-devel Obsoletes: libpython-devel < 2.7.18-3mamba
Provides: python-devel Provides: python-devel
Obsoletes: python-devel Obsoletes: python-devel < 2.7.18-3mamba
%description -n %{libname}-devel %description -n %{libname}-devel
Python is an interpreted, interactive, object-oriented programming language. Python is an interpreted, interactive, object-oriented programming language.
@ -106,7 +106,6 @@ There are interfaces to many system calls and libraries, as well as to various w
New built-in modules are easily written in C or C++. New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface. Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga... The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
This package contains the development files for Python. This package contains the development files for Python.
%package doc %package doc
@ -114,7 +113,7 @@ Group: Documentation
Summary: Documentation package for Python Summary: Documentation package for Python
Requires: %{name} = %{?epoch:epoch:}%{version}-%{release} Requires: %{name} = %{?epoch:epoch:}%{version}-%{release}
Provides: python-doc Provides: python-doc
Obsoletes: python-doc Obsoletes: python-doc < 2.7.18-3mamba
%description doc %description doc
Python is an interpreted, interactive, object-oriented programming language. Python is an interpreted, interactive, object-oriented programming language.
@ -125,7 +124,6 @@ There are interfaces to many system calls and libraries, as well as to various w
New built-in modules are easily written in C or C++. New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface. Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga... The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
This package contains the documentation files for Python in HTML format. This package contains the documentation files for Python in HTML format.
%package tk %package tk
@ -133,7 +131,7 @@ Group: System/Libraries/Python
Summary: Tk library for Python Summary: Tk library for Python
Requires: %{name} = %{?epoch:epoch:}%{version}-%{release} Requires: %{name} = %{?epoch:epoch:}%{version}-%{release}
Provides: python-tk Provides: python-tk
Obsoletes: python-tk Obsoletes: python-tk < 2.7.18-3mamba
%description tk %description tk
Python is an interpreted, interactive, object-oriented programming language. Python is an interpreted, interactive, object-oriented programming language.
@ -144,7 +142,6 @@ There are interfaces to many system calls and libraries, as well as to various w
New built-in modules are easily written in C or C++. New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface. Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga... The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
This package contains the tk library for Python. This package contains the tk library for Python.
%debug_package %debug_package
@ -231,24 +228,25 @@ ln -s python%{majversion} %{buildroot}%{_includedir}/python
# fix library permission # fix library permission
chmod 755 %{buildroot}%{__libdir}/libpython%{majversion}.so.* chmod 755 %{buildroot}%{__libdir}/libpython%{majversion}.so.*
%if "%{stage1}" != "1" #%if "%{stage1}" != "1"
# build the HTML documentation ## build the HTML documentation
cd Doc #cd Doc
#
####sed -i s@/usr/bin/env@/bin/env@ tools/mkhowto
#PATH=$PATH:%{_builddir}/Python-%{version}/Doc/tools
#make html
#
#install -d %{buildroot}%{_defaultdocdir}/%{name}-%{version}
#cp -R build/html build/doctrees %{buildroot}%{_defaultdocdir}/%{name}-%{version}
#rm -f 'find %{buildroot}%{_defaultdocdir}/%{name}-%{version}/html/.cvsignore'
#
#cd ..
##make PAPER=a4 pdf
#%endif
###sed -i s@/usr/bin/env@/bin/env@ tools/mkhowto install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.python27
PATH=$PATH:%{_builddir}/Python-%{version}/Doc/tools #install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/rpm/macros.python
make html install -D -m0755 %{SOURCE3} %{buildroot}%{_prefix}/lib/rpm/pythondeps27.sh
install -d %{buildroot}%{_defaultdocdir}/%{name}-%{version}
cp -R build/html build/doctrees %{buildroot}%{_defaultdocdir}/%{name}-%{version}
rm -f 'find %{buildroot}%{_defaultdocdir}/%{name}-%{version}/html/.cvsignore'
cd ..
#make PAPER=a4 pdf
%endif
install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.python%{majversion}
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/rpm/macros.python
# install i18n tools for development # install i18n tools for development
install -D -m0755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/msgfmt%{majversion}.py install -D -m0755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/msgfmt%{majversion}.py
@ -336,11 +334,11 @@ exit 0
%files -n %{libname}-devel %files -n %{libname}-devel
%defattr(-,root,root) %defattr(-,root,root)
%{_sysconfdir}/rpm/macros.python%{majversion} %{_sysconfdir}/rpm/macros.python27
%{_sysconfdir}/rpm/macros.python
%{_bindir}/msgfmt%{majversion}.py %{_bindir}/msgfmt%{majversion}.py
%{_bindir}/pygettext%{majversion}.py %{_bindir}/pygettext%{majversion}.py
%{_bindir}/python*-config %{_bindir}/python*-config
%{_prefix}/lib/rpm/pythondeps27.sh
%{_includedir}/python %{_includedir}/python
%dir %{_includedir}/python%{majversion} %dir %{_includedir}/python%{majversion}
%{_includedir}/python%{majversion}/*.h %{_includedir}/python%{majversion}/*.h
@ -355,16 +353,19 @@ exit 0
%{__libdir}/python%{majversion}/lib-tk %{__libdir}/python%{majversion}/lib-tk
%{__libdir}/python%{majversion}/lib-dynload/_tkinter.so %{__libdir}/python%{majversion}/lib-dynload/_tkinter.so
%files doc #%files doc
%defattr(-,root,root) #%defattr(-,root,root)
%dir %{_defaultdocdir}/%{name}-%{version}/html/ #%dir %{_defaultdocdir}/%{name}-%{version}/html/
%{_defaultdocdir}/%{name}-%{version}/html/* #%{_defaultdocdir}/%{name}-%{version}/html/*
%{_defaultdocdir}/%{name}-%{version}/html/.buildinfo #%{_defaultdocdir}/%{name}-%{version}/html/.buildinfo
%dir %{_defaultdocdir}/%{name}-%{version}/doctrees #%dir %{_defaultdocdir}/%{name}-%{version}/doctrees
%{_defaultdocdir}/%{name}-%{version}/doctrees/* #%{_defaultdocdir}/%{name}-%{version}/doctrees/*
%endif %endif
%changelog %changelog
* Tue Jan 25 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.18-3mamba
- remove macros for %__python and add pythondeps27.sh
* Fri Jan 01 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.18-2mamba * Fri Jan 01 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.18-2mamba
- updated rpm macros files - updated rpm macros files

22
pythondeps27.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
[ $# -ge 1 ] || {
cat > /dev/null
exit 0
}
PYVER=`python2.7 -c "import sys; v=sys.version_info[:2]; print ('%d.%d'%v)"`
case $1 in
-P|--provides)
shift
grep "/usr/lib[^/]*/libpython${PYVER}\..*\.so.*\$" >/dev/null && echo "python(abi) = ${PYVER}"
exit 0
;;
-R|--requires)
shift
grep "/usr/\(lib[^/]*\|share\)/python${PYVER}/" >/dev/null && echo "python(abi) = ${PYVER}"
exit 0
;;
esac
exit 0