Compare commits

...

8 Commits

Author SHA1 Message Date
Tomas Orsava 0411091b2f Remove empty lines to fix multiline bash expression 2017-08-02 17:05:26 +02:00
Tomas Orsava e936b4b58f Add bcond for optimizations 2017-08-02 16:16:36 +02:00
Tomas Orsava 3cf18aa55e Switch 3 macros to bcond's
%with_rewheel -> rewheel
%with_debug_build -> debug_build
%run_selftest_suite -> tests
2017-08-02 15:30:21 +02:00
Tomas Orsava b726831413 Add debug print 2017-08-02 10:54:29 +02:00
Tomas Orsava 17520a5b34 Disabled test_resource as test_prlimit currently fails when building in mock 2017-08-02 10:11:47 +02:00
Tomas Orsava c0e8897305 Remove dependency on `db4-devel`
It was only needed for the psddb module that was removed in Python 3
2017-08-01 15:07:08 +02:00
Tomas Orsava de728c7f36 Disabled the dependency on `libappstream-glib`
for Python 3 in the Python 3 module as it is not packaged in the Platform or
any module yet, and has too many dependencies to be packaged in the Python 3
module.
2017-08-01 10:46:01 +02:00
Tomas Orsava f77700c102 Making a bootstrapping commit for the python3 module 2017-07-31 17:23:36 +02:00
1 changed files with 53 additions and 31 deletions

View File

