1 |
< |
### RPM cms webtools 0.9.0 |
1 |
> |
### RPM cms webtools-base 0.1.1 |
2 |
> |
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages |
3 |
|
%define moduleName WEBTOOLS |
4 |
|
%define exportName WEBTOOLS |
5 |
< |
%define cvstag V00-09-00 |
5 |
> |
%define cvstag V01-03-18 |
6 |
|
%define cvsserver cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e |
7 |
|
Source: %cvsserver&strategy=checkout&module=%{moduleName}&nocache=true&export=%{exportName}&tag=-r%{cvstag}&output=/%{moduleName}.tar.gz |
8 |
< |
Requires: python cherrypy py2-cheetah yui sqlite zlib py2-pysqlite expat openssl bz2lib db4 gdbm py2-cx-oracle py2-formencode py2-pycrypto |
8 |
> |
Requires: python cherrypy py2-cheetah yui webtools |
9 |
|
Provides: perl(CGI) |
10 |
|
Provides: perl(Crypt::CBC) |
11 |
|
Provides: perl(SecurityModule) |
12 |
< |
|
12 |
> |
Provides: perl(DBI) |
13 |
|
%prep |
14 |
|
%setup -n %{moduleName} |
15 |
|
%build |
16 |
|
|
17 |
|
rm -rf %i/etc/profile.d |
18 |
< |
mkdir -p %i/etc/profile.d/ |
19 |
< |
dependenciesRoots="$PYTHON_ROOT $SQLITE_ROOT $PY2_PYSQLITE_ROOT $CHERRYPY_ROOT $YUI_ROOT \ |
20 |
< |
$ZLIB_ROOT $EXPAT_ROOT $OPENSSEL_ROOT $BZ2LIB_ROOT $DB4_ROOT $GDBM_ROOT $PY2_FORMENCODE_ROOT \ |
21 |
< |
$PY2_CHEETAH_ROOT $PY2_PYCRYPTO_ROOT $PY2_CX_ORACLE_ROOT" |
22 |
< |
touch %i/etc/profile.d/dependencies-setup.csh |
22 |
< |
for pkg in $dependenciesRoots |
18 |
> |
mkdir -p %i/etc/profile.d |
19 |
> |
echo '#!/bin/sh' > %{i}/etc/profile.d/dependencies-setup.sh |
20 |
> |
echo '#!/bin/tcsh' > %{i}/etc/profile.d/dependencies-setup.csh |
21 |
> |
echo requiredtools `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` |
22 |
> |
for tool in `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` |
23 |
|
do |
24 |
< |
echo $pkg |
25 |
< |
echo source $pkg/etc/profile.d/init.sh >> %i/etc/profile.d/dependencies-setup.sh |
26 |
< |
echo source $pkg/etc/profile.d/init.csh >> %i/etc/profile.d/dependencies-setup.csh |
24 |
> |
case X$tool in |
25 |
> |
Xdistcc|Xccache ) |
26 |
> |
;; |
27 |
> |
* ) |
28 |
> |
toolcap=`echo $tool | tr a-z- A-Z_` |
29 |
> |
eval echo ". $`echo ${toolcap}_ROOT`/etc/profile.d/init.sh" >> %{i}/etc/profile.d/dependencies-setup.sh |
30 |
> |
eval echo "source $`echo ${toolcap}_ROOT`/etc/profile.d/init.csh" >> %{i}/etc/profile.d/dependencies-setup.csh |
31 |
> |
;; |
32 |
> |
esac |
33 |
|
done |
34 |
|
|
35 |
+ |
perl -p -i -e 's|\. /etc/profile\.d/init\.sh||' %{i}/etc/profile.d/dependencies-setup.sh |
36 |
+ |
perl -p -i -e 's|source /etc/profile\.d/init\.csh||' %{i}/etc/profile.d/dependencies-setup.csh |
37 |
+ |
|
38 |
|
%install |
39 |
|
mkdir -p %i/etc |
40 |
< |
cp -r * %i |
41 |
< |
cat << \EOF_CHERRYPY_CONF > %i/etc/cherrypy.conf |
42 |
< |
# Serve a complete directory |
43 |
< |
[/Common] |
35 |
< |
tools.staticdir.on = True |
36 |
< |
tools.staticdir.dir = %i/Common |
37 |
< |
[/Templates] |
38 |
< |
tools.staticdir.on = True |
39 |
< |
tools.staticdir.dir = %i/Templates |
40 |
< |
# Serve a complete directory |
41 |
< |
[/WEBTOOLS/Common] |
42 |
< |
tools.staticdir.on = True |
43 |
< |
tools.staticdir.dir = %i/Common |
44 |
< |
[/WEBTOOLS/Templates] |
45 |
< |
tools.staticdir.on = True |
46 |
< |
tools.staticdir.dir = %i/Templates |
47 |
< |
EOF_CHERRYPY_CONF |
48 |
< |
cat << \EOF_APACHE2_HEADER > %i/etc/apache2-header.conf |
49 |
< |
RewriteEngine On |
50 |
< |
RewriteBase /cms/services |
51 |
< |
EOF_APACHE2_HEADER |
52 |
< |
|
53 |
< |
cat << \EOF_APACHE2_CONF > %i/etc/apache2.conf |
54 |
< |
<Directory %i/Common> |
55 |
< |
Allow from all |
56 |
< |
</Directory> |
57 |
< |
<Directory %i/Templates> |
58 |
< |
Allow from all |
59 |
< |
</Directory> |
60 |
< |
EOF_APACHE2_CONF |
61 |
< |
|
62 |
< |
cat << \EOF_APACHE2_FOOTER > %i/etc/apache2-footer.conf |
63 |
< |
RewriteRule ^/cms/services/webtools/Common(.*)$ %i/Common$1 |
64 |
< |
RewriteRule ^/cms/services/webtools/Templates(.*)$ %i/Templates$1 |
65 |
< |
EOF_APACHE2_FOOTER |
66 |
< |
|
40 |
> |
mkdir -p %i/bin |
41 |
> |
mkdir -p %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Applications |
42 |
> |
cp -r Applications/base %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Applications |
43 |
> |
cp cmsWeb %i/bin |
44 |
|
%post |
68 |
– |
%{relocateConfig}etc/cherrypy.conf |
69 |
– |
%{relocateConfig}etc/apache2.conf |
70 |
– |
%{relocateConfig}etc/apache2-header.conf |
71 |
– |
%{relocateConfig}etc/apache2-footer.conf |
45 |
|
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
46 |
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
47 |
< |
perl -p -i -e "s!\@RPM_INSTALL_PREFIX\@!$RPM_INSTALL_PREFIX/%pkgrel!" $RPM_INSTALL_PREFIX/%pkgrel/cmsWeb |
47 |
> |
perl -p -i -e "s!\@RPM_INSTALL_PREFIX\@!$RPM_INSTALL_PREFIX/%pkgrel!" $RPM_INSTALL_PREFIX/%pkgrel/bin/cmsWeb |
48 |
|
|