ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/webtools.spec
Revision: 1.71
Committed: Mon Sep 13 14:02:00 2010 UTC (14 years, 7 months ago) by diego
Branch: MAIN
CVS Tags: builder_2010-10-13_13-04-14_dbs-apps, builder_2010-10-13_12-53-04_dbs-web, HG1009c, HG1009b, HG1009a, dg-base-rev21, dg-base-rev20
Changes since 1.70: +13 -22 lines
Log Message:
now avoids sourcing dependencies already sourced

File Contents

# User Rev Content
1 diego 1.70 ### RPM cms webtools 1.3.43
2 eulisse 1.10 ## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages
3 valya 1.47 ## INITENV +PATH PERL5LIB %i/lib/perl
4    
5 eulisse 1.1 %define moduleName WEBTOOLS
6     %define exportName WEBTOOLS
7 diego 1.70 %define cvstag V01-03-43
8 eulisse 1.1 %define cvsserver cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e
9     Source: %cvsserver&strategy=checkout&module=%{moduleName}&nocache=true&export=%{exportName}&tag=-r%{cvstag}&output=/%{moduleName}.tar.gz
10 valya 1.47 Requires: python cherrypy py2-cheetah yui sqlite zlib py2-pysqlite expat openssl bz2lib db4 gdbm py2-cx-oracle py2-formencode py2-pycrypto oracle beautifulsoup py2-sqlalchemy oracle-env
11     Requires: p5-crypt-cbc p5-crypt-blowfish
12 eulisse 1.8 Provides: perl(CGI)
13     Provides: perl(Crypt::CBC)
14     Provides: perl(SecurityModule)
15 eulisse 1.28 Provides: perl(DBI)
16 eulisse 1.1 %prep
17     %setup -n %{moduleName}
18     %build
19 valya 1.47 mkdir -p %i/etc/init.d
20 eulisse 1.9
21 eulisse 1.1 %install
22     mkdir -p %i/etc
23 eulisse 1.10 mkdir -p %i/bin
24 valya 1.47 mkdir -p %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
25     mkdir -p %i/lib/perl
26    
27     # copy init script
28 valya 1.62 #cp Applications/SiteDB/initscripts/start.sh %{i}/etc/init.d/
29     #chmod a+x %{i}/etc/init.d/*
30 valya 1.47
31     rm -rf Applications Configuration
32     cp -r SecurityModule/perl/lib/* %i/lib/perl
33     cp -r * %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
34 eulisse 1.10 cp cmsWeb %i/bin
35 valya 1.47
36     cat << \EOF_CHERRYPY_CONF > %i/etc/cherrypy.conf
37     # Serve a complete directory
38     [/Common]
39     tools.staticdir.on = True
40     tools.staticdir.dir = %i/Common
41     [/Templates]
42     tools.staticdir.on = True
43     tools.staticdir.dir = %i/Templates
44     # Serve a complete directory
45     [/WEBTOOLS/Common]
46     tools.staticdir.on = True
47     tools.staticdir.dir = %i/Common
48     [/WEBTOOLS/Templates]
49     tools.staticdir.on = True
50     tools.staticdir.dir = %i/Templates
51     EOF_CHERRYPY_CONF
52     cat << \EOF_APACHE2_HEADER > %i/etc/apache2-header.conf
53     RewriteEngine On
54     RewriteBase /cms/services
55     EOF_APACHE2_HEADER
56    
57     cat << \EOF_APACHE2_CONF > %i/etc/apache2.conf
58     <Directory %i/Common>
59     Allow from all
60     </Directory>
61     <Directory %i/Templates>
62     Allow from all
63     </Directory>
64     EOF_APACHE2_CONF
65    
66     cat << \EOF_APACHE2_FOOTER > %i/etc/apache2-footer.conf
67     RewriteRule ^/cms/services/webtools/Common(.*)$ %i/Common$1
68     RewriteRule ^/cms/services/webtools/Templates(.*)$ %i/Templates$1
69     EOF_APACHE2_FOOTER
70 diego 1.71
71     # Generate dependencies-setup.{sh,csh} so init.{sh,csh} picks full environment.
72     rm -rf %i/etc/profile.d
73     mkdir -p %i/etc/profile.d
74     for tool in $(echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'); do
75     root=$(echo $tool | tr a-z- A-Z_)_ROOT; eval r=\$$root
76     if [ X"$r" != X ] && [ -r "$r/etc/profile.d/init.sh" ]; then
77     echo "test X\$$root != X || . $r/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
78     echo "test X\$$root != X || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
79     fi
80     done
81    
82 eulisse 1.1 %post
83 diego 1.71 %{relocateConfig}etc/profile.d/dependencies-setup.*sh
84 valya 1.47 %{relocateConfig}etc/cherrypy.conf
85     %{relocateConfig}etc/apache2.conf
86     %{relocateConfig}etc/apache2-header.conf
87     %{relocateConfig}etc/apache2-footer.conf
88 eulisse 1.14 perl -p -i -e "s!\@RPM_INSTALL_PREFIX\@!$RPM_INSTALL_PREFIX/%pkgrel!" $RPM_INSTALL_PREFIX/%pkgrel/bin/cmsWeb
89 valya 1.33
90 valya 1.47
91     # setup approripate links and made post install procedure
92     . $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh
93     if [ -n "${WEBTOOLS_CONF}" ] && [ -f ${WEBTOOLS_CONF}/sitedb/security.ini ]; then
94     ln -s ${WEBTOOLS_CONF}/sitedb/security.ini $RPM_INSTALL_PREFIX/%{pkgrel}/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Tools/SiteDBCore/security.ini
95     fi
96