1 |
eulisse |
1.9 |
### RPM cms webtools 0.9.0
|
2 |
eulisse |
1.10 |
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages
|
3 |
eulisse |
1.1 |
%define moduleName WEBTOOLS
|
4 |
|
|
%define exportName WEBTOOLS
|
5 |
eulisse |
1.11 |
%define cvstag V00-09-06
|
6 |
eulisse |
1.1 |
%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 |
eulisse |
1.9 |
Requires: python cherrypy py2-cheetah yui sqlite zlib py2-pysqlite expat openssl bz2lib db4 gdbm py2-cx-oracle py2-formencode py2-pycrypto
|
9 |
eulisse |
1.8 |
Provides: perl(CGI)
|
10 |
|
|
Provides: perl(Crypt::CBC)
|
11 |
|
|
Provides: perl(SecurityModule)
|
12 |
eulisse |
1.1 |
|
13 |
|
|
%prep
|
14 |
|
|
%setup -n %{moduleName}
|
15 |
|
|
%build
|
16 |
eulisse |
1.9 |
|
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
|
23 |
|
|
for pkg in $dependenciesRoots
|
24 |
|
|
do
|
25 |
|
|
echo $pkg
|
26 |
|
|
echo source $pkg/etc/profile.d/init.sh >> %i/etc/profile.d/dependencies-setup.sh
|
27 |
|
|
echo source $pkg/etc/profile.d/init.csh >> %i/etc/profile.d/dependencies-setup.csh
|
28 |
|
|
done
|
29 |
|
|
|
30 |
eulisse |
1.10 |
python Applications/SiteDB/Utilities/CreateSiteDB.py -p `pwd`/Applications/SiteDB/
|
31 |
|
|
|
32 |
eulisse |
1.1 |
%install
|
33 |
|
|
mkdir -p %i/etc
|
34 |
eulisse |
1.10 |
mkdir -p %i/bin
|
35 |
|
|
mkdir -p %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
|
36 |
|
|
cp -r * %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
|
37 |
|
|
cp cmsWeb %i/bin
|
38 |
eulisse |
1.1 |
cat << \EOF_CHERRYPY_CONF > %i/etc/cherrypy.conf
|
39 |
|
|
# Serve a complete directory
|
40 |
|
|
[/Common]
|
41 |
eulisse |
1.6 |
tools.staticdir.on = True
|
42 |
|
|
tools.staticdir.dir = %i/Common
|
43 |
eulisse |
1.1 |
[/Templates]
|
44 |
eulisse |
1.6 |
tools.staticdir.on = True
|
45 |
|
|
tools.staticdir.dir = %i/Templates
|
46 |
eulisse |
1.5 |
# Serve a complete directory
|
47 |
|
|
[/WEBTOOLS/Common]
|
48 |
eulisse |
1.6 |
tools.staticdir.on = True
|
49 |
|
|
tools.staticdir.dir = %i/Common
|
50 |
eulisse |
1.5 |
[/WEBTOOLS/Templates]
|
51 |
eulisse |
1.6 |
tools.staticdir.on = True
|
52 |
|
|
tools.staticdir.dir = %i/Templates
|
53 |
eulisse |
1.1 |
EOF_CHERRYPY_CONF
|
54 |
eulisse |
1.2 |
cat << \EOF_APACHE2_HEADER > %i/etc/apache2-header.conf
|
55 |
|
|
RewriteEngine On
|
56 |
|
|
RewriteBase /cms/services
|
57 |
|
|
EOF_APACHE2_HEADER
|
58 |
|
|
|
59 |
|
|
cat << \EOF_APACHE2_CONF > %i/etc/apache2.conf
|
60 |
|
|
<Directory %i/Common>
|
61 |
|
|
Allow from all
|
62 |
|
|
</Directory>
|
63 |
|
|
<Directory %i/Templates>
|
64 |
|
|
Allow from all
|
65 |
|
|
</Directory>
|
66 |
|
|
EOF_APACHE2_CONF
|
67 |
|
|
|
68 |
|
|
cat << \EOF_APACHE2_FOOTER > %i/etc/apache2-footer.conf
|
69 |
|
|
RewriteRule ^/cms/services/webtools/Common(.*)$ %i/Common$1
|
70 |
|
|
RewriteRule ^/cms/services/webtools/Templates(.*)$ %i/Templates$1
|
71 |
|
|
EOF_APACHE2_FOOTER
|
72 |
eulisse |
1.14 |
%define pythonv %(echo $PYTHON_ROOT | cut -d. -f1,2)
|
73 |
eulisse |
1.1 |
%post
|
74 |
|
|
%{relocateConfig}etc/cherrypy.conf
|
75 |
eulisse |
1.2 |
%{relocateConfig}etc/apache2.conf
|
76 |
|
|
%{relocateConfig}etc/apache2-header.conf
|
77 |
|
|
%{relocateConfig}etc/apache2-footer.conf
|
78 |
eulisse |
1.9 |
%{relocateConfig}etc/profile.d/dependencies-setup.sh
|
79 |
|
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh
|
80 |
eulisse |
1.14 |
%{relocateConfig}etc/lib/python2.4/site-packages/Applications/SiteDB/sitedb.ini
|
81 |
|
|
perl -p -i -e "s!\@RPM_INSTALL_PREFIX\@!$RPM_INSTALL_PREFIX/%pkgrel!" $RPM_INSTALL_PREFIX/%pkgrel/bin/cmsWeb
|