mirror of
https://abf.rosa.ru/djam/python38.git
synced 2025-02-23 15:22:50 +00:00
package py38 rosa20190*
This commit is contained in:
parent
5a68c7538c
commit
be43238462
1 changed files with 93 additions and 22 deletions
115
python3.spec
115
python3.spec
|
@ -3,9 +3,9 @@
|
||||||
%define familyver 3
|
%define familyver 3
|
||||||
|
|
||||||
%define lib_major %{dirver}
|
%define lib_major %{dirver}
|
||||||
%define lib_name_orig libpython%{familyver}
|
%define lib_name_orig libpython%{sub_ver}
|
||||||
%define lib_name %mklibname python %{lib_major}
|
%define lib_name %mklibname python %{lib_major}
|
||||||
%define develname %mklibname python3 -d
|
%define develname %mklibname python%{sub_ver} -d
|
||||||
|
|
||||||
%ifarch %{ix86} x86_64 ppc
|
%ifarch %{ix86} x86_64 ppc
|
||||||
%bcond_with valgrind
|
%bcond_with valgrind
|
||||||
|
@ -15,6 +15,24 @@
|
||||||
|
|
||||||
%bcond_without rewheel
|
%bcond_without rewheel
|
||||||
|
|
||||||
|
####### python38 rosa201905 ###############
|
||||||
|
|
||||||
|
%bcond_without py38
|
||||||
|
|
||||||
|
%if %{with py38}
|
||||||
|
%define py3_name python38
|
||||||
|
%else
|
||||||
|
%define py3_name python3
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with py38}
|
||||||
|
%define sub_ver 38
|
||||||
|
%else
|
||||||
|
%define sub_ver %{familyver}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
###########################################
|
||||||
|
|
||||||
# We want to byte-compile the .py files within the packages using the new
|
# We want to byte-compile the .py files within the packages using the new
|
||||||
# python3 binary.
|
# python3 binary.
|
||||||
#
|
#
|
||||||
|
@ -31,7 +49,7 @@
|
||||||
%define _python_bytecompile_build 0
|
%define _python_bytecompile_build 0
|
||||||
|
|
||||||
Summary: An interpreted, interactive object-oriented programming language
|
Summary: An interpreted, interactive object-oriented programming language
|
||||||
Name: python3
|
Name: %{py3_name}
|
||||||
Version: 3.8.2
|
Version: 3.8.2
|
||||||
Release: 1
|
Release: 1
|
||||||
License: Modified CNRI Open Source License
|
License: Modified CNRI Open Source License
|
||||||
|
@ -41,7 +59,7 @@ Source0: https://www.python.org/ftp/python/%{version}/Python-%{version}.
|
||||||
Source1: https://docs.python.org/3/archives/python-%{docver}-docs-html.tar.bz2
|
Source1: https://docs.python.org/3/archives/python-%{docver}-docs-html.tar.bz2
|
||||||
Source2: python3.macros
|
Source2: python3.macros
|
||||||
Source3: pybytecompile.macros
|
Source3: pybytecompile.macros
|
||||||
Source100: %{name}.rpmlintrc
|
Source100: python3.rpmlintrc
|
||||||
|
|
||||||
# 00001 #
|
# 00001 #
|
||||||
# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
|
# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
|
||||||
|
@ -131,9 +149,11 @@ BuildRequires: python3-pip
|
||||||
Provides: python(abi) = %{dirver}
|
Provides: python(abi) = %{dirver}
|
||||||
Provides: /usr/bin/python%{dirver}m
|
Provides: /usr/bin/python%{dirver}m
|
||||||
Provides: /usr/bin/python%{dirver}
|
Provides: /usr/bin/python%{dirver}
|
||||||
|
%if %{without py38}
|
||||||
Provides: /usr/bin/python
|
Provides: /usr/bin/python
|
||||||
Provides: /usr/bin/python%{familyver}
|
Provides: /usr/bin/python%{familyver}
|
||||||
Provides: python = %{version}-%{release}
|
Provides: python = %{version}-%{release}
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Python is an interpreted, interactive, object-oriented programming
|
Python is an interpreted, interactive, object-oriented programming
|
||||||
|
@ -197,26 +217,26 @@ in ASCII text files and in LaTeX source files.
|
||||||
Install the python-docs package if you'd like to use the documentation
|
Install the python-docs package if you'd like to use the documentation
|
||||||
for the Python language.
|
for the Python language.
|
||||||
|
|
||||||
%package -n tkinter3
|
%package -n tkinter%{sub_ver}
|
||||||
Summary: A graphical user interface for the Python scripting language
|
Summary: A graphical user interface for the Python scripting language
|
||||||
Group: Development/Python
|
Group: Development/Python
|
||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}
|
||||||
Requires: tcl tk
|
Requires: tcl tk
|
||||||
Provides: python3-tkinter
|
Provides: python%{sub_ver}-tkinter
|
||||||
|
|
||||||
%description -n tkinter3
|
%description -n tkinter%{sub_ver}
|
||||||
The Tkinter (Tk interface) program is an graphical user interface for
|
The Tkinter (Tk interface) program is an graphical user interface for
|
||||||
the Python scripting language.
|
the Python scripting language.
|
||||||
|
|
||||||
You should install the tkinter package if you'd like to use a graphical
|
You should install the tkinter package if you'd like to use a graphical
|
||||||
user interface for Python programming.
|
user interface for Python programming.
|
||||||
|
|
||||||
%package -n tkinter3-apps
|
%package -n tkinter%{sub_ver}-apps
|
||||||
Summary: Various applications written using tkinter
|
Summary: Various applications written using tkinter
|
||||||
Group: Development/Python
|
Group: Development/Python
|
||||||
Requires: tkinter3
|
Requires: tkinter%{sub_ver}
|
||||||
|
|
||||||
%description -n tkinter3-apps
|
%description -n tkinter%{sub_ver}-apps
|
||||||
Various applications written using tkinter
|
Various applications written using tkinter
|
||||||
|
|
||||||
|
|
||||||
|
@ -321,7 +341,6 @@ ln -sf python%{dirver} python%{familyver}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
(cd %{buildroot}%{_libdir}; ln -sf `ls libpython%{lib_major}*.so.*` libpython%{lib_major}.so)
|
(cd %{buildroot}%{_libdir}; ln -sf `ls libpython%{lib_major}*.so.*` libpython%{lib_major}.so)
|
||||||
|
|
||||||
# install pynche as pynche3
|
# install pynche as pynche3
|
||||||
cat << EOF > %{buildroot}%{_bindir}/pynche3
|
cat << EOF > %{buildroot}%{_bindir}/pynche3
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
@ -339,13 +358,13 @@ install Misc/valgrind-python.supp -D %{buildroot}%{_libdir}/valgrind/valgrind-py
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_datadir}/applications
|
mkdir -p %{buildroot}%{_datadir}/applications
|
||||||
cat > %{buildroot}%{_datadir}/applications/rosa-tkinter3.desktop << EOF
|
cat > %{buildroot}%{_datadir}/applications/rosa-tkinter%{sub_ver}.desktop << EOF
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=IDLE
|
Name=IDLE
|
||||||
Name[ru]=IDLE
|
Name[ru]=IDLE
|
||||||
Comment=IDE for Python3
|
Comment=IDE for Python3
|
||||||
Comment[ru]=IDE для Python3
|
Comment[ru]=IDE для Python3
|
||||||
Exec=%{_bindir}/idle3
|
Exec=%{_bindir}/idle%{dirver}
|
||||||
Icon=development_environment_section
|
Icon=development_environment_section
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
|
@ -372,8 +391,9 @@ find %{buildroot} -type f \( -name "test_binascii.py*" -o -name "test_grp.py*" -
|
||||||
# fix python library not stripped
|
# fix python library not stripped
|
||||||
chmod u+w %{buildroot}%{_libdir}/libpython%{lib_major}*.so.1.0 %{buildroot}%{_libdir}/libpython3.so
|
chmod u+w %{buildroot}%{_libdir}/libpython%{lib_major}*.so.1.0 %{buildroot}%{_libdir}/libpython3.so
|
||||||
|
|
||||||
|
%if %{without py38}
|
||||||
%install_macro python3 %{SOURCE2}
|
%install_macro python3 %{SOURCE2}
|
||||||
|
%endif
|
||||||
%install_macro pybytecompile %{SOURCE3}
|
%install_macro pybytecompile %{SOURCE3}
|
||||||
|
|
||||||
ln -s python3 %{buildroot}%{_bindir}/python
|
ln -s python3 %{buildroot}%{_bindir}/python
|
||||||
|
@ -384,6 +404,36 @@ ln -s python3-config %{buildroot}%{_bindir}/python-config
|
||||||
# See https://github.com/fedora-python/python-rpm-porting/issues/24
|
# See https://github.com/fedora-python/python-rpm-porting/issues/24
|
||||||
cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/
|
cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/
|
||||||
|
|
||||||
|
%if %{with py38}
|
||||||
|
mv %{buildroot}%{_bindir}/pynche3 \
|
||||||
|
%{buildroot}%{_bindir}/pynche%{sub_ver}
|
||||||
|
|
||||||
|
# Remove shebang lines from .py files that aren't executable, and
|
||||||
|
# remove executability from .py files that don't have a shebang line:
|
||||||
|
find %{buildroot} -name \*.py \
|
||||||
|
\( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \
|
||||||
|
-print -exec sed -i '1d' {} \; \) -o \( \
|
||||||
|
-perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \
|
||||||
|
-exec chmod a-x {} \; \) \)
|
||||||
|
|
||||||
|
########## shebang py3 > py3.8 ##################
|
||||||
|
|
||||||
|
find %{buildroot} -type f -print | while read -r line ; do
|
||||||
|
if file "$line" | grep -q ELF ; then continue ; fi
|
||||||
|
if head -n 1 "$line" | grep -v python3.8 | grep -q python3 ; then
|
||||||
|
sed -i -e '1s,python3,python3.8,g' "$line"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
### warning!!! replaced only python3 with python3.8, macros are still the same ###
|
||||||
|
%if %{mdvver} > 20190
|
||||||
|
cp -fr %{S:2} %{buildroot}%{_rpmmacrodir}/python38.macros
|
||||||
|
%else
|
||||||
|
cp -fr %{S:2} %{buildroot}%{_rpmmacrodir}/macros.python38
|
||||||
|
%endif
|
||||||
|
sed -i -e "1s|/usr/bin/python3|/usr/bin/python3.8|" %{buildroot}%{_rpmmacrodir}/*python38*
|
||||||
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# (misc) if the home is nfs mounted, rmdir fails
|
# (misc) if the home is nfs mounted, rmdir fails
|
||||||
export TMP="/tmp" TMPDIR="/tmp"
|
export TMP="/tmp" TMPDIR="/tmp"
|
||||||
|
@ -439,13 +489,23 @@ export TMP="/tmp" TMPDIR="/tmp"
|
||||||
%{_bindir}/pathfix.py
|
%{_bindir}/pathfix.py
|
||||||
%{_bindir}/pydoc3*
|
%{_bindir}/pydoc3*
|
||||||
%{_bindir}/python3*
|
%{_bindir}/python3*
|
||||||
%{_bindir}/pydoc
|
%if %{with py38}
|
||||||
%{_bindir}/python
|
%exclude %{_bindir}/pydoc
|
||||||
|
%exclude %{_bindir}/pydoc3
|
||||||
|
%exclude %{_bindir}/python
|
||||||
|
%exclude %{_bindir}/python3
|
||||||
|
%exclude %{_bindir}/2to3
|
||||||
|
%else
|
||||||
%{_bindir}/2to3
|
%{_bindir}/2to3
|
||||||
|
%endif
|
||||||
%{_bindir}/2to3-%{dirver}
|
%{_bindir}/2to3-%{dirver}
|
||||||
# do not exclude it
|
# do not exclude it
|
||||||
# requires by systemtap
|
# requires by systemtap
|
||||||
|
%if %{with py38}
|
||||||
|
%exclude %{_bindir}/python*config
|
||||||
|
%else
|
||||||
%{_bindir}/python*config
|
%{_bindir}/python*config
|
||||||
|
%endif
|
||||||
#%{_datadir}/emacs/site-lisp/*
|
#%{_datadir}/emacs/site-lisp/*
|
||||||
%{_mandir}/man*/*
|
%{_mandir}/man*/*
|
||||||
%if %{with valgrind}
|
%if %{with valgrind}
|
||||||
|
@ -456,13 +516,19 @@ export TMP="/tmp" TMPDIR="/tmp"
|
||||||
%{_libdir}/libpython*.so.1*
|
%{_libdir}/libpython*.so.1*
|
||||||
|
|
||||||
%files -n %{develname}
|
%files -n %{develname}
|
||||||
|
%if %{with py38}
|
||||||
|
%exclude %{_libdir}/libpython3.so
|
||||||
|
%exclude %{_libdir}/pkgconfig/python3.pc
|
||||||
|
%endif
|
||||||
%{_libdir}/libpython*.so
|
%{_libdir}/libpython*.so
|
||||||
|
%{_libdir}/pkgconfig/python*.pc
|
||||||
%{_includedir}/python*
|
%{_includedir}/python*
|
||||||
%{_libdir}/python*/config-*
|
%{_libdir}/python*/config-*
|
||||||
%{_libdir}/python*/test/
|
|
||||||
%{_bindir}/python%{dirver}*-config
|
%{_bindir}/python%{dirver}*-config
|
||||||
|
%if %{without py38}
|
||||||
%{_bindir}/python%{familyver}-config
|
%{_bindir}/python%{familyver}-config
|
||||||
%{_libdir}/pkgconfig/python*.pc
|
%endif
|
||||||
|
%{_libdir}/python*/test/
|
||||||
#%{_libdir}/python*/config-*
|
#%{_libdir}/python*/config-*
|
||||||
%exclude %{_includedir}/python*/pyconfig.h
|
%exclude %{_includedir}/python*/pyconfig.h
|
||||||
%exclude %{_libdir}/python*/config*/Makefile
|
%exclude %{_libdir}/python*/config*/Makefile
|
||||||
|
@ -471,13 +537,18 @@ export TMP="/tmp" TMPDIR="/tmp"
|
||||||
%doc html/*/*
|
%doc html/*/*
|
||||||
%{_datadir}/applications/rosa-%{name}-docs.desktop
|
%{_datadir}/applications/rosa-%{name}-docs.desktop
|
||||||
|
|
||||||
%files -n tkinter3
|
%files -n tkinter%{sub_ver}
|
||||||
%{_libdir}/python*/tkinter/
|
%{_libdir}/python*/tkinter/
|
||||||
%{_libdir}/python*/idlelib
|
%{_libdir}/python*/idlelib
|
||||||
%{_libdir}/python*/site-packages/pynche
|
%{_libdir}/python*/site-packages/pynche
|
||||||
%{_libdir}/python*/lib-dynload/_tkinter.*.so
|
%{_libdir}/python*/lib-dynload/_tkinter.*.so
|
||||||
|
|
||||||
%files -n tkinter3-apps
|
%files -n tkinter%{sub_ver}-apps
|
||||||
|
%if %{with py38}
|
||||||
|
%exclude %{_bindir}/idle3
|
||||||
|
%endif
|
||||||
%{_bindir}/idle3*
|
%{_bindir}/idle3*
|
||||||
%{_bindir}/pynche3
|
%{_bindir}/pynche%{sub_ver}
|
||||||
%{_datadir}/applications/rosa-tkinter3.desktop
|
%{_datadir}/applications/rosa-tkinter%{sub_ver}.desktop
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue