Revision: | 1.25 |
Committed: | Tue Aug 18 14:28:31 2009 UTC (15 years, 8 months ago) by valya |
Branch: | MAIN |
CVS Tags: | DAS_20100302_slc5_amd64_gcc434, DBS_20100217_slc5_amd64_gcc434, DAS_20100217_slc5_amd64_gcc434, DAS_20100216b_slc5_amd64_gcc434, DAS_20100216_slc5_amd64_gcc434, dg20100201-dbs3, dg20100129-dbs3, dg20100128-dbs3, DAS_20100127_slc5_amd64_gcc434, DAS_20100126_slc5_amd64_gcc434, DBS-APP_20100122_slc4, DBS-APP_20100121_slc4, DBS-WEB_20100120_slc4, DBS-APP_20100120_slc4, DAS_20100119_slc5_amd64_gcc434, DBS-APP_20100118_slc4, DBS-WEB_20100118_slc4, DAS_20100115_slc5_amd64_gcc434, dg20100115-security, DBS-APP_20100114_slc4, DBS-WEB_20100113_slc4, dg20100112-security, DBS_20100111_slc5_amd64_gcc434, dg20100111-security, dg20100107b-wmcore, dg20100107-wmcore, DAS_20100105_slc5_amd64_gcc434, DAS_20091221_slc5_amd64_gcc434, DAS_20091214_slc5_amd64_gcc434, dg20091211-couchdb, dg20091210-phedex, dg20091203c-comp-base, DD_20091208_slc5_amd64_gcc434, DAS_20091208_slc5_amd64_gcc434, FILEMOVER_20091208_slc5_amd64_gcc434, DBS_20091208_slc5_amd64_gcc434, dg20091203b-comp-base, dg20091203-comp-base, DQMCATTEST_0_0_1, FILEMOVER_20091118, DBS-APPS_20090929, DAS_20091117, BUILDBOT_01, CERNOIDv02, DBS-WEB_20091021, CouchDB_0_10_0, CERNOIDv01, WMCORE-before-refactor, DBS-WEB_20091012, PerfSuiteDB_20090930, DBS-WEB_20090921, PerfSuiteDB_20090916, FILEMOVER_20090910, PerfSuiteDB_20090904_almost_stable, DBS-WEB_20090817, PerfSuiteDB_20090904, FILEMOVER_20090828, PerfSuiteDB_20090901, DBS-APPS_20090706, forHEARTBEATr04, RPMVERIFY_0_2, forHEARTBEATr01, WEBTOOLS_APPS_20090817 |
Changes since 1.24: | +1 -1 lines |
Log Message: | Increase log-level |
# | User | Rev | Content |
---|---|---|---|
1 | valya | 1.22 | ### RPM cms webtools-base 0.1.16 |
2 | valya | 1.1 | ## 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 | valya | 1.22 | %define cvstag V01-03-32 |
6 | valya | 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 | valya | 1.18 | Requires: python cherrypy py2-cheetah yui webtools py2-pyopenssl |
9 | valya | 1.1 | Provides: perl(CGI) |
10 | Provides: perl(Crypt::CBC) | ||
11 | Provides: perl(SecurityModule) | ||
12 | Provides: perl(DBI) | ||
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 | ||
20 | echo '#!/bin/tcsh' > %{i}/etc/profile.d/dependencies-setup.csh | ||
21 | echo requiredtools `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` | ||
22 | for tool in `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` | ||
23 | do | ||
24 | case X$tool in | ||
25 | Xdistcc|Xccache ) | ||
26 | ;; | ||
27 | * ) | ||
28 | toolcap=`echo $tool | tr a-z- A-Z_` | ||
29 | eval echo ". $`echo ${toolcap}_ROOT`/etc/profile.d/init.sh" >> %{i}/etc/profile.d/dependencies-setup.sh | ||
30 | eval echo "source $`echo ${toolcap}_ROOT`/etc/profile.d/init.csh" >> %{i}/etc/profile.d/dependencies-setup.csh | ||
31 | ;; | ||
32 | esac | ||
33 | done | ||
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/Applications | ||
42 | cp -r Applications/base %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Applications | ||
43 | cp cmsWeb %i/bin | ||
44 | valya | 1.2 | |
45 | |||
46 | valya | 1.3 | cat << \EOF > %i/bin/base_init |
47 | valya | 1.2 | #!/bin/bash |
48 | # | ||
49 | # dbs_discovery This script runs CMS DBS Data Discovery service | ||
50 | # | ||
51 | # chkconfig: 345 05 95 | ||
52 | |||
53 | if [ -z ${WEBTOOLS_BASE_ROOT} ]; then | ||
54 | echo $"The WEBTOOLS_BASE_ROOT environment is not set" | ||
55 | exit 1 | ||
56 | fi | ||
57 | |||
58 | RETVAL=$? | ||
59 | |||
60 | valya | 1.19 | export BONSAI_KEY=/data/projects/conf/certs/hostkey.pem |
61 | export BONSAI_CA=/data/projects/conf/certs/hostcert.pem | ||
62 | |||
63 | valya | 1.2 | port=7999 |
64 | valya | 1.10 | pid=`ps auxw | grep WSServer | grep $port | grep -v grep | awk '{print $2}'` |
65 | valya | 1.2 | base=base |
66 | valya | 1.4 | if [ -n "$WEBTOOLS_BASEURL" ]; then |
67 | valya | 1.21 | url="$WEBTOOLS_BASEURL" |
68 | valya | 1.4 | else |
69 | valya | 1.21 | url="$base" |
70 | valya | 1.4 | fi |
71 | valya | 1.25 | cmd="cmsWeb --base-url=$url --port $port --default-page /WSServer/ --log-level 100 --log-file /data/projects/base/base.log" |
72 | valya | 1.2 | |
73 | case "$1" in | ||
74 | restart) | ||
75 | echo $"Checking for existing WSServer..." | ||
76 | if [ ! -z ${pid} ]; then | ||
77 | kill -9 ${pid} | ||
78 | fi | ||
79 | echo $"Restart WSServer..." | ||
80 | nohup ${cmd} 2>&1 1>& /dev/null < /dev/null & | ||
81 | ;; | ||
82 | start) | ||
83 | if [ ! -z ${pid} ]; then | ||
84 | kill -9 ${pid} | ||
85 | fi | ||
86 | nohup ${cmd} 2>&1 1>& /dev/null < /dev/null & | ||
87 | ;; | ||
88 | status) | ||
89 | if [ ! -z ${pid} ]; then | ||
90 | echo $"${base} is running, pid=${pid}" | ||
91 | exit 0 | ||
92 | fi | ||
93 | echo $"${base} is stopped" | ||
94 | exit 3 | ||
95 | ;; | ||
96 | stop) | ||
97 | if [ ! -z ${pid} ]; then | ||
98 | kill -9 ${pid} | ||
99 | fi | ||
100 | ;; | ||
101 | *) | ||
102 | echo $"Usage: $0 {start|stop|status|restart}" | ||
103 | exit 1 | ||
104 | ;; | ||
105 | esac | ||
106 | |||
107 | exit $RETVAL | ||
108 | |||
109 | EOF | ||
110 | valya | 1.17 | cat %i/bin/base_init | sed "s/--port/--ssl --port/g" > %i/bin/ssl_base_init |
111 | chmod a+x %i/bin/*base_init | ||
112 | valya | 1.2 | |
113 | valya | 1.1 | %post |
114 | %{relocateConfig}etc/profile.d/dependencies-setup.sh | ||
115 | %{relocateConfig}etc/profile.d/dependencies-setup.csh | ||
116 | perl -p -i -e "s!\@RPM_INSTALL_PREFIX\@!$RPM_INSTALL_PREFIX/%pkgrel!" $RPM_INSTALL_PREFIX/%pkgrel/bin/cmsWeb | ||
117 |