@ -34,7 +34,7 @@
# rebuild after a python abi change:
# python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt
%global with_rewheel 1
%bcond_without rewheel
%global pybasever 3.6
@ -85,7 +85,8 @@
%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION}
%global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION}
%global with_debug_build 1
%bcond_without debug_build
%bcond_without optimizations
%global with_gdb_hooks 1
@ -103,8 +104,7 @@
# Change from yes to no to turn this off
%global with_computed_gotos yes
# Turn this to 0 to turn off the "check" phase:
%global run_selftest_suite 1
%bcond_without tests
# We want to byte-compile the .py files within the packages using the new
# python3 binary.
@ -133,7 +133,7 @@
Summary: Version 3 of the Python programming language aka Python 3000
Name: python3
Version: %{pybasever}.2
Release: 4%{?dist}
Release: 0%{?dist}
License: Python
Group: Development/Languages
@ -148,7 +148,6 @@ BuildRequires: autoconf
BuildRequires: bluez-libs-devel
BuildRequires: bzip2
BuildRequires: bzip2-devel
BuildRequires: db4-devel >= 4.7
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
# it (in pyexpat) in order to enable the fix in Python-3.2.3 for CVE-2012-0876:
@ -172,7 +171,10 @@ BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: sqlite-devel
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
# Disabled the dependency on `libappstream-glib` for Python 3 in the Python 3
# module as it is not packaged in the Platform or any module yet, and has too
# many dependencies to be packaged in the Python 3 module.
# BuildRequires: libappstream-glib
BuildRequires: systemtap-sdt-devel
BuildRequires: systemtap-devel
@ -192,7 +194,7 @@ BuildRequires: valgrind-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel
%if 0%{?with_rewheel}
%if %{with rewheel}
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%endif
@ -484,7 +486,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Obsoletes: python%{pyshortver}
Provides: python%{pyshortver} = %{version}-%{release}
%if 0%{with_rewheel}
%if %{with rewheel}
Requires: python3-setuptools
Requires: python3-pip
%endif
@ -608,7 +610,7 @@ in production.
You might want to install the python3-test package if you're developing
python code that uses more than just unittest and/or test_support.py.
%if 0%{?with_debug_build}
%if %{with debug_build}
%package debug
Summary: Debug version of the Python runtime
Group: Applications/System
@ -639,7 +641,7 @@ It shares installation directories with the standard Python runtime, so that
.py and .pyc files can be shared. All compiled extension modules gain a "_d"
suffix ("foo_d.so" rather than "foo.so") so that each Python implementation
can load its own extensions.
%endif # with_debug_build
%endif # with debug_build
# ======================================================
# The prep phase of the build:
@ -675,7 +677,7 @@ rm -r Modules/zlib || exit 1
# rm Modules/$f
#done
%if 0%{with_rewheel}
%if %{with rewheel}
%global pip_version 9.0.1
sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py
%endif
@ -707,7 +709,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en
%patch186 -p1
%patch188 -p1
%if 0%{with_rewheel}
%if %{with rewheel}
%patch189 -p1
%endif
@ -742,6 +744,13 @@ sed --in-place \
# ======================================================
%build
echo "=================== DEBUG PRINT: values of macros ==================="
echo "with rewheel: %{with rewheel}"
echo "with tests: %{with tests}"
echo "with debug_build: %{with debug_build}"
echo "with optimizations: %{with optimizations}"
echo "================= END DEBUG PRINT: values of macros ================="
topdir=$(pwd)
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
@ -808,7 +817,7 @@ BuildPython() {
# Use "BuildPython" to support building with different configurations:
%if 0%{?with_debug_build}
%if %{with debug_build}
BuildPython debug \
python-debug \
python%{pybasever}-debug \
@ -819,13 +828,17 @@ BuildPython debug \
%endif
false \
-O0
%endif # with_debug_build
%endif # with debug_build
BuildPython optimized \
python \
python%{pybasever} \
%ifarch %{ix86} x86_64
%if %{with optimizations}
"--without-ensurepip --enable-optimizations" \
%else
"--without-ensurepip" \
%endif
%else
"--without-ensurepip" \
%endif
@ -894,11 +907,11 @@ make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags
# Use "InstallPython" to support building with different configurations:
# Install the "debug" build first, so that we can move some files aside
%if 0%{?with_debug_build}
%if %{with debug_build}
InstallPython debug \
%{py_INSTSONAME_debug} \
-O0
%endif # with_debug_build
%endif # with debug_build
# Now the optimized build:
InstallPython optimized \
@ -917,7 +930,10 @@ desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE10}
# Install and validate appdata file
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/appdata
cp -a %{SOURCE11} ${RPM_BUILD_ROOT}%{_datadir}/appdata
appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/appdata/idle3.appdata.xml
# Disabled the usa of `appstream-util` for Python 3 in the Python 3 module,
# as `libappstream-glib` is not packaged in the Platform or any module yet, and
# has too many dependencies to be packaged in the Python 3 module.
# appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/appdata/idle3.appdata.xml
# Development tools
install -m755 -d ${RPM_BUILD_ROOT}%{pylibdir}/Tools
@ -961,7 +977,7 @@ install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/
%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu}
%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux%{_gnu}
%if 0%{?with_debug_build}
%if %{with debug_build}
%global PyIncludeDirs python%{LDVERSION_optimized} python%{LDVERSION_debug}
%else
@ -1086,7 +1102,7 @@ done
# Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to
# avoid the user having to know the precise version and ABI flags. (see
# e.g. rhbz#676748):
%if 0%{?with_debug_build}
%if %{with debug_build}
ln -s \
%{_bindir}/python%{LDVERSION_debug} \
%{buildroot}%{_bindir}/python3-debug
@ -1112,7 +1128,7 @@ sed \
%{_sourcedir}/libpython.stp \
> %{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
%if 0%{?with_debug_build}
%if %{with debug_build}
# In Python 3, python3 and python3-debug don't point to the same binary,
# so we have to replace "python3" with "python3-debug" to get systemtap
# working with debug build
@ -1121,7 +1137,7 @@ sed \
-e 's|"python3"|"python3-debug"|' \
%{_sourcedir}/libpython.stp \
> %{buildroot}%{tapsetdir}/%{libpython_stp_debug}
%endif # with_debug_build
%endif # with debug_build
%endif # with_systemtap
@ -1133,7 +1149,7 @@ echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname
%{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config
chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config
%if 0%{?with_debug_build}
%if %{with debug_build}
# Rename the -debug script that differs on different arches to arch specific name
mv %{buildroot}%{_bindir}/python%{LDVERSION_debug}-{,`uname -m`-}config
echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_debug}-`uname -m`-config "$@"' > \
@ -1141,7 +1157,7 @@ echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_debug}-`uname -m`-config
echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_debug}-`uname -m`-config. Look around to see available arches." >&2' >> \
%{buildroot}%{_bindir}/python%{LDVERSION_debug}-config
chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config
%endif # with_debug_build
%endif # with debug_build
# System Python: Copy the executable to libexec
mkdir -p %{buildroot}%{_libexecdir}
@ -1182,10 +1198,12 @@ CheckPython() {
# @unittest._expectedFailureInRpmBuild
# test_faulthandler.test_register_chain currently fails on ppc64le and
# aarch64, see upstream bug http://bugs.python.org/issue21131
# test_resource.test_prlimit currently fails when building in mock
WITHIN_PYTHON_RPM_BUILD= \
LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
-wW --slowest --findleaks \
-x test_distutils \
-x test_resource \
%ifarch ppc64le aarch64
-x test_faulthandler \
%endif
@ -1200,15 +1218,15 @@ CheckPython() {
}
%if 0%{run_selftest_suite}
%if %{with tests}
# Check each of the configurations:
%if 0%{?with_debug_build}
%if %{with debug_build}
CheckPython debug
%endif # with_debug_build
%endif # with debug_build
CheckPython optimized
%endif # run_selftest_suite
%endif # with tests
# ======================================================
@ -1288,7 +1306,7 @@ fi
%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes}
%exclude %{pylibdir}/ensurepip/_bundled
%if 0%{?with_rewheel}
%if %{with rewheel}
%dir %{pylibdir}/ensurepip/rewheel/
%dir %{pylibdir}/ensurepip/rewheel/__pycache__/
%{pylibdir}/ensurepip/rewheel/*.py
@ -1556,7 +1574,7 @@ fi
# Hence the manifest is the combination of analogous files in the manifests of
# all of the other subpackages
%if 0%{?with_debug_build}
%if %{with debug_build}
%files debug
%defattr(-,root,root,-)
@ -1666,7 +1684,7 @@ fi
%{dynload_dir}/_testcapi.%{SOABI_debug}.so
%{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so
%endif # with_debug_build
%endif # with debug_build
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
# ldconfig (rhbz:562980).
@ -1689,6 +1707,10 @@ fi
# ======================================================
%changelog
* Mon Jul 31 2017 Tomas Orsava <torsava@redhat.com> - 3.6.2-0
- Making a bootstrapping commit for the python3 module
- Purpusefully antedating the Release tag to be lower than the master branch
* Sun Jul 30 2017 Florian Weimer <fweimer@redhat.com> - 3.6.2-4
- Do not generate debuginfo subpackages (#1476593)
- Rebuild with binutils fix for ppc64le (#1475636)