1 |
|
### RPM external py2-python-dateutil 1.1 |
2 |
– |
%define pythonv %(echo $PYTHON_VERSION | cut -f1,2 -d.) |
2 |
|
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -f1,2 -d.`/site-packages |
3 |
|
|
4 |
|
Source: http://labix.org/download/python-dateutil/python-dateutil-%{realversion}.tar.bz2 |
6 |
|
|
7 |
|
%prep |
8 |
|
%setup -n python-dateutil-%{realversion} |
9 |
+ |
|
10 |
|
%build |
11 |
+ |
python setup.py build |
12 |
+ |
|
13 |
|
%install |
14 |
|
python setup.py install --prefix=%i |
15 |
< |
|
16 |
< |
# following code to correctly setup dependencies environment |
15 |
< |
rm -rf %i/etc/profile.d |
16 |
< |
mkdir -p %i/etc/profile.d |
17 |
< |
for x in %pkgreqs; do |
18 |
< |
case $x in /* ) continue ;; esac |
19 |
< |
p=%{instroot}/%{cmsplatf}/$(echo $x | sed 's/\([^+]*\)+\(.*\)+\([A-Z0-9].*\)/\1 \2 \3/' | tr ' ' '/') |
20 |
< |
echo ". $p/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
21 |
< |
echo "source $p/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
22 |
< |
done |
23 |
< |
|
24 |
< |
%post |
25 |
< |
# The relocation below is also needed in case of dependencies |
26 |
< |
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
27 |
< |
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
28 |
< |
|
15 |
> |
egrep -r -l '^#!.*python' %i | xargs perl -p -i -e 's{^#!.*python.*}{#!/usr/bin/env python}' |
16 |
> |
find %i -name '*.egg-info' -exec rm {} \; |