1 |
valya |
1.1 |
### RPM external py2-setuptools 0.6c9
|
2 |
diego |
1.2 |
## INITENV +PATH PATH %i/bin
|
3 |
valya |
1.1 |
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -f1,2 -d.`/site-packages
|
4 |
|
|
|
5 |
|
|
Source: http://pypi.python.org/packages/source/s/setuptools/setuptools-%realversion.tar.gz
|
6 |
|
|
Requires: python
|
7 |
|
|
%prep
|
8 |
|
|
%setup -n setuptools-%realversion
|
9 |
|
|
%build
|
10 |
|
|
%install
|
11 |
diego |
1.2 |
export PYTHONPATH=$PYTHONPATH:%i/lib/python`echo $PYTHON_VERSION | cut -f1,2 -d.`/site-packages
|
12 |
valya |
1.1 |
mkdir -p %i/lib/python`echo $PYTHON_VERSION | cut -f1,2 -d.`/site-packages
|
13 |
diego |
1.2 |
python setup.py install --prefix=%i
|
14 |
valya |
1.1 |
|
15 |
diego |
1.2 |
# Fixed static paths to python
|
16 |
|
|
perl -p -i -e "s|#!.*/python|#!/usr/bin/env python|" %i/bin/*
|
17 |
|
|
|
18 |
|
|
# This will generate the correct dependencies-setup.sh/dependencies-setup.csh
|
19 |
|
|
# using the information found in the Requires statements of the different
|
20 |
|
|
# specs and their dependencies.
|
21 |
|
|
rm -rf %i/etc/profile.d
|
22 |
|
|
mkdir -p %i/etc/profile.d
|
23 |
|
|
for x in %pkgreqs; do
|
24 |
|
|
case $x in /* ) continue ;; esac
|
25 |
|
|
p=%{instroot}/%{cmsplatf}/$(echo $x | sed 's/\([^+]*\)+\(.*\)+\([A-Z0-9].*\)/\1 \2 \3/' | tr ' ' '/')
|
26 |
|
|
echo ". $p/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
|
27 |
|
|
echo "source $p/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
|
28 |
|
|
done
|
29 |
|
|
|
30 |
|
|
%post
|
31 |
|
|
%{relocateConfig}etc/profile.d/dependencies-setup.sh
|
32 |
|
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh
|
33 |
valya |
1.1 |
|