ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/dbs-light.spec
(Generate patch)

Comparing COMP/CMSDIST/dbs-light.spec (file contents):
Revision 1.4 by valya, Sat Sep 22 02:01:00 2007 UTC vs.
Revision 1.7 by valya, Mon Sep 24 13:44:03 2007 UTC

# Line 8 | Line 8
8   %define cvstag %v
9   Source: cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e&module=DBS&export=DBS&tag=-r%{cvstag}&output=/dbs-light.tar.gz
10   #Source: cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e&module=DBS/{Servers/JavaServer,Clients/Python,Schema/NeXtGen/DBS-NeXtGen-SQLite_DEPLOYABLE.sql}&export=DBS&tag=-r%{cvstag}&output=/dbs-light.tar.gz
11 < Requires: python openssl apache-ant sqlite
11 > Requires: python openssl apache-ant sqlite java-jdk
12   #Requires: apache-ant mysql oracle apache-tomcat
13  
14   %prep
15   %setup -n DBS
16 +
17   %build
18   echo "PWD=$PWD"
19 + env | grep JAVA
20 + export JAVA_HOME=$JAVA_JDK_ROOT
21   # server
22   cd Servers/JavaServer
23   echo "PWD=$PWD"
24 < ant --noconfig dist
24 > ant --noconfig jar
25   cd ../../
26   # client
27   (make DBSHOME=%_builddir/DBS/Clients/Python )
# Line 28 | Line 31 | cd ../../
31   %install
32   mkdir -p %{i}/bin
33   mkdir -p %{i}/lib
34 +
35 + # client
36 + mkdir -p %{i}/Clients/Python
37 + cp -r Clients/Python/DBSAPI %{i}/Clients/Python
38 +
39 + # schema
40 + ls -l Schema/NeXtGen
41 + mkdir -p %{i}/Schema/NeXtGen
42 + cp -r Schema/NeXtGen/DBS-NeXtGen-SQLite_DEPLOYABLE.sql  %{i}/Schema/NeXtGen/
43 +
44   # server
45   mkdir -p %{i}/Servers/JavaServer/
33 cp -r Servers/JavaServer/* %{i}/Servers/JavaServer
46  
47   mkdir -p %{i}/etc/profile.d
48   (echo "#!/bin/sh"; \
49   echo "source $PYTHON_ROOT/etc/profile.d/init.sh"; \
50   echo "source $SQLITE_ROOT/etc/profile.d/init.sh"; \
51   echo "source $APACHE_ANT_ROOT/etc/profile.d/init.sh"; \
52 + echo "source $JAVA_JDK_ROOT/etc/profile.d/init.sh"; \
53   echo "source $OPENSSL_ROOT/etc/profile.d/init.sh"; \
54   echo -e "export PYTHONPATH=\044PYTHONPATH:\044DBS_LIGHT_ROOT/Clients/Python:\044DBS_LIGHT_ROOT/Clients/Python/DBSAPI"; \
55   echo -e "export DBS_CLIENT_CONFIG=\044DBS_LIGHT_ROOT/Clients/Python/DBSAPI/dbs.config"; \
56 + echo -e "export DBS_SERVER_CONFIG=\044DBS_LIGHT_ROOT/Servers/JavaServer/etc/context.xml"; \
57 + echo -e "export JAVA_HOME=\044JAVA_JDK_ROOT"; \
58   ) > %{i}/etc/profile.d/dependencies-setup.sh
59  
60   (echo "#!/bin/tcsh"; \
61   echo "source $PYTHON_ROOT/etc/profile.d/init.csh"; \
62   echo "source $SQLITE_ROOT/etc/profile.d/init.csh"; \
63   echo "source $APACHE_ANT_ROOT/etc/profile.d/init.csh"; \
64 + echo "source $JAVA_JDK_ROOT/etc/profile.d/init.csh"; \
65   echo "source $OPENSSL_ROOT/etc/profile.d/init.csh"; \
66   echo -e "setenv PYTHONPATH \044PYTHONPATH:\044DBS_LIGHT_ROOT/Clients/Python:\044DBS_LIGHT_ROOT/Clients/Python/DBSAPI"; \
67 < echo -e "setenv DBS_CLIENT_CONFIG=\044DBS_LIGHT_ROOT/Clients/Python/DBSAPI/dbs.config"; \
67 > echo -e "setenv DBS_CLIENT_CONFIG \044DBS_LIGHT_ROOT/Clients/Python/DBSAPI/dbs.config"; \
68 > echo -e "setenv DBS_SERVER_CONFIG \044DBS_LIGHT_ROOT/Servers/JavaServer/etc/context.xml"; \
69 > echo -e "setenv JAVA_HOME \044JAVA_JDK_ROOT"; \
70   ) > %{i}/etc/profile.d/dependencies-setup.csh
71  
72 < # client
73 < mkdir -p %{i}/Clients/Python
74 < cp -r Clients/Python/DBSAPI %{i}/Clients/Python
72 > # compile server code
73 > #cd Servers/JavaServer
74 > #ant --noconfig jar
75 > #ls -l $PWD
76 > #find . -name "*.jar"
77 > #cd ../../
78 > cp -r Servers/JavaServer/* %{i}/Servers/JavaServer
79  
58 # schema
59 ls -l Schema/NeXtGen
60 mkdir -p %{i}/Schema/NeXtGen
61 cp -r Schema/NeXtGen/DBS-NeXtGen-SQLite_DEPLOYABLE.sql  %{i}/Schema/NeXtGen/
62
80   %post
81   %{relocateConfig}etc/profile.d/dependencies-setup.sh
82   %{relocateConfig}etc/profile.d/dependencies-setup.csh
# Line 79 | Line 96 | sed "s/DBSHOME/#DBSHOME/g" |
96   sed "s/JAVAHOME/#JAVAHOME/g" |
97   sed "s/MODE=POST/#MODE=POST/g" > \
98      $RPM_INSTALL_PREFIX/%{pkgrel}/Clients/Python/DBSAPI/dbs.config.tmp
99 +
100 + #if [ -z $JAVA_HOME ]; then
101 + #   echo "########################## IMPORTANT ##############################"
102 + #   echo "# In order to install DBS code you MUST have JAVA on your machine #"
103 + #   echo "# DBS code relies on JAVA version 1.5.0_10 and above              #"
104 + #   echo "# Please install JAVA and setup JAVA_HOME environtment and re-run #"
105 + #   echo "###################################################################"
106 + #   exit 1
107 + #fi
108 +
109   cat >> $RPM_INSTALL_PREFIX/%{pkgrel}/Clients/Python/DBSAPI/dbs.config.tmp << EOF
110   # RPM AUTO-CONFIG FOR STANDALONE MODE
111   MODE=EXEC
# Line 106 | Line 133 | cat > $RPM_INSTALL_PREFIX/%{pkgrel}/Serv
133   <DBSBlockConfig maxBlockSize="20000" maxBlockFiles="50" />
134   </Context>
135   EOF
136 < cd $RPM_INSTALL_PREFIX/%{pkgrel}/Servers/JavaServer/
137 < ant --noconfig jar
138 < ls -l $PWD
139 < find . -name "*.jar"
136 >
137 > # obsolete code for reference, since it demonstrates how to do post-install compilation
138 > # Until we will ship proper version of JAVA in CMS RPMs I need this piece
139 > # to install jar file under local site. Compile using local JAVA.
140 > #cd $RPM_INSTALL_PREFIX/%{pkgrel}/Servers/JavaServer/
141 > #ant --noconfig jar
142 > #ls -l $PWD
143 > #find . -name "*.jar"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines