1 |
< |
### RPM cms dbs-server DBS_1_0_8 |
1 |
> |
### RPM cms dbs-server DBS_1_1_5 |
2 |
> |
|
3 |
> |
%define cvstag %{realversion} |
4 |
> |
# define version of DBS to use, it's schema version |
5 |
> |
%define dbs_version %{realversion} |
6 |
|
|
3 |
– |
%define cvstag %realversion |
7 |
|
Source: cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e&module=DBS/Servers/JavaServer&export=DBS&tag=-r%{cvstag}&output=/dbs-server.tar.gz |
8 |
|
Requires: apache-ant mysql mysql-deployment oracle apache-tomcat java-jdk dbs-schema |
9 |
|
|
15 |
|
%build |
16 |
|
echo "PWD=$PWD" |
17 |
|
cd Servers/JavaServer |
18 |
< |
ver="DBS_1_0_8" |
18 |
> |
|
19 |
> |
# retrive which DBS schema to use |
20 |
> |
export DBS_SCHEMA=`grep "^use " $DBS_SCHEMA_ROOT/lib/Schema/NeXtGen/DBS-NeXtGen-MySQL_DEPLOYABLE.sql | awk '{print $2}' | sed "s/;//g"` |
21 |
> |
|
22 |
|
# fix context.xml file |
23 |
|
cat > etc/context.xml << EOF_CONTEXT |
24 |
|
<Context path="/servlet/DBSServlet" docBase="DBSServlet" debug="5" reloadable="true" crossContext="true"> |
25 |
< |
<SchemaOwner schemaowner="${ver}" /> |
26 |
< |
<SupportedSchemaVersion schemaversion="${ver}" /> |
27 |
< |
<SupportedClientVersions clientversions="DBS_1_0_1, DBS_1_0_5, DBS_1_0_7, DBS_1_0_8"/> |
25 |
> |
<SchemaOwner schemaowner="%{dbs_version}" /> |
26 |
> |
<SupportedSchemaVersion schemaversion="%{dbs_version}" /> |
27 |
> |
<SupportedClientVersions clientversions="DBS_1_0_1, DBS_1_0_5, DBS_1_0_7, DBS_1_0_8, DBS_1_0_9, DBS_1_1_2, DBS_1_1_3 "/> |
28 |
|
<DBSBlockConfig maxBlockSize="2000000000000" maxBlockFiles="100" /> |
29 |
< |
|
29 |
> |
|
30 |
|
<Resource name="jdbc/dbs" |
31 |
|
auth="Container" |
32 |
|
type="javax.sql.DataSource" |
36 |
|
username="dbs" |
37 |
|
password="cmsdbs" |
38 |
|
driverClassName="org.gjt.mm.mysql.Driver" |
39 |
< |
url="jdbc:mysql://localhost:3316/%{cvstag}?autoReconnect=true"/> |
39 |
> |
url="jdbc:mysql://localhost:3316/${DBS_SCHEMA}?autoReconnect=true"/> |
40 |
|
</Context> |
41 |
|
EOF_CONTEXT |
42 |
|
|
174 |
|
MYSQL_PID=$MYSQL_PATH/mysqld.pid |
175 |
|
MYSQL_ERR=$MYSQL_PATH/error.log |
176 |
|
# grant permissions to CMS MySQL DBS account |
177 |
< |
echo "+++ Grand permission to dbs account, DBS schema ${ver} ..." |
177 |
> |
echo "+++ Grand permission to dbs account, DBS schema %{dbs_version} ..." |
178 |
|
#echo "$MYSQL_ROOT/bin/mysql -udbs -pcmsdbs --socket=$MYSQL_SOCK" |
179 |
< |
echo "$DBS_SCHEMA_ROOT/lib/DBS-NeXtGen-MySQL_DEPLOYABLE.sql" |
179 |
> |
echo "$DBS_SCHEMA_ROOT/lib/Schema/NeXtGen/DBS-NeXtGen-MySQL_DEPLOYABLE.sql" |
180 |
|
# DBS uses trigger which requires to have SUPER priveleges, so we'll create DB using root |
181 |
|
# and delegate this to dbs account. |
182 |
< |
$MYSQL_ROOT/bin/mysql -uroot -pcms --socket=$MYSQL_SOCK < $DBS_SCHEMA_ROOT/lib/DBS-NeXtGen-MySQL_DEPLOYABLE.sql |
183 |
< |
$MYSQL_ROOT/bin/mysql --socket=$MYSQL_SOCK -uroot -pcms mysql -e "GRANT ALL ON ${ver}.* TO dbs@localhost;" |
182 |
> |
$MYSQL_ROOT/bin/mysql -uroot -pcms --socket=$MYSQL_SOCK < $DBS_SCHEMA_ROOT/lib/Schema/NeXtGen/DBS-NeXtGen-MySQL_DEPLOYABLE.sql |
183 |
> |
$MYSQL_ROOT/bin/mysql --socket=$MYSQL_SOCK -uroot -pcms mysql -e "GRANT ALL ON %{dbs_version}.* TO dbs@localhost;" |
184 |
|
|
185 |
|
# I need to copy/deploy DBS.war file into tomcat area |
186 |
|
cp $DBS_SERVER_ROOT/Servers/JavaServer/DBS.war $APACHE_TOMCAT_ROOT/webapps |