1 |
< |
### RPM external mod_python 3.2.8 |
1 |
> |
### RPM external mod_python 3.2.10 |
2 |
> |
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages |
3 |
|
|
4 |
< |
%define pythonv %(echo $PYTHON_VERSION | cut -d. -f 1,2) |
4 |
< |
## INITENV +PATH PYTHONPATH %{i}/lib/python%{pythonv} |
5 |
< |
## INITENV CMD ln -sf $MOD_PYTHON_ROOT/lib/mod_python.so $APACHE_ROOT/modules |
4 |
> |
# See http://www.modpython.org/live/current/doc-html/installation.html |
5 |
|
|
6 |
< |
Source: http://apache.mirror.testserver.li/httpd/modpython/%{n}-%{v}.tgz |
7 |
< |
Requires: python apache |
6 |
> |
Requires: apache2 python |
7 |
> |
Source0: http://apache.mirror.testserver.li/httpd/modpython/mod_python-%realversion.tgz |
8 |
|
|
9 |
+ |
%prep |
10 |
+ |
%setup -n mod_python-%realversion |
11 |
|
|
12 |
< |
%build |
13 |
< |
./configure --prefix=%{i} \ |
13 |
< |
--with-python=$PYTHON_ROOT/bin/python \ |
14 |
< |
--with-apxs=$APACHE_ROOT/bin/apxs |
12 |
> |
# note: --prefix and --exec-prefix mean nothing to this package... |
13 |
> |
./configure --with-python=$PYTHON_ROOT/bin/python --with-apxs=$APACHE2_ROOT/bin/apxs --with-max-locks=32 |
14 |
|
|
15 |
+ |
%build |
16 |
|
make |
17 |
|
|
18 |
– |
cd dist |
19 |
– |
python setup.py build |
20 |
– |
|
18 |
|
%install |
19 |
+ |
# note: need undocumented DESTDIR to move the install area |
20 |
+ |
DESTDIR=%i make install |
21 |
|
|
22 |
< |
mkdir -p %i/lib |
23 |
< |
cp src/mod_python.so %i/lib |
24 |
< |
|
25 |
< |
cd dist |
26 |
< |
python setup.py install --prefix=%i |
27 |
< |
|
28 |
< |
mv %{i}/lib/python%{pythonv}/site-packages/mod_python \ |
29 |
< |
%{i}/lib/python%{pythonv} |
30 |
< |
|
31 |
< |
rm -rf %{i}/lib/python%{pythonv}/site-packages |
32 |
< |
|
22 |
> |
mkdir -p %i/conf |
23 |
> |
cat << \EOF > %i/conf/mod_python.conf |
24 |
> |
LoadModule python_module %i/modules/mod_python.so |
25 |
> |
# Additional configuration bits go here. |
26 |
> |
EOF |
27 |
> |
|
28 |
> |
# By default mod_perl.so and include/ directory is moved to the |
29 |
> |
# $APACHE2_ROOT/modules and $APACHE2_ROOT/include, respectively, which |
30 |
> |
# is bad for us handling multiple versions in a rpm. With |
31 |
> |
# --with-apxs set this changes to %i/$APACHE2_ROOT, which will be a |
32 |
> |
# long directory path hardcoded at build time. Therefore, we have to |
33 |
> |
# move these resources back to a sane location and clean up. The same |
34 |
> |
# goes for the python libraries. |
35 |
> |
mv %i/$APACHE2_ROOT/* %i |
36 |
> |
mv %i/$PYTHON_ROOT/* %i |
37 |
> |
rm -r %i/build |
38 |
> |
|
39 |
> |
# Generates the dependencies-setup.{sh,csh} files so that |
40 |
> |
# sourcing init.{sh,csh} picks up also the environment of |
41 |
> |
# dependencies. |
42 |
> |
|
43 |
> |
rm -rf %i/etc/profile.d |
44 |
> |
mkdir -p %i/etc/profile.d |
45 |
> |
echo '#!/bin/sh' > %{i}/etc/profile.d/dependencies-setup.sh |
46 |
> |
echo '#!/bin/tcsh' > %{i}/etc/profile.d/dependencies-setup.csh |
47 |
> |
echo requiredtools `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` |
48 |
> |
for tool in `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` |
49 |
> |
do |
50 |
> |
case X$tool in |
51 |
> |
Xdistcc|Xccache ) |
52 |
> |
;; |
53 |
> |
* ) |
54 |
> |
toolcap=`echo $tool | tr a-z- A-Z_` |
55 |
> |
eval echo ". $`echo ${toolcap}_ROOT`/etc/profile.d/init.sh" >> %{i}/etc/profile.d/dependencies-setup.sh |
56 |
> |
eval echo "source $`echo ${toolcap}_ROOT`/etc/profile.d/init.csh" >> %{i}/etc/profile.d/dependencies-setup.csh |
57 |
> |
;; |
58 |
> |
esac |
59 |
> |
done |
60 |
> |
|
61 |
> |
perl -p -i -e 's|\. /etc/profile\.d/init\.sh||' %{i}/etc/profile.d/dependencies-setup.sh |
62 |
> |
perl -p -i -e 's|source /etc/profile\.d/init\.csh||' %{i}/etc/profile.d/dependencies-setup.csh |
63 |
> |
|
64 |
> |
|
65 |
> |
%post |
66 |
> |
%{relocateConfig}conf/mod_python.conf |
67 |
> |
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
68 |
> |
%{relocateConfig}etc/profile.d/dependencies-setup.csh |