1 |
< |
### RPM cms webtools 1.0.0 |
1 |
> |
### RPM cms webtools 1.3.43 |
2 |
|
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages |
3 |
+ |
## INITENV +PATH PERL5LIB %i/lib/perl |
4 |
+ |
|
5 |
|
%define moduleName WEBTOOLS |
6 |
|
%define exportName WEBTOOLS |
7 |
< |
%define cvstag V01-00-03 |
7 |
> |
%define cvstag V01-03-43 |
8 |
|
%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 |
< |
Requires: python cherrypy py2-cheetah yui sqlite zlib py2-pysqlite expat openssl bz2lib db4 gdbm py2-cx-oracle py2-formencode py2-pycrypto oracle |
10 |
> |
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 |
|
Provides: perl(CGI) |
13 |
|
Provides: perl(Crypt::CBC) |
14 |
|
Provides: perl(SecurityModule) |
15 |
< |
|
13 |
< |
|
15 |
> |
Provides: perl(DBI) |
16 |
|
%prep |
17 |
|
%setup -n %{moduleName} |
18 |
|
%build |
19 |
< |
|
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 |
< |
$PY2_CHEETAH_ROOT $PY2_PYCRYPTO_ROOT $PY2_CX_ORACLE_ROOT $ORACLE_ROOT" |
23 |
< |
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 |
< |
python Applications/SiteDB/Utilities/CreateSiteDB.py -p `pwd`/Applications/SiteDB/ |
19 |
> |
mkdir -p %i/etc/init.d |
20 |
|
|
21 |
|
%install |
22 |
|
mkdir -p %i/etc |
23 |
|
mkdir -p %i/bin |
24 |
|
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 |
+ |
#cp Applications/SiteDB/initscripts/start.sh %{i}/etc/init.d/ |
29 |
+ |
#chmod a+x %{i}/etc/init.d/* |
30 |
+ |
|
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 |
|
cp cmsWeb %i/bin |
35 |
+ |
|
36 |
|
cat << \EOF_CHERRYPY_CONF > %i/etc/cherrypy.conf |
37 |
|
# Serve a complete directory |
38 |
|
[/Common] |
67 |
|
RewriteRule ^/cms/services/webtools/Common(.*)$ %i/Common$1 |
68 |
|
RewriteRule ^/cms/services/webtools/Templates(.*)$ %i/Templates$1 |
69 |
|
EOF_APACHE2_FOOTER |
70 |
< |
%define pythonv %(echo $PYTHON_ROOT | cut -d. -f1,2) |
70 |
> |
|
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 |
|
%post |
83 |
+ |
%{relocateConfig}etc/profile.d/dependencies-setup.*sh |
84 |
|
%{relocateConfig}etc/cherrypy.conf |
85 |
|
%{relocateConfig}etc/apache2.conf |
86 |
|
%{relocateConfig}etc/apache2-header.conf |
87 |
|
%{relocateConfig}etc/apache2-footer.conf |
79 |
– |
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
80 |
– |
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
81 |
– |
%{relocateConfig}lib/python2.4/site-packages/Applications/SiteDB/sitedb.ini |
82 |
– |
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 |
88 |
|
perl -p -i -e "s!\@RPM_INSTALL_PREFIX\@!$RPM_INSTALL_PREFIX/%pkgrel!" $RPM_INSTALL_PREFIX/%pkgrel/bin/cmsWeb |
89 |
+ |
|
90 |
+ |
|
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 |
+ |
|