Ask Your Question
0

How to package Python 2.7 for RHEL/CentOS 6?

asked 2013-11-24 20:05:39 -0500

Cosmia gravatar image

updated 2014-04-11 16:42:21 -0500

remjg gravatar image

The build was successful but it depends on /usr/local/bin/python while the file never exists.

And maybe the make install did not use the compiled /usr/local/python2.7/bin/python but /usr/bin/python (2.6), because it reported "Syntax Error" during the build.

Summary: Python 2.7 for RHEL/CentOS 6
Name: python27
Version: 2.7.6
Release: 1.el6
License: Python
Group: Development/Language
URL: www.python.org
Packager: Alice<alice@example.com>

%description
Python 2.7 for RHEL/CentOS 6

%prep
rm -rf $RPM_BUILD_DIR/Python-2.7.6
tar -xJf $RPM_SOURCE_DIR/Python-2.7.6.tar.xz

%build
cd Python-2.7.6
./configure --prefix=/usr/local/python2.7
make

%install
cd Python-2.7.6
make DESTDIR=$RPM_BUILD_ROOT install

%files
/usr/local/python2.7
edit retag flag offensive close merge delete

Comments

though it might be possible to compile/re-use a python-2.6 srpm from Fedora, I wouldn't recommend it, as it would replace systems python2.6. This might have unwanted side effects.

mrunge gravatar imagemrunge ( 2013-11-27 02:31:59 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-11-25 12:27:55 -0500

remi gravatar image

Python 2.7 is part of official RHSCL 1.0 products for RHEL-6

CentOS users can also use test packages available in https://fedorahosted.org/SoftwareCollections/

Probably simple ;)

edit flag offensive delete link more
0

answered 2013-11-25 10:52:36 -0500

Hi: What about using the proposed .spec for python 2.7.5 which comes with Fedora 19?

%files
%defattr(-, root, root, -)
%doc LICENSE README
%{_bindir}/pydoc*
%{_bindir}/%{python}
%if %{main_python}
%{_bindir}/python2
%endif
%{_bindir}/python%{pybasever}
%{_mandir}/*/*

Kind regards

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-11-24 20:05:39 -0500

Seen: 3,802 times

Last updated: Nov 25 '13