%define __prefix /usr/local/python
%define tempath /tmp
Name: python27
Version: 2.7.2
Release: el5
Summary: Python for me.com
License: GPL
URL: python.org
Vendor: me.com
GROUP: Development/Languages
Source0: Python-2.7.2.tar.bz2
BuildRoot: %(mktemp -ud %{tempath}/%{name}-%{version}-%{release}-root)
BuildRequires: gcc make expat-devel valgrind-devel sqlite-devel db4-devel gdbm-devel
Packager: me
%description
Python is a programming language that lets you work more quickly and
integrate your systems more effectively.You can learn to use Python and
see almost immediate gains in productivity and lower maintenance costs.
%prep
%setup -q -n Python-%{version}
%build
./configure --prefix=%{__prefix} --enable-shared --with-threads --with-computed-gotos --enable-ipv6 --with-valgrind --with-system-expat --with-system-ffi --enable-unicode=ucs4 --with-signal-module
make %{_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{__prefix} install
chmod 644 $RPM_BUILD_ROOT%{__prefix}/lib/libpython2.7*
# fix the #! line in installed files
find "$RPM_BUILD_ROOT" -type f -print0 |
xargs -0 grep -l /usr/local/bin/python | while read file
do
FIXFILE="$file"
sed 's|^#!.*python|#!%{__prefix}/bin/python|' \
"$FIXFILE" >/tmp/fix-python-path.$$
cat /tmp/fix-python-path.$$ >"$FIXFILE"
rm -f /tmp/fix-python-path.$$
done
find "$RPM_BUILD_ROOT" -type f -print0 |
xargs -0 grep -l $RPM_BUILD_ROOT%{__prefix}/bin/python2.7 | while read file
do
FIXFILE="$file"
sed 's|^#!.*python2.7|#!%{__prefix}/bin/python2.7|' \
"$FIXFILE" >/tmp/fix-python-path.$$
cat /tmp/fix-python-path.$$ >"$FIXFILE"
rm -f /tmp/fix-python-path.$$
done
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{__prefix}