ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/tom.spec
Revision: 1.17
Committed: Fri Feb 6 12:18:15 2009 UTC (16 years, 2 months ago) by gowdy
Branch: MAIN
CVS Tags: condcore306, MEMCACHED_20090219_1, MEMCACHED_20090219, WEBTOOLS-APPS_20090217_1, WEBTOOLS-APPS_20090217, WEBTOOLS-APPS_20090216, condcore305, WEBTOOLS-APPS_20090212, WEBTOOLS-APPS_20090209_64bit, WEBTOOLS-APPS_20090206, T0M_0_0_4
Changes since 1.16: +2 -2 lines
Log Message:
Update to 004 and now file is generated without a version number

File Contents

# User Rev Content
1 gowdy 1.17 ### RPM cms tom T0M_0_0_4
2 sgysin 1.1 # the last string specifies the cvs tag to be used in the checkout command, don't know what the other strings are.
3 gowdy 1.3 ## NOCOMPILER
4 sgysin 1.1
5     %define cvstag %{realversion}
6     # define version of tom to use, realversion is supplied by CMS
7     %define tom_version %{realversion}
8    
9     Source: cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e&module=T0/src/java/tom&export=tom&tag=-r%{cvstag}&output=/tom.tar.gz
10     # RPM dependencies, if are RPM files
11 gowdy 1.4 Requires: java-jdk apache-ant apache-tomcat
12 sgysin 1.1
13     %prep
14     # this section is for preparation such as declaring variables
15    
16     %setup -n tom
17     # 'tom' matches the export parameter in line 7
18     # will un-tar the tom tar ball
19    
20     %build
21     # will be on top directory in tar ball
22     # make the war file using ant
23 gowdy 1.5 cd src/java/tom
24 gowdy 1.6 mkdir build temp
25 sgysin 1.1 echo "PWD=$PWD"
26     source $JAVA_JDK_ROOT/etc/profile.d/init.sh
27     export JAVA_HOME=$JAVA_JDK_ROOT
28     ant
29 gowdy 1.12 rm -rf %i/etc/profile.d
30     mkdir -p %i/etc/profile.d
31     echo '#!/bin/sh' > %{i}/etc/profile.d/dependencies-setup.sh
32     echo '#!/bin/tcsh' > %{i}/etc/profile.d/dependencies-setup.csh
33     echo requiredtools `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'`
34     for tool in `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'`
35     do
36     case X$tool in
37     Xdistcc|Xccache )
38     ;;
39     * )
40     toolcap=`echo $tool | tr a-z- A-Z_`
41     eval echo ". $`echo ${toolcap}_ROOT`/etc/profile.d/init.sh" >> %{i}/etc/profile.d/dependencies-setup.sh
42     eval echo "source $`echo ${toolcap}_ROOT`/etc/profile.d/init.csh" >> %{i}/etc/profile.d/dependencies-setup.csh
43     ;;
44     esac
45     done
46 sgysin 1.1
47     %install
48     # copy war file, %{i} means install area
49 gowdy 1.17 cp -p src/java/tom/build/tom.war %{i}/
50 gowdy 1.15 # copy properties file
51     cp -p src/java/tom/tom.properties %{i}/
52     chmod 700 %{i}/tom.properties
53 sgysin 1.1 # this is where I can modify the tomcat start script to add a parameter
54     # can not start or stop tomcat
55 gowdy 1.15
56 sgysin 1.1 %post
57     # installs script to set up environment
58     %{relocateConfig}etc/profile.d/dependencies-setup.sh
59     %{relocateConfig}etc/profile.d/dependencies-setup.csh
60 gowdy 1.13 # copy war file
61 gowdy 1.14 . $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh
62 gowdy 1.16 cp -p $RPM_INSTALL_PREFIX/%{pkgrel}/tom.war $APACHE_TOMCAT_ROOT/webapps
63 gowdy 1.15 mkdir -p $APACHE_TOMCAT_ROOT/temp/tom
64     sed "s:dir=:dir=$APACHE_TOMCAT_ROOT/temp/tom:;s%dataDir=%dataDir=file:///$APACHE_TOMCAT_ROOT/temp/tom%" $RPM_INSTALL_PREFIX/%{pkgrel}/tom.properties > $APACHE_TOMCAT_ROOT/etc/tom.properties
65     chmod 700 $APACHE_TOMCAT_ROOT/etc/tom.properties
66 sgysin 1.1
67     echo "##### tom install is complete #####"
68