1 |
|
### RPM external py2-ipython 0.10 |
2 |
< |
%define pythonv %(echo $PYTHON_VERSION | cut -f1,2 -d.) |
3 |
< |
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -f1,2 -d.`/site-packages |
4 |
< |
|
2 |
> |
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages |
3 |
|
Source: http://ipython.scipy.org/dist/%realversion/ipython-%realversion.tar.gz |
4 |
|
Requires: python |
5 |
|
|
7 |
|
%setup -n ipython-%realversion |
8 |
|
|
9 |
|
%build |
10 |
+ |
python setup.py build |
11 |
|
|
12 |
|
%install |
14 |
– |
mkdir -p %i/bin |
15 |
– |
mkdir -p %i/lib/python`echo $PYTHON_VERSION | cut -f1,2 -d.`/site-packages |
16 |
– |
python setup.py build |
13 |
|
python setup.py install --prefix=%i |
14 |
< |
cd %i/bin |
15 |
< |
for name in `ls`; |
20 |
< |
do |
21 |
< |
cat $name | sed -e "s,#\!/.*python$,#\!/usr/bin/env python,g" > $name.tmp |
22 |
< |
rm -f $name |
23 |
< |
mv $name.tmp $name |
24 |
< |
chmod a+x $name |
25 |
< |
done |
26 |
< |
|
27 |
< |
#mv build/lib*/* %i/lib/python`echo $PYTHON_VERSION | cut -f1,2 -d.`/site-packages |
28 |
< |
#cp build/script*/* %i/bin/ |
29 |
< |
|
30 |
< |
mkdir -p %i/etc/profile.d/ |
31 |
< |
# This will generate the correct dependencies-setup.sh/dependencies-setup.csh |
32 |
< |
# using the information found in the Requires statements of the different |
33 |
< |
# specs and their dependencies. |
34 |
< |
echo '#!/bin/sh' > %{i}/etc/profile.d/dependencies-setup.sh |
35 |
< |
echo '#!/bin/tcsh' > %{i}/etc/profile.d/dependencies-setup.csh |
36 |
< |
echo requiredtools `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` |
37 |
< |
for tool in `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` |
38 |
< |
do |
39 |
< |
case X$tool in |
40 |
< |
Xdistcc|Xccache ) |
41 |
< |
;; |
42 |
< |
* ) |
43 |
< |
toolcap=`echo $tool | tr a-z- A-Z_` |
44 |
< |
eval echo ". $`echo ${toolcap}_ROOT`/etc/profile.d/init.sh" >> %{i}/etc/profile.d/dependencies-setup.sh |
45 |
< |
eval echo "source $`echo ${toolcap}_ROOT`/etc/profile.d/init.csh" >> %{i}/etc/profile.d/dependencies-setup.csh |
46 |
< |
;; |
47 |
< |
esac |
48 |
< |
done |
49 |
< |
perl -p -i -e 's|\. /etc/profile\.d/init\.sh||' %{i}/etc/profile.d/dependencies-setup.sh |
50 |
< |
perl -p -i -e 's|source /etc/profile\.d/init\.csh||' %{i}/etc/profile.d/dependencies-setup.csh |
51 |
< |
|
52 |
< |
%post |
53 |
< |
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
54 |
< |
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
14 |
> |
egrep -r -l '^#!.*python' %i | xargs perl -p -i -e 's{^#!.*python.*}{#!/usr/bin/env python}' |
15 |
> |
find %i -name '*.egg-info' -exec rm {} \; |