[clug] Building Python3.7 RPM on CentOS 7

jm jeffm at ghostgun.com
Thu May 30 06:22:03 UTC 2019


Anyone have any directions for creating a rpm of python 3.7 on CentOS
7?  I'm trying the steps detailed below and running to problems,

Download
---------
$ curl -O https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz

Extract
------
$ xz -d Python-3.7.3.tar.xz
$ tar xvf Python-3.7.3.tar
$ cd Python-3.7.3

$ ./configure --enable-optimizations --with-lto 
--prefix=/usr/local/python37/ CXX="/usr/bin/g++"

Output includes these line,

checking for pkg-config... /usr/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking for X509_VERIFY_PARAM_set1_host in libssl... yes
checking for --with-ssl-default-suites... python

Build
----
$ make
$ ./python setup.py bdist_rpm


Local Install
----------
as root:
# make altinstall

Create Python Virtual Environment
-----------------------------

$ /usr/local/python37/bin/python3.7 -m venv $HOME/py37
$ source $HOME/py37/bin/activate

$ which python
~/py37/bin/python

$ python -V
Python 3.7.3

Build RPM
--------
$python setup.py bdist_rpm


This produces several error ending with

Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with
X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs,
https://github.com/libressl-portable/portable/issues/381

running build_scripts
creating build/scripts-3.7
error: file
'/usr/local/python37/lib/python3.7/config-3.7m-x86_64-linux-gnu/Tools/scripts/pydoc3'
does not exist
error: Bad exit status from /var/tmp/rpm-tmp.uJBjOh (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.uJBjOh (%build)
error: command 'rpmbuild' failed with exit status 1


Thoughts?

Jeff.






More information about the linux mailing list