Support qemu accel sandbox/hyokeun/qemu-test
authorHyokeun Jeon <hyokeun.jeon@samsung.com>
Mon, 8 Feb 2021 02:11:34 +0000 (11:11 +0900)
committerHyokeun Jeon <hyokeun.jeon@samsung.com>
Mon, 8 Feb 2021 02:11:34 +0000 (11:11 +0900)
packaging/python3-base.spec
packaging/python3.spec [deleted file]

index db89c9d7dd27e9f46988b7100e070e8608519130..23c24042bce2edeb811970c67eaaafc970a7c31a 100644 (file)
@@ -156,6 +156,14 @@ BuildRequires:  timezone
 BuildRequires:  xz
 # /SECTION
 
+# To speed up builds with native binaries.
+%ifarch armv7l
+BuildRequires: python-accel-armv7l
+%endif
+%ifarch aarch64
+BuildRequires: python-accel-aarch64
+%endif
+
 
 %description
 Python is an interpreted, object-oriented programming language, and is
diff --git a/packaging/python3.spec b/packaging/python3.spec
deleted file mode 100644 (file)
index abb714f..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-#
-# spec file for package python3
-#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
-#
-# All modifications and additions to the file contributed by third parties
-# remain the property of their copyright owners, unless otherwise agreed
-# upon. The license for this file, and modifications and additions to the
-# file, is the same license as for the pristine package itself (unless the
-# license for the pristine package is not an Open Source License, in which
-# case the license is the MIT License). An "Open Source License" is a
-# license that conforms to the Open Source Definition (Version 1.9)
-# published by the Open Source Initiative.
-
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
-#
-
-
-# do not add defs here, please edit python3-base.spec instead
-# and run pre_checkin.sh
-#
-# see PACKAGING-NOTES for details
-#
-### COMMON-DEF-BEGIN ###
-%define         tarversion %{version}
-%define         tarname    Python-%{tarversion}
-# the versions are autogenerated from pre_checkin.sh
-# based on the current source tarball
-%define         python_version          3.9
-%define         python_version_abitag   39
-%define         python_version_soname   3_9
-
-%define         sitedir         %{_libdir}/python%{python_version}
-
-# three possible ABI kinds: m - pymalloc, d - debug build; see PEP 3149
-%define         abi_kind   m
-# python ABI version - used in some file names
-%define         python_abi %{python_version}%{abi_kind}
-# soname ABI tag defined in PEP 3149
-%define         abi_tag    %{python_version_abitag}%{abi_kind}
-# version part of "libpython" package
-%define         so_version %{python_version_soname}%{abi_kind}1_0
-
-# rpm and python have different ideas about what is an arch-dependent name, so:
-%if %{__isa_name} == ppc
-%define archname %(echo %{_arch} | sed s/ppc/powerpc/)
-%else
-%define archname %{_arch}
-%endif
-# our arm has Hardware-Floatingpoint
-#%if %{_arch} == arm
-#%define armsuffix hf
-#%endif
-
-# pyexpat.cpython-35m-x86_64-linux-gnu
-# pyexpat.cpython-35m-powerpc64le-linux-gnu
-# pyexpat.cpython-35m-armv7-linux-gnueabihf
-%define dynlib() %{sitedir}/lib-dynload/%{1}.cpython-%{abi_tag}-%{archname}-%{_os}%{?_gnu}.so
-%define __spec_check_pre exit 0
-### COMMON-DEF-END ###
-#
-Name:           python3
-Version:        3.9.1
-Release:        1
-Summary:        Python 3 Interpreter
-License:        Python-2.0
-Group:          Development/Languages/Python
-Url:            http://www.python.org/
-Source0:        http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz
-#Source1:        http://www.python.org/ftp/python/%{version}/%{tarname}.tar.xz.asc
-Source10:       add_pie_compile_option.patch
-
-BuildRequires:  automake
-BuildRequires:  fdupes
-BuildRequires:  gcc-c++
-BuildRequires:  gdbm-devel
-BuildRequires:  gettext-tools
-BuildRequires:  gmp-devel
-BuildRequires:  intltool
-BuildRequires:  bzip2-devel
-BuildRequires:  libexpat-devel
-BuildRequires:  libffi-devel
-#BuildRequires:  libnsl-devel
-BuildRequires:  lzma-devel
-BuildRequires:  ncurses-devel
-#BuildRequires:  netcfg
-BuildRequires:  pkgconfig(openssl1.1)
-BuildRequires:  pkgconfig
-BuildRequires:  readline-devel
-BuildRequires:  sqlite-devel
-#BuildRequires:  tk-devel
-BuildRequires:  xz
-#BuildRequires:  pkgconfig(x11)
-Requires:       python3-base = %{version}
-Recommends:     python3-curses
-Recommends:     python3-dbm
-Recommends:     python3-idle
-Recommends:     python3-pip
-#Recommends:     python3-tk
-# some compatibility Provides
-#Provides:       python = %{python_version}
-Provides:       python3 = %{python_version}
-
-Provides:       python3-xml = %{version}
-Obsoletes:      python3-xml < %{version}
-#
-# do not add patches here, please edit python3-base.spec instead
-# and run pre_checkin.sh
-#
-# see PACKAGING-NOTES for details
-#
-
-
-%description
-Python 3 is modern interpreted, object-oriented programming language,
-often compared to Tcl, Perl, Scheme, or Java.  You can find an overview
-of Python in the documentation and tutorials included in the python-doc
-package.
-
-This package supplies rich command line features provided by readline,
-XML processing tools, "ensurepip" installer, and sqlite3 support for
-the interpreter core, thus forming a so called "extended" runtime.
-Installing "python3" is sufficient for the vast majority of usecases.
-In addition, recommended packages provide UI toolkit support (python3-curses,
-python3-tk), legacy UNIX database bindings (python3-dbm), and the IDLE
-development environment (python3-idle).
-
-%package tk
-Summary:        TkInter - Python Tk Interface
-Group:          Development/Libraries/Python
-Requires:       %{name} = %{version}
-
-%description tk
-Python interface to Tk. Tk is the GUI toolkit that comes with Tcl. The
-"xrpm" package uses this Python interface.
-
-%package curses
-Summary:        Python Interface to the (N)Curses Library
-Group:          Development/Libraries/Python
-Requires:       %{name} = %{version}
-
-%description curses
-An easy to use interface to the (n)curses CUI library. CUI stands for
-Console User Interface.
-
-#%package dbm
-#Summary:        Python Interface to the GDBM Library
-#Group:          Development/Languages/Python
-#Requires:       %{name} = %{version}
-
-#%description dbm
-#An easy to use interface for Unix DBM databases, and more specifically,
-#the GNU implementation GDBM.
-
-%prep
-%setup -q -n %{tarname}
-%{__patch} -p1 < %{SOURCE10}
-
-### COMMON-PREP-BEGIN ###
-
-# drop Autoconf version requirement
-sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac
-
-# fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3
-for dir in Lib Tools; do
-    # find *.py, filter to files that contain bad shebangs
-    # break up "/""usr" like this to prevent replacing with %{_prefix}
-    find $dir -name '*.py' -type f -print0 \
-        | xargs -0 grep -lE '^#! *(/''usr/.*bin/(env +)?)?python' \
-        | xargs sed -r -i -e '1s@^#![[:space:]]*(/''usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#!%{_bindir}/python3@'
-done
-
-# drop in-tree libffi and expat
-rm -r Modules/_ctypes/libffi* Modules/_ctypes/darwin
-rm -r Modules/expat
-
-# drop duplicate README from site-packages
-rm Lib/site-packages/README.txt
-
-### COMMON-PREP-END ###
-
-%build
-### COMMON-CONFIG-BEGIN ###
-# use rpm_opt_flags
-export OPT="%{optflags} -DOPENSSL_LOAD_CONF $(pkg-config --cflags-only-I libffi)"
-export CFLAGS+=" -DNCURSES_INTERNALS"
-
-touch -r %{SOURCE0} Makefile.pre.in
-
-autoreconf -fi
-
-%if 0%{?sles_version}
-sed -e 's/-fprofile-correction//' -i Makefile.pre.in
-%endif
-
-%{?asan: export ASAN_OPTIONS=use_sigaltstack=false:`cat /ASAN_OPTIONS` }
-
-%configure \
-    --prefix=%{_prefix} \
-    --libdir=%{_libdir} \
-    --mandir=%{_mandir} \
-    --docdir=%{_docdir}/python \
-    --with-platlibdir=%{_lib} \
-    --enable-ipv6 \
-    --with-fpectl \
-    --enable-shared \
-    --with-ensurepip=no \
-    --with-system-ffi \
-    --with-system-expat \
-    --enable-lto \
-    --enable-loadable-sqlite-extensions
-
-# prevent make from trying to rebuild PYTHON_FOR_GEN stuff
-make -t Python/Python-ast.c \
-        Include/Python-ast.h \
-        Objects/typeslots.inc \
-        Python/opcode_targets.h \
-        Include/opcode.h
-
-### COMMON-CONFIG-END ###
-
-make %{?_smp_mflags} BASE_LIB=%{_lib}
-
-%check
-## Limit virtual memory to avoid spurious failures
-#if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then
-#  ulimit -v 10000000 || :
-#fi
-
-## only test the parts skipped in python3-base
-#TESTS="test_curses test_dbm_gnu test_dbm_ndbm test_idle \
-#       test_readline test_sqlite test_tcl test_tix  test_tk \
-#       test_ttk_textonly"
-## redo tests with SSL parts
-#%if !0%{?qemu_user_space_build}
-#TESTS="$TESTS test_asyncio"
-#%endif
-
-## XML tests
-#TESTS="$TESTS test_docxmlrpc test_minidom test_pulldom test_pyexpat \
-#    test_xml_etree test_xml_etree_c test_xmlrpc test_xmlrpc_net"
-## XML-dependent tests
-#TESTS="$TESTS test_plistlib test_venv \
-#    test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn"
-
-#make -j1 test TESTOPTS="-u curses $TESTS"
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make \
-    OPT="%{optflags} -fPIC" \
-    DESTDIR=%{buildroot} \
-    install
-
-# clean out stuff that is in python-base and subpackages
-
-rm %{buildroot}%{_bindir}/*
-rm %{buildroot}%{_libdir}/lib*
-rm -r %{buildroot}%{_libdir}/pkgconfig
-rm -r %{buildroot}%{_mandir}/*
-rm -r %{buildroot}%{_includedir}/*
-
-rm -r %{buildroot}%{sitedir}/config*
-find %{buildroot}%{sitedir} -name "*.egg-info" -exec rm {} ";"
-rm -r %{buildroot}%{sitedir}/__pycache__
-rm -r %{buildroot}%{sitedir}/site-packages
-rm %{buildroot}%{sitedir}/*.*
-
-for module in \
-    asyncio ctypes collections concurrent distutils email encodings \
-    html http \
-    importlib json logging multiprocessing pydoc_data unittest \
-    urllib venv wsgiref lib2to3 test idlelib turtledemo zoneinfo
-do
-    rm -r %{buildroot}%{sitedir}/$module
-done
-
-for library in \
-    array _asyncio audioop binascii _bisect _bz2 cmath _codecs_* _crypt _csv \
-    _contextvars _ctypes _datetime _decimal fcntl grp _hashlib _heapq _json _lsprof \
-    _lzma math mmap _multibytecodec _multiprocessing _opcode ossaudiodev \
-    parser _pickle _posixsubprocess _queue _random resource select _ssl _socket spwd \
-    _struct syslog termios _testbuffer _testimportmultiple _testmultiphase \
-    unicodedata zlib _ctypes_test _testcapi xxlimited \
-    _xxtestfuzz _md5 _sha1 _sha256 _sha512 _blake2 _sha3 \
-    _elementtree _posixshmem _sqlite3 _statistics _testinternalcapi \
-    _xxsubinterpreters _zoneinfo pyexpat readline
-do
-    eval rm "%{buildroot}%{sitedir}/lib-dynload/$library.*"
-done
-
-rm -rf $RPM_BUILD_ROOT%{sitedir}/tkinter
-rm -rf $RPM_BUILD_ROOT%{sitedir}/dbm
-rm -f $RPM_BUILD_ROOT%{sitedir}/lib-dynload/_gdbm.*
-
-%fdupes %{buildroot}/%{_libdir}/python%{python_version}
-
-#%files tk
-#%defattr(644, root, root, 755)
-#%{sitedir}/tkinter
-#%exclude %{sitedir}/tkinter/test
-#%{dynlib _tkinter}
-
-%files curses
-%defattr(644, root, root, 755)
-%license LICENSE
-%{sitedir}/curses
-%{dynlib _curses}
-%{dynlib _curses_panel}
-
-#%files dbm
-#%defattr(644, root, root, 755)
-#%license LICENSE
-#%{sitedir}/dbm
-#%{dynlib _dbm}
-#%{dynlib _gdbm}
-
-%files
-%defattr(644, root, root, 755)
-%dir %{sitedir}
-%dir %{sitedir}/lib-dynload
-%license LICENSE
-%{sitedir}/ensurepip
-%{sitedir}/sqlite3
-%exclude %{sitedir}/sqlite3/test
-%{sitedir}/xml
-%{sitedir}/xmlrpc
-
-%changelog
-