python3/python3.spec

463 lines
18 KiB
RPMSpec
Raw Normal View History

%define majversion %(echo %version | cut -d. -f 1-2)
%define libname libpython3
Name: python3
Version: 3.7.16
Release: 1mamba
Summary: An interpreted, interactive, object-oriented programming language
Group: Applications/Development
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.python.org/
Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
Source1: macros.python3
Source2: pythondeps3.sh
Source3: python-rpm-macros.pyver
Patch0: python-2.4.2-tex3-fix.patch
Patch1: python-2.4.2-cgi.patch
Patch2: python-2.7.3-use_system_Sphinx.patch
Patch3: python3-3.7.4-lib64.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libX11-devel
BuildRequires: libbzip2-devel
BuildRequires: libexpat-devel
BuildRequires: libffi-devel
BuildRequires: libgdbm-devel
BuildRequires: liblzma-devel
BuildRequires: libncurses-devel
BuildRequires: libnsl-devel
BuildRequires: libopenssl-devel
BuildRequires: libreadline-devel
BuildRequires: libsqlite-devel
BuildRequires: libtcl-devel
BuildRequires: libtirpc-devel
BuildRequires: libtk-devel
BuildRequires: libuuid-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
BuildRequires: glibc-devel >= 2.3.5
BuildRequires: libbluez-devel >= 2.21
%if "%{?bootstrap}" != "1"
BuildRequires: latex2html >= 2002
BuildRequires: tetex >= 3.0
BuildRequires: libtk >= 8.4.11
%endif
BuildRequires: python-pip-py3
BuildRequires: python-setuptools-py3
Requires: %{libname} = %{?epoch:%epoch:}%{version}-%{release}
Provides: python-abi = %{majversion}
Provides: python(abi) = %{majversion}
Provides: /usr/bin/python
Provides: /usr/bin/python3
Obsoletes: python3-doc < 3.7.10
%description
Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). 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.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
%package -n %{libname}
Group: System/Libraries/Python
Summary: Libraries for Python
Obsoletes: python-typing-py3 <= 3.10.0.0-2mamba
%description -n %{libname}
Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). 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.
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.
%package -n %{libname}-devel
Group: Development/Libraries/Python
Summary: Devel package for Python
Requires: %{libname} = %{?epoch:%epoch:}%{version}-%{release}
Provides: %{name}-devel = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes: %{name}-devel < 3.7.10
%description -n %{libname}-devel
Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). 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.
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.
%package doc
Group: Documentation
Summary: Documentation package for Python
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description doc
Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). 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.
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.
%package tk
Group: System/Libraries/Python
Summary: Tk library for Python
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description tk
Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). 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.
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.
%debug_package
%prep
%setup -q -n Python-%{version}
#-D -T
#:<< _EOF
#%patch0 -p1
%patch 1 -p1
#%patch2 -p1
%ifarch x86_64 aarch64
%patch 3 -p1
%endif
%build
#:<< _EOF
%configure \
--enable-ipv6 \
--enable-shared \
--with-system-ffi \
--with-system-expat \
%ifnarch arm
--enable-optimizations
%endif
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
#install -d %{buildroot}%{_libdir}/python/site-packages
#ln -s python%{majversion} %{buildroot}%{_libdir}/python
ln -s python%{majversion}m %{buildroot}%{_includedir}/python
ln -s libpython%{majversion}m.so %{buildroot}%{_libdir}/libpython%{majversion}.so
# fix library permission
chmod 755 %{buildroot}%{_libdir}/libpython%{majversion}m.so.*
%if "%{?bootstrap}" != "1"
# build the HTML documentation
cd Doc
###sed -i s@/usr/bin/env@/bin/env@ tools/mkhowto
# NOTE: html docs don't build with recent Sphinx (3.5.2)
#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`
#make PAPER=a4 pdf
%endif
rm -f `find %{buildroot}%{_docdir}/%{name}-%{version}/html/.buildinfo`
install -D -m0644 %{SOURCE1} %{buildroot}%{_rpmmacrodir}/macros.python3
install -D -m0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/rpm/pythondeps3.sh
install -D -m0644 %{SOURCE3} %{buildroot}%{_rpmmacrodir}/macros.pyver
rm %{buildroot}%{_includedir}/python
rm %{buildroot}%{_bindir}/2to3
rm %{buildroot}%{_bindir}/python3
rm -f %{buildroot}%{_bindir}/pip3*
rm -f %{buildroot}%{_bindir}/easy_install-3*
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
if [ $1 -ge 1 ]; then
/usr/sbin/update-alternatives --install %{_bindir}/python python %{_bindir}/python%{majversion} 72
/usr/sbin/update-alternatives --install %{_bindir}/python3 python3 %{_bindir}/python%{majversion} 80
fi
exit 0
%preun
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove python %{_bindir}/python%{majversion}
/usr/sbin/update-alternatives --remove python3 %{_bindir}/python%{majversion}
fi
exit 0
%posttrans
if [ $1 -ge 1 ]; then
# fix missing link when upgrading the package which provided a real /usr/bin/python*
[ -e %{_bindir}/python ] || /usr/sbin/update-alternatives --auto python
[ -e %{_bindir}/python3 ] || /usr/sbin/update-alternatives --auto python3
fi
:
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%transfiletriggerpostun -P 2000000 -- %{_libdir}/python%{majversion}/site-packages
find %{_libdir}/python%{majversion}/site-packages/*.egg-info -type d -empty -exec rmdir {} \;
:
%ifarch x86_64 aarch64
%transfiletriggerpostun -P 2000000 -- %{_prefix}/lib/python%{majversion}/site-packages
find %{_prefix}/lib/python%{majversion}/site-packages/*.egg-info -type d -empty -exec rmdir {} \;
:
%endif
%files
%defattr(-,root,root)
%{_bindir}/2to3-%{majversion}
%{_bindir}/idle3
%{_bindir}/idle%{majversion}
%{_bindir}/pydoc3
%{_bindir}/pydoc%{majversion}
%{_bindir}/pyvenv
%{_bindir}/pyvenv-%{majversion}
%{_bindir}/python%{majversion}m
%{_bindir}/python%{majversion}
%{_mandir}/man1/*
%files -n %{libname}
%defattr(-,root,root)
%dir %{_libdir}/python%{majversion}
%{_libdir}/python%{majversion}/*
%ifarch x86_64 aarch64
%dir %{_prefix}/lib/python%{majversion}
%{_prefix}/lib/python%{majversion}/*
%endif
%{_libdir}/libpython3.so
%{_libdir}/libpython%{majversion}.so
%{_libdir}/libpython%{majversion}m.so
%{_libdir}/libpython%{majversion}m.so.*
%if "%{?bootstrap}" != "1"
%exclude %{_libdir}/python%{majversion}/lib-dynload/_tkinter*.so
%endif
%files -n %{libname}-devel
%defattr(-,root,root)
%{_rpmmacrodir}/macros.pyver
%{_rpmmacrodir}/macros.python3
%{_bindir}/python3-config
%{_bindir}/python%{majversion}-config
%{_bindir}/python%{majversion}m-config
%{_includedir}/python%{majversion}m/*.h
%dir %{_includedir}/python%{majversion}m/internal
%{_includedir}/python%{majversion}m/internal/*.h
%{_libdir}/pkgconfig/python-%{majversion}.pc
%{_libdir}/pkgconfig/python-%{majversion}m.pc
%{_libdir}/pkgconfig/python3.pc
%{_prefix}/lib/rpm/pythondeps3.sh
%if "%{?bootstrap}" != "1"
%files tk
%defattr(-,root,root)
%{_libdir}/python%{majversion}/lib-dynload/_tkinter*.so
#%files doc
#%defattr(-,root,root)
#%dir %{_defaultdocdir}/%{name}-%{version}/html/
#%{_defaultdocdir}/%{name}-%{version}/html/*
#%dir %{_defaultdocdir}/%{name}-%{version}/doctrees
#%{_defaultdocdir}/%{name}-%{version}/doctrees/*
%endif
%changelog
* Tue Apr 11 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.16-1mamba
- update to 3.7.16
- obsolete python-typing-py3
* Wed Feb 02 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.12-2mamba
- macros.python3: use sysconfig instead of distutils
* Sun Dec 26 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.12-1mamba
- update to 3.7.12
* Tue Mar 09 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.10-1mamba
- update to 3.7.10
- added posttransfiletrigger's to cleanup empty *.egg-info directories
* Fri Jan 01 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.9-1mamba
- update to 3.7.9
- install macros.pyver with custom pyver macros updated and to be moved from macros.python
* Sun Jul 05 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.8-1mamba
- update to 3.7.8
* Wed Aug 28 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.4-5mamba
- x86_64: fixed patch to support both lib64 and lib sitelib dir
* Thu Aug 08 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.4-4mamba
- fix installation name of pythondeps3.sh
* Mon Aug 05 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.4-3mamba
- add pythondeps3.sh file required by rpm macros.python3
* Mon Aug 05 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.4-2mamba
- configure %{_bindir}/python3 as an alternative
* Thu Aug 01 2019 Automatic Build System <autodist@mambasoft.it> 3.7.4-1mamba
- automatic version update by autodist
* Mon Apr 01 2019 Automatic Build System <autodist@mambasoft.it> 3.7.3-1mamba
- automatic version update by autodist
* Mon Jun 27 2016 Automatic Build System <autodist@mambasoft.it> 3.5.2-1mamba
- automatic version update by autodist
* Mon Dec 07 2015 Automatic Build System <autodist@mambasoft.it> 3.5.1-1mamba
- automatic version update by autodist
* Mon Sep 14 2015 Automatic Build System <autodist@mambasoft.it> 3.5.0-1mamba
- automatic version update by autodist
* Sun Mar 01 2015 Automatic Build System <autodist@mambasoft.it> 3.4.3-1mamba
- automatic version update by autodist
* Thu Oct 09 2014 Automatic Build System <autodist@mambasoft.it> 3.4.2-1mamba
- automatic version update by autodist
* Sat Jun 28 2014 Automatic Build System <autodist@mambasoft.it> 3.4.1-1mamba
- automatic version update by autodist
* Tue Mar 18 2014 Automatic Build System <autodist@mambasoft.it> 3.4.0-1mamba
- automatic version update by autodist
* Wed Mar 12 2014 Automatic Build System <autodist@mambasoft.it> 3.3.5-1mamba
- automatic version update by autodist
* Wed Feb 12 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.3.4-1mamba
- update to 3.3.4
* Sat Jan 25 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.3.3-2mamba
- x86_64: added lib64 patch to install under /usr/lib64
* Mon Dec 09 2013 Automatic Build System <autodist@mambasoft.it> 3.3.3-1mamba
- automatic version update by autodist
* Thu May 16 2013 Automatic Build System <autodist@mambasoft.it> 3.3.2-1mamba
- automatic version update by autodist
* Sun Apr 07 2013 Automatic Build System <autodist@mambasoft.it> 3.3.1-1mamba
- automatic version update by autodist
* Sun Oct 07 2012 Automatic Build System <autodist@mambasoft.it> 3.3.0-1mamba
- automatic version update by autodist
* Thu Apr 12 2012 Automatic Build System <autodist@mambasoft.it> 3.2.3-1mamba
- automatic version update by autodist
* Sat Jan 21 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.2-2mamba
- macros.python: rename py_requires and py_compile to py3_requires and py3_compile
* Mon Oct 03 2011 Automatic Build System <autodist@mambasoft.it> 3.2.2-1mamba
- automatic version update by autodist
* Tue Aug 30 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.1-4mamba
- also fixed print function in maxver definition in /etc/rpm/macros.python3
* Mon Aug 29 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.1-3mamba
- rebuilt with wide-unicode support
* Mon Aug 29 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.1-2mamba
- rename /etc/rpm/macros.python to /etc/rpm/macros.python3
* Mon Jul 11 2011 Automatic Build System <autodist@mambasoft.it> 3.2.1-1mamba
- automatic update by autodist
* Sun Mar 06 2011 Automatic Build System <autodist@mambasoft.it> 3.2-1mamba
- automatic update by autodist
* Sun Nov 28 2010 Automatic Build System <autodist@mambasoft.it> 3.1.3-1mamba
- automatic update by autodist
* Mon Mar 22 2010 Automatic Build System <autodist@mambasoft.it> 3.1.2-1mamba
- automatic update to 3.1.2 by autodist
* Mon Aug 17 2009 Automatic Build System <autodist@mambasoft.it> 3.1.1-1mamba
- automatic update to 3.1.1 by autodist
* Mon Jun 29 2009 Automatic Build System <autodist@mambasoft.it> 3.1-1mamba
- automatic update to 3.1 by autodist
* Sun Jan 25 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6-4mamba
- raise alternative priority to overcome python 2.4 and make the default
* Thu Oct 23 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6-3mamba
- python-devel: install rpm's macros.python file
* Thu Oct 16 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6-2mamba
- removed /usr/lib/site-packages directory
- fixed maintainer email
* Thu Oct 02 2008 gil <puntogil@libero.it> 2.6-1mamba
- update to 2.6
* Sat Jun 28 2008 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 2.5.2-1mamba
- update to 2.5.2.
* Wed Jun 25 2008 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 2.4.4-1mamba
- renamed to legacy python24 - changed doc to pdf due to a problem with latex2html
* Fri Mar 30 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.4-1mamba
- update to version 2.4.4 by autospec
* Fri Mar 31 2006 Davide Madrisan <davide.madrisan@qilinux.it> 2.4.3-1qilnx
- update to version 2.4.3 by autospec
* Mon Feb 27 2006 Stefano Cotta Ramusino <stefano.cotta@qilinux.it> 2.4.2-3qilnx
- added cgi script patch
* Mon Jan 09 2006 Davide Madrisan <davide.madrisan@qilinux.it> 2.4.2-2qilnx
- provides python-abi, python(abi)
* Fri Sep 30 2005 Davide Madrisan <davide.madrisan@qilinux.it> 2.4.2-1qilnx
- update to version 2.4.2 by autospec
- also fix the security issues CAN-2005-1849 and CAN-2005-2096
- patch to build python documentation with TeX3 updated
* Tue Aug 09 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.1-2qilnx
- remove %%pre script
* Thu Jul 21 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.1-1qilnx
- new version build
* Thu Apr 07 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.5-2qilnx
- remove Xorg-libs dependency by adding subpackage python-tk
* Thu Feb 10 2005 Davide Madrisan <davide.madrisan@qilinux.it> 2.3.5-1qilnx
- update to version 2.3.5 by autospec
- also fix the security issue QSA-2005-013 (CAN-2005-0089)
* Wed Feb 02 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.5-1qilnx
- rebuilt with shared libraries
* Thu May 27 2004 Davide Madrisan <davide.madrisan@qilinux.it> 2.3.4-1qilnx
- new version rebuild (bugfix release)
- added the doc package with the Python documentation in HTML format
* Wed Dec 24 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.3-2qilnx
- renamed lib and includes destdir to /usr/include/python
* Tue Dec 23 2003 Davide Madrisan <davide.madrisan@qilinux.it> 2.3.3-1qilnx
- rebuild with Python 2.3.3
* Mon Oct 27 2003 Davide Madrisan <davide.madrisan@qilinux.it> 2.3.2-1qilnx
- rebuild with Python 2.3.2
* Tue Jul 01 2003 Silvan Calarco <silvan.calarco@qinet.it> 2.2.3-1qilnx
- first build