ENV:
CentOS 7
3.10.0-123.9.3.el7.x86_64
I would like to setup Python3.4 by RPM.
Source to prepare, from koji,
#spec files are modified by myself based on the fc22.src.
1 2 3 4 5 6 |
python3-3.4.2-1.fc22.src.rpm python-pip-1.5.6-4.fc22.src.rpm python-pip.spec python-setuptools-7.0-1.fc22.src.rpm python-setuptools.spec python-wheel-0.24.0-1.fc22.src.rpm |
Step 0:
As there’r crossing Deps on python/wheel/pip/setuptools… I have to use existing python-pip and python-setuptools for now:
1 2 |
python3-setuptools-7.0-1.fc22.noarch.rpm python3-pip-1.5.6-4.fc22.noarch.rpm |
Force inst. the above 2 packages using #rpm -ivh –nodeps
Step 1:
Rebuild python3 package:
1 2 3 4 5 |
yum-builddep python3-3.4.2-1.fc22.src.rpm rpmbuild --rebuild python3-3.4.2-1.fc22.src.rpm yum localinstall /root/rpmbuild/RPMS/x86_64/python3-3.4.2-1.el7.centos.x86_64.rpm /root/rpmbuild/RPMS/x86_64/python3-libs-3.4.2-1.el7.centos.x86_64.rpm #devel packages for the next steps: yum localinstall /root/rpmbuild/RPMS/x86_64/python3-devel-3.4.2-1.el7.centos.x86_64.rpm |
Step 2:
Setup python-wheel
1 2 3 |
yum-builddep python-wheel-0.24.0-1.fc22.src.rpm rpmbuild --rebuild python-wheel-0.24.0-1.fc22.src.rpm rpm -ivh /root/rpmbuild/RPMS/noarch/python-wheel-0.24.0-1.el7.centos.noarch.rpm /root/rpmbuild/RPMS/noarch/python3-wheel-0.24.0-1.el7.centos.noarch.rpm |
Step 3:
Setup python-pip & python-setuptools
#Disable wheels, why? check https://github.com/fedora-python/python-pip
1 2 3 4 5 |
yum-builddep python-pip-1.5.6-4.fc22.src.rpm rpm2cpio python-pip-1.5.6-4.fc22.src.rpm | cpio -i python-pip.spec #vi python-pip.spec # To enable python3-pip, disable all wheels. I personally mod version to 1.5.6-4.1 rpmbuild -bb python-pip.spec |
1 2 3 4 5 |
yum-builddep python-setuptools-7.0-1.fc22.src.rpm rpm2cpio python-setuptools-7.0-1.fc22.src.rpm |cpio -i python-setuptools.spec #vi python-setuptools.spec # To enable python3*, disable all wheels, disable pytest related if you want. mod version to 7.0-1.1 rpmbuild -bb python-setuptools.spec |
Then Replace those fc22 binaries:
#Also it’s why I mod the pkg version, is just easy for the rpm update cmd.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@t430z workspace]# rpm -Uvh /root/rpmbuild/RPMS/noarch/python-pip-1.5.6-4.1.el7.centos.noarch.rpm /root/rpmbuild/RPMS/noarch/python3-pip-1.5.6-4.1.el7.centos.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:python3-pip-1.5.6-4.1.el7.centos ################################# [ 25%] 2:python-pip-1.5.6-4.1.el7.centos ################################# [ 50%] Cleaning up / removing... 3:python3-pip-1.5.6-4.fc22 ################################# [ 75%] 4:python-pip-1.5.6-4.fc22 ################################# [100%] [root@t430z workspace]# rpm -Uvh /root/rpmbuild/RPMS/noarch/python3-setuptools-7.0-1.1.el7.centos.noarch.rpm /root/rpmbuild/RPMS/noarch/python-setuptools-7.0-1.1.el7.centos.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:python-setuptools-7.0-1.1.el7.cen################################# [ 25%] 2:python3-setuptools-7.0-1.1.el7.ce################################# [ 50%] Cleaning up / removing... 3:python-setuptools-0.9.8-3.el7 ################################# [ 75%] 4:python3-setuptools-7.0-1.fc22 ################################# [100%] |
Done:
1 2 3 4 5 6 7 |
[root@t430z workspace]# rpm -qa| grep python3 python3-libs-3.4.2-1.el7.centos.x86_64 python3-devel-3.4.2-1.el7.centos.x86_64 python3-wheel-0.24.0-1.el7.centos.noarch python3-setuptools-7.0-1.1.el7.centos.noarch python3-3.4.2-1.el7.centos.x86_64 python3-pip-1.5.6-4.1.el7.centos.noarch |
All other related pkgs, Im updating via pycharm, not on RPMs.
I will update SRPMs and RPMs here:
http://pan.baidu.com/s/1o6OB8ro