1 |
< |
### RPM cms webtools 1.3.3 |
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 V01-03-08 |
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 oracle beautifulsoup py2-sqlalchemy |
8 |
> |
Requires: python cherrypy py2-cheetah yui webtools |
9 |
|
Provides: perl(CGI) |
10 |
|
Provides: perl(Crypt::CBC) |
11 |
|
Provides: perl(SecurityModule) |
13 |
|
%prep |
14 |
|
%setup -n %{moduleName} |
15 |
|
%build |
16 |
+ |
|
17 |
|
rm -rf %i/etc/profile.d |
18 |
|
mkdir -p %i/etc/profile.d |
19 |
|
echo '#!/bin/sh' > %{i}/etc/profile.d/dependencies-setup.sh |
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 |
|
mkdir -p %i/bin |
41 |
< |
mkdir -p %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages |
42 |
< |
rm -rf Applications Configuration |
41 |
< |
cp -r * %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages |
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 |
43 |
– |
cat << \EOF_CHERRYPY_CONF > %i/etc/cherrypy.conf |
44 |
– |
# Serve a complete directory |
45 |
– |
[/Common] |
46 |
– |
tools.staticdir.on = True |
47 |
– |
tools.staticdir.dir = %i/Common |
48 |
– |
[/Templates] |
49 |
– |
tools.staticdir.on = True |
50 |
– |
tools.staticdir.dir = %i/Templates |
51 |
– |
# Serve a complete directory |
52 |
– |
[/WEBTOOLS/Common] |
53 |
– |
tools.staticdir.on = True |
54 |
– |
tools.staticdir.dir = %i/Common |
55 |
– |
[/WEBTOOLS/Templates] |
56 |
– |
tools.staticdir.on = True |
57 |
– |
tools.staticdir.dir = %i/Templates |
58 |
– |
EOF_CHERRYPY_CONF |
59 |
– |
cat << \EOF_APACHE2_HEADER > %i/etc/apache2-header.conf |
60 |
– |
RewriteEngine On |
61 |
– |
RewriteBase /cms/services |
62 |
– |
EOF_APACHE2_HEADER |
63 |
– |
|
64 |
– |
cat << \EOF_APACHE2_CONF > %i/etc/apache2.conf |
65 |
– |
<Directory %i/Common> |
66 |
– |
Allow from all |
67 |
– |
</Directory> |
68 |
– |
<Directory %i/Templates> |
69 |
– |
Allow from all |
70 |
– |
</Directory> |
71 |
– |
EOF_APACHE2_CONF |
72 |
– |
|
73 |
– |
cat << \EOF_APACHE2_FOOTER > %i/etc/apache2-footer.conf |
74 |
– |
RewriteRule ^/cms/services/webtools/Common(.*)$ %i/Common$1 |
75 |
– |
RewriteRule ^/cms/services/webtools/Templates(.*)$ %i/Templates$1 |
76 |
– |
EOF_APACHE2_FOOTER |
77 |
– |
%define pythonv %(echo $PYTHON_ROOT | cut -d. -f1,2) |
44 |
|
%post |
79 |
– |
%{relocateConfig}etc/cherrypy.conf |
80 |
– |
%{relocateConfig}etc/apache2.conf |
81 |
– |
%{relocateConfig}etc/apache2-header.conf |
82 |
– |
%{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/bin/cmsWeb |
48 |
|
|
87 |
– |
|
88 |
– |
# setup approripate links and made post install procedure |
89 |
– |
. $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh |
90 |
– |
if [ `hostname`=="cmswttest.cern.ch" ]; then |
91 |
– |
cat > $RPM_INSTALL_PREFIX/%{pkgrel}/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Tools/SiteDBCore/security.ini << POST_EOF |
92 |
– |
[database] |
93 |
– |
dbtype = sqlite |
94 |
– |
dbname = $RPM_INSTALL_PREFIX/%{pkgrel}/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Tools/SiteDBCore/sitedb.db |
95 |
– |
POST_EOF |
96 |
– |
else |
97 |
– |
if [ -n "${WEBTOOLS_CONF}" ] && [ -f ${WEBTOOLS_CONF}/sitedb/security.ini ]; then |
98 |
– |
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 |
99 |
– |
fi |
100 |
– |
fi |
101 |
– |
|