|
@@ -1,20 +1,25 @@
|
|
|
%bcond_with run_test
|
|
|
|
|
|
-%define libvers 3.8
|
|
|
-%define binsuffix 3.8
|
|
|
-%define python_lib %{_libdir}/python%{libvers}
|
|
|
%define config_htmldir /var/www/html/python
|
|
|
Summary: An interpreted, interactive, object-oriented programming language.
|
|
|
Summary(ja): オブジェクト指向 Python3 インタプリタ
|
|
|
Name: python3
|
|
|
-Version: 3.8.7
|
|
|
-Release: 1%{?_dist_release}
|
|
|
+Version: 3.8.8
|
|
|
+Release: 2%{?_dist_release}
|
|
|
Group: programming
|
|
|
Vendor: Project Vine
|
|
|
Distribution: Vine Linux
|
|
|
|
|
|
License: Python
|
|
|
URL: http://www.python.org/download/releases/%{version}
|
|
|
+
|
|
|
+%define majorver %(echo %{version} | cut -d . -f 1)
|
|
|
+%define libvers %(echo %{version} | cut -d . -f 1-2)
|
|
|
+%define binsuffix %{libvers}
|
|
|
+%define python_lib %{_libdir}/python%{libvers}
|
|
|
+%global py_SOVERSION 1.0
|
|
|
+%global py_INSTSONAME libpython%{libvers}.so.%{py_SOVERSION}
|
|
|
+
|
|
|
Source0: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
|
|
|
Source1: https://docs.python.org/ftp/python/doc/%{version}/python-%{version}-docs-html.tar.bz2
|
|
|
# (Patches taken from github.com/fedora-python/cpython)
|
|
@@ -83,7 +88,7 @@ Patch274: 00274-fix-arch-names.patch
|
|
|
Patch328: 00328-pyc-timestamp-invalidation-mode.patch
|
|
|
|
|
|
# security
|
|
|
-Patch1000: CVE-2021-3177.patch
|
|
|
+# (none)
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
BuildRequires: autoconf
|
|
@@ -212,7 +217,7 @@ rm Lib/ensurepip/_bundled/*.whl
|
|
|
%patch328 -p1
|
|
|
|
|
|
# security
|
|
|
-%patch1000 -p1
|
|
|
+# (none)
|
|
|
|
|
|
# Remove files that should be generated by the build
|
|
|
# (This is after patching, so that we can use patches directly from upstream)
|
|
@@ -281,7 +286,41 @@ echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}
|
|
|
echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
|
|
|
echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
|
|
|
chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
|
|
|
-cp -a Tools $RPM_BUILD_ROOT%{python_lib}
|
|
|
+#cp -a Tools $RPM_BUILD_ROOT%{python_lib}
|
|
|
+mkdir -p %{buildroot}%{_prefix}/lib/debug%{_libdir}
|
|
|
+cp -f Tools/gdb/libpython.py %{buildroot}%{_prefix}/lib/debug%{_libdir}/%{py_INSTSONAME}-%{version}-%{release}.%{_arch}.debug-gdb.py
|
|
|
+
|
|
|
+# Install pathfix.py to bindir
|
|
|
+# See https://github.com/fedora-python/python-rpm-porting/issues/24
|
|
|
+cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/pathfix%{binsuffix}.py
|
|
|
+
|
|
|
+# Install i18n tools to bindir
|
|
|
+# They are also in python2, so we version them
|
|
|
+# https://bugzilla.redhat.com/show_bug.cgi?id=1571474
|
|
|
+for tool in pygettext msgfmt; do
|
|
|
+ cp -p Tools/i18n/${tool}.py %{buildroot}%{_bindir}/${tool}%{binsuffix}.py
|
|
|
+ ln -s ${tool}%{binsuffix}.py %{buildroot}%{_bindir}/${tool}3.py
|
|
|
+done
|
|
|
+
|
|
|
+# Switch all shebangs to refer to the specific Python version.
|
|
|
+# This currently only covers files matching ^[a-zA-Z0-9_]+\.py$,
|
|
|
+# so handle files named using other naming scheme separately.
|
|
|
+LD_LIBRARY_PATH=./ ./python \
|
|
|
+ Tools/scripts/pathfix.py \
|
|
|
+ -i "%{_bindir}/python%{binsuffix}" -pn \
|
|
|
+ %{buildroot} \
|
|
|
+ %{buildroot}%{_bindir}/{2to3-,idle,pydoc}%{binsuffix} \
|
|
|
+ %{buildroot}%{_bindir}/*%{binsuffix}.py \
|
|
|
+ %{buildroot}%{_libdir}/python%{binsuffix}/cgi.py \
|
|
|
+ %{buildroot}%{_prefix}/lib/debug%{_libdir}/*.py
|
|
|
+
|
|
|
+# 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 {} \; \) \)
|
|
|
|
|
|
# make file lists
|
|
|
rm -f mainpkg.files
|
|
@@ -291,25 +330,34 @@ find "$RPM_BUILD_ROOT"%{python_lib} -type f |
|
|
|
-e '/python%{libvers}/config$' \
|
|
|
-e '_tkinter.so$' \
|
|
|
-e '_tkinter.cpython-' \
|
|
|
+ -e '/tkinter/' \
|
|
|
+ -e '/turtledemo/' \
|
|
|
+ -e '/idlelib/' \
|
|
|
>> mainpkg.files
|
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3
|
|
|
find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l |
|
|
|
sed "s|^${RPM_BUILD_ROOT}|/|" |
|
|
|
- grep -v -e '/bin/2to3%{binsuffix}$' |
|
|
|
- grep -v -e '/bin/pydoc%{binsuffix}$' |
|
|
|
- grep -v -e '/bin/smtpd.py%{binsuffix}$' |
|
|
|
- grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files
|
|
|
-
|
|
|
+ grep -v \
|
|
|
+ -e '/idlelib/' \
|
|
|
+ -e '/bin/2to3-%{binsuffix}$' \
|
|
|
+ -e '/bin/msgfmt%{binsuffix}.py' \
|
|
|
+ -e '/bin/pathfix%{binsuffix}.py' \
|
|
|
+ -e '/bin/pygettext%{binsuffix}.py' \
|
|
|
+ -e '/bin/pydoc%{binsuffix}$' \
|
|
|
+ -e '/bin/pydoc%{majorver}$' \
|
|
|
+ -e '/bin/idle%{binsuffix}$' \
|
|
|
+ -e '/bin/idle%{majorver}$' \
|
|
|
+ >> mainpkg.files
|
|
|
|
|
|
rm -f tools.files
|
|
|
find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \
|
|
|
- "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f |
|
|
|
+ -type f |
|
|
|
sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
|
|
|
-echo %{_bindir}/2to3-%{binsuffix} >> tools.files
|
|
|
echo %{_bindir}/pydoc%{binsuffix} >> tools.files
|
|
|
-##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files
|
|
|
+echo %{_bindir}/pydoc%{majorver} >> tools.files
|
|
|
echo %{_bindir}/idle%{binsuffix} >> tools.files
|
|
|
+echo %{_bindir}/idle%{majorver} >> tools.files
|
|
|
|
|
|
# docs
|
|
|
mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
|
|
@@ -318,37 +366,6 @@ mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
|
|
|
bunzip2 < %{SOURCE1} | tar x
|
|
|
)
|
|
|
|
|
|
-# fix the #! line in installed files
|
|
|
-find "$RPM_BUILD_ROOT" -type f -print0 |
|
|
|
- xargs -0 grep -l /usr/local/bin/python | while read file
|
|
|
-do
|
|
|
- FIXFILE="$file"
|
|
|
- sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \
|
|
|
- "$FIXFILE" >/tmp/fix-python-path.$$
|
|
|
- cat /tmp/fix-python-path.$$ > "$FIXFILE"
|
|
|
- rm -f /tmp/fix-python-path.$$
|
|
|
-done
|
|
|
-
|
|
|
-# check to see if there are any straggling #! lines
|
|
|
-find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
|
|
|
- | grep ':1:#!' >/tmp/python-rpm-files.$$ || true
|
|
|
-if [ -s /tmp/python-rpm-files.$$ ]
|
|
|
-then
|
|
|
- echo '*****************************************************'
|
|
|
- cat /tmp/python-rpm-files.$$
|
|
|
- cat <<@EOF
|
|
|
- *****************************************************
|
|
|
- There are still files referencing /usr/local/bin/python in the
|
|
|
- install directory. They are listed above. Please fix the .spec
|
|
|
- file and try again. If you are an end-user, you probably want
|
|
|
- to report this to jafo-rpms@tummy.com as well.
|
|
|
- *****************************************************
|
|
|
-@EOF
|
|
|
- rm -f /tmp/python-rpm-files.$$
|
|
|
- exit 1
|
|
|
-fi
|
|
|
-rm -f /tmp/python-rpm-files.$$
|
|
|
-
|
|
|
|
|
|
%if %{with run_test}
|
|
|
%check
|
|
@@ -375,6 +392,10 @@ rm -fr $RPM_BUILD_ROOT
|
|
|
|
|
|
%files devel
|
|
|
%defattr(-,root,root)
|
|
|
+%{_bindir}/2to3-%{binsuffix}
|
|
|
+%{_bindir}/msgfmt%{binsuffix}.py
|
|
|
+%{_bindir}/pathfix%{binsuffix}.py
|
|
|
+%{_bindir}/pygettext%{binsuffix}.py
|
|
|
%dir %{_includedir}/python%{libvers}
|
|
|
%dir %{_includedir}/python%{libvers}/cpython
|
|
|
%dir %{_includedir}/python%{libvers}/internal
|
|
@@ -382,13 +403,16 @@ rm -fr $RPM_BUILD_ROOT
|
|
|
%{_includedir}/python%{libvers}/cpython/*.h
|
|
|
%{_includedir}/python%{libvers}/internal/*.h
|
|
|
%{_libdir}/pkgconfig/*.pc
|
|
|
+%{_prefix}/lib/debug%{_libdir}/*.py
|
|
|
|
|
|
%files -f tools.files tools
|
|
|
%defattr(-,root,root)
|
|
|
|
|
|
%files tkinter
|
|
|
%defattr(-,root,root)
|
|
|
+%{python_lib}/__pycache__/turtle.*
|
|
|
%{python_lib}/tkinter
|
|
|
+%{python_lib}/turtledemo
|
|
|
%{python_lib}/lib-dynload/_tkinter.*.so*
|
|
|
|
|
|
%files docs
|
|
@@ -397,6 +421,13 @@ rm -fr $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Sat Feb 27 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.8-2
|
|
|
+- fixed %%files.
|
|
|
+
|
|
|
+* Sat Feb 27 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.8-1
|
|
|
+- new upstream release.
|
|
|
+- dropped Patch1000: fixed in upstream.
|
|
|
+
|
|
|
* Wed Feb 03 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.7-1
|
|
|
- new upstream release.
|
|
|
- dropped Patch1000: fixed in upstream.
|