1 |
### RPM cms dbs-web V05_00_14
|
2 |
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -d. -f 1,2`/site-packages
|
3 |
## INITENV +PATH PYTHONPATH $ELEMENTTREE_ROOT/share/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
|
4 |
## INITENV SET DDHOME $DBS_WEB_ROOT/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
|
5 |
## INITENV SET DBS_DBPARAM $DDHOME/DBParam
|
6 |
## INITENV SET PYTHONPATH ${DDHOME}:${DDHOME}/QueryBuilder:${PYTHONPATH}
|
7 |
|
8 |
%define cvstag %{realversion}
|
9 |
%define cvsserver cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e
|
10 |
Source: %cvsserver&strategy=checkout&module=DBS/Web/DataDiscovery&nocache=true&export=DBS&tag=-r%{cvstag}&output=/dbs-web.tar.gz
|
11 |
Requires: python py2-sqlalchemy cherrypy py2-cheetah webtools yui elementtree dbs-client mysql py2-mysqldb sqlite py2-pysqlite py2-cx-oracle oracle-env py2-simplejson
|
12 |
|
13 |
%prep
|
14 |
%setup -n DBS/Web/DataDiscovery
|
15 |
%build
|
16 |
|
17 |
%install
|
18 |
mkdir -p %{i}/bin
|
19 |
mkdir -p %{i}/etc/profile.d
|
20 |
mkdir -p %{i}/etc/init.d
|
21 |
mkdir -p %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
|
22 |
cp -r * %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
|
23 |
|
24 |
# copy init script
|
25 |
cp cmsweb_discovery dbs_discovery %{i}/etc/init.d
|
26 |
chmod a+x %{i}/etc/init.d/*
|
27 |
|
28 |
cd %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
|
29 |
#ln -s $YUI_ROOT/build YUI
|
30 |
|
31 |
# This will generate the correct dependencies-setup.sh/dependencies-setup.csh
|
32 |
# using the information found in the Requires statements of the different
|
33 |
# specs and their dependencies.
|
34 |
echo '#!/bin/sh' > %{i}/etc/profile.d/dependencies-setup.sh
|
35 |
echo '#!/bin/tcsh' > %{i}/etc/profile.d/dependencies-setup.csh
|
36 |
echo requiredtools `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'`
|
37 |
for tool in `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'`
|
38 |
do
|
39 |
case X$tool in
|
40 |
Xdistcc|Xccache )
|
41 |
;;
|
42 |
* )
|
43 |
toolcap=`echo $tool | tr a-z- A-Z_`
|
44 |
eval echo ". $`echo ${toolcap}_ROOT`/etc/profile.d/init.sh" >> %{i}/etc/profile.d/dependencies-setup.sh
|
45 |
eval echo "source $`echo ${toolcap}_ROOT`/etc/profile.d/init.csh" >> %{i}/etc/profile.d/dependencies-setup.csh
|
46 |
;;
|
47 |
esac
|
48 |
done
|
49 |
perl -p -i -e 's|\. /etc/profile\.d/init\.sh||' %{i}/etc/profile.d/dependencies-setup.sh
|
50 |
perl -p -i -e 's|source /etc/profile\.d/init\.csh||' %{i}/etc/profile.d/dependencies-setup.csh
|
51 |
|
52 |
# Generate python code from templates
|
53 |
./scripts/genTemplates.sh
|
54 |
|
55 |
%post
|
56 |
%{relocateConfig}etc/profile.d/dependencies-setup.sh
|
57 |
%{relocateConfig}etc/profile.d/dependencies-setup.csh
|
58 |
|
59 |
# setup approripate links and made post install procedure
|
60 |
. $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh
|
61 |
ln -s $YUI_ROOT/build $DDHOME/YUI
|
62 |
ln -s $YUI_ROOT $DDHOME/yui
|
63 |
mkdir -p $DDHOME/rss
|
64 |
ln -s $WEBTOOLS_ROOT/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Controllers $DDHOME/WEBTOOLS
|
65 |
pdir=$RPM_INSTALL_PREFIX/%{pkgrel}/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages
|
66 |
if [ `hostname` == "cmswttest.cern.ch" ]; then
|
67 |
${pdir}/scripts/post-install.sh https://cmsweb.cern.ch/dbs_discovery_wttest 8008
|
68 |
cat ${pdir}/DBSDD.conf | sed "s/# URL=/URL=/g" | sed "s/# PORT=/PORT=/g" > ${pdir}/DBSDD.conf.tmp
|
69 |
mv ${pdir}/DBSDD.conf.tmp ${pdir}/DBSDD.conf
|
70 |
else
|
71 |
${pdir}/scripts/post-install.sh `hostname` 8003
|
72 |
cat ${pdir}/DBSDD.conf | sed "s/# URL=/### _url_=/g" | sed "s/# PORT=/### _port_=/g" > ${pdir}/DBSDD.conf.tmp
|
73 |
mv ${pdir}/DBSDD.conf.tmp ${pdir}/DBSDD.conf
|
74 |
fi
|
75 |
if [ -n "${WEBTOOLS_CONF}" ] && [ -f ${WEBTOOLS_CONF}/dbs/DBParam ]; then
|
76 |
rm -f ${pdir}/DBParam
|
77 |
ln -s ${WEBTOOLS_CONF}/dbs/DBParam ${pdir}/DBParam
|
78 |
fi
|
79 |
###export TARGET_PROJECT=dbs-web
|