%global version 3.9.17 %global pybasever 3.9 Summary: Version %{version} of the Python interpreter Name: python3 Version: %{version} Release: 1 License: Modified CNRI Open Source License Group: Development/Languages URL: https://www.python.org/ Requires: python%{pybasever} >= %{version} Obsoletes: python3-docs < 3.9.16 %description Python %{version} is an accessible, high-level, dynamically typed, interpreted programming language, designed with an emphasis on code readability. It includes an extensive standard library, and has a vast ecosystem of third-party libraries. The %{name} package provides the python%{version} executable: the reference interpreter for the Python language, version 3 and majority of its standard library. The remaining parts of the Python standard library are broken out into the %{name}-tkinter and %{name}-test packages, which may need to be installed separately. IDLE for Python %{version} is provided in the %{name}-idle package and development files are provided through %{name}-devel package %package devel Summary: Libraries and header files needed for Python development Requires: %{name} = %{version}-%{release} Requires: python%{pybasever}-devel >= %{version} Obsoletes: python3-tools < 3.9.16 %description devel This package contains the header files and configuration needed to compile Python extension modules (typically written in C or C++), to embed Python into other programs, and to make binary distributions for Python libraries. It also contains 2to3 tool, an automatic source converter from Python 2.X. %package idle Summary: A basic graphical development environment for Python Requires: %{name} = %{version}-%{release} Requires: %{name}-tkinter = %{version}-%{release} Requires: python%{pybasever}-idle >= %{version} Obsoletes: python3-tools < 3.9.16 %description idle IDLE is Python's Integrated Development and Learning Environment. IDLE has the following features: Python shell window (interactive interpreter) with colorizing of code input, output, and error messages; multi-window text editor with multiple undo, Python colorizing, smart indent, call tips, auto completion, and other features; search within any window, replace within editor windows, and search through multiple files (grep); debugger with persistent breakpoints, stepping, and viewing of global and local namespaces; configuration, browsers, and other dialogs. %package tkinter Summary: A GUI toolkit for Python Requires: %{name} = %{version}-%{release} Requires: python%{pybasever}-tkinter >= %{version} %description tkinter The Tkinter (Tk interface) library is a graphical user interface toolkit for the Python programming language. %package test Summary: The self-test suite for the main python3 package Requires: %{name} = %{version}-%{release} Requires: python%{pybasever}-test >= %{version} %description test The self-test suite for the Python interpreter. This is only useful to test Python itself. For testing general Python code, you should use the unittest module from %{pkgname}, or a library such as pytest. %prep # NOTHING TO DO %build # NOTHING TO DO %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_libexecdir} mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig mkdir -p $RPM_BUILD_ROOT%{_libdir}64/pkgconfig mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 # create links for binaries (64bit) ( cd $RPM_BUILD_ROOT%{_bindir} ln -sf 2to3-3.9 2to3 ln -sf idle3.9 idle3 ln -sf pydoc3.9 pydoc3 ln -sf python3.9 python3 ln -sf python3.9-config python3-config ) # create links for binaries (32bit) ( cd $RPM_BUILD_ROOT%{_libexecdir} ln -sf 2to3-3.9_32 2to3 ln -sf idle3.9_32 idle3 ln -sf pydoc3.9_32 pydoc3 ln -sf python3.9_32 python3 ln -sf python3.9-config_32 python3-config ) # Create links for pkgconfig files ( cd $RPM_BUILD_ROOT%{_libdir}64/pkgconfig ln -sf python-3.9-embed.pc python3-embed.pc ln -sf python-3.9.pc python3.pc cd $RPM_BUILD_ROOT%{_libdir}/pkgconfig ln -sf python-3.9-embed.pc python3-embed.pc ln -sf python-3.9.pc python3.pc ) # create link for man page ( cd $RPM_BUILD_ROOT%{_mandir}/man1 ln -sf python3.9.1 python3.1 ) %pre if rpm -q dnf >/dev/null; then MSG1="rpm.rte version 4.15.1.1010 or above is required for dnf to work properly with python 3.9.16 or above in AIX 7.1 & AIX 7.2" MSG2="rpm.rte version 4.15.1.2009 or above is required for dnf to work properly with python 3.9.16 or above in AIX 7.3" ver=$(lslpp -Lc rpm.rte 2>/dev/null | /usr/bin/awk 'FNR==2' | /usr/bin/awk -F':' '{print $3}') f1=$(echo $ver | /usr/bin/cut -d"." -f1) f2=$(echo $ver | /usr/bin/cut -d"." -f2) f3=$(echo $ver | /usr/bin/cut -d"." -f3) f4=$(echo $ver | /usr/bin/cut -d"." -f4) if [[ ( $f1 -gt 4 ) || ( $f1 -eq 4 && $f2 -gt 15 ) || ( $f1 -eq 4 && $f2 -eq 15 && $f3 -ge 1 ) ]] then if [[ $f1 -eq 4 && $f2 -eq 15 && $f3 -eq 1 ]] then if [[ $f4 -gt 2008 ]] then exit 0 else oslvl=`/usr/bin/oslevel` if [[ "$oslvl" = "7.3.0.0" ]] then echo $MSG2 exit 1 elif [[ ("$oslvl" = "7.1.0.0" || "$oslvl" = "7.2.0.0") && ($f4 -lt 1010) ]] then echo $MSG1 exit 1 else exit 0 fi fi else exit 0 fi else echo $MSG1 echo $MSG2 exit 1 fi fi %files %defattr(-,root,system) %{_bindir}/pydoc3 %{_bindir}/python3 %{_libexecdir}/pydoc3 %{_libexecdir}/python3 %{_mandir}/man1/python3.1 %files devel %defattr(-,root,system) %{_bindir}/2to3 %{_libexecdir}/2to3 %{_bindir}/python3-config %{_libexecdir}/python3-config %{_libdir}64/pkgconfig/python3-embed.pc %{_libdir}64/pkgconfig/python3.pc %{_libdir}/pkgconfig/python3-embed.pc %{_libdir}/pkgconfig/python3.pc %files idle %defattr(-,root,system) %{_bindir}/idle3 %{_libexecdir}/idle3 %files test %defattr(-,root,system) %files tkinter %defattr(-,root,system) %changelog * Wed Jul 05 2023 Ayappan P - 3.9.17-1 - Update to 3.9.17 * Fri Jun 16 2023 Ayappan P - 3.9.16-2 - Fix wrong symlinks in /opt/freeware/libexec * Mon Mar 06 2023 Ayappan P - 3.9.16-1 - Python 3.9.16 Meta package