ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/webtools.spec
Revision: 1.22
Committed: Thu May 10 13:17:44 2007 UTC (17 years, 11 months ago) by eulisse
Branch: MAIN
Changes since 1.21: +1 -1 lines
Log Message:
Using V01-00-03

File Contents

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