This Guide assumes you are trying to build GPIR to run inside your personal tomcat workspace as described in TomcatConfig.

GPIR Installation from http://gridport.net/services/gpir/installation.html

1. Prerequisites

Download and install at least Java 1.4.2._xx. openSUSE 10.2 and 10.3 will default using Java 1.5.x and we should stick with these defaults. Using YAST to select the Java and Java Developer patterns will install Java and Tomcat appropriately.

Download and unpack Maven 1.0.2. (The GridPort? Demo Portal has not been tested with more recent versions of Maven).

2. Environment

Set JAVA_HOME and MAVEN_HOME environment variables and make sure they are in your path. JAVA_HOME should be set automatically for new shell's after Java is installed. Maven is not a packaged and you run it directly from the unpacked directory.

example:

### DEV SOFTWARE
export PATH=/home/$user/maven-1.0.2/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/java
export MAVEN_HOME=/home/$user/maven-1.0.2
export PATH=${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${PATH}

### SERVICE ENVIRONMENT
export CATALINA_HOME=/usr/share/tomcat55
export CATALINA_BASE=/home/$user/tomcat

$CATALINA_HOME and $CATALINA_BASE should be set according to the TomcatConfig instructions.

3. Installation

Download GPIR http://gridport.net/services/gpir/gpir-download.html and unpack it (version 1.2.2 as of this writing).

tar xvfz gpir-1.2.2.tar.gz
cd gpir-1.2.2
# see the patches below before the next step
maven install -Dinitdb=true 

After the build completes you can stop and restart your personal tomcat instance:

$HOME/bin/tc5 stop
$HOME/bin/tc5 start

NOTE: edit ~/gpir-version/project.properties to add http://mirrors.ibiblio.org/pub/mirrors/maven as the first entry in the line beginning with maven.repo.remote=)

You need to patch the maven.xml configuration file to recognize the seperation of $CATALINA_HOME and $CATALINA_BASE:

patch --ignore-whitespace --backup maven.xml << EOF
77c77
<            dest="\${env.CATALINA_HOME}/webapps/gpir"/>
---
>            dest="\${env.CATALINA_BASE}/webapps/gpir"/>
92c92
<         <delete dir="\${env.CATALINA_HOME}/webapps/\${pom.artifactId}"
---
>         <delete dir="\${env.CATALINA_BASE}/webapps/\${pom.artifactId}"
EOF

The projects.properties file also needs to be update to reference $CATALINA_BASE appropriately:

patch --ignore-whitespace --backup project.properties << EOF
4c4
< db.url=jdbc:hsqldb:file:\${env.CATALINA_HOME}/webapps/gpir/WEB-INF/db/gpir
---
> db.url=jdbc:hsqldb:file:\${env.CATALINA_BASE}/webapps/gpir/WEB-INF/db/gpir
EOF

Then follow the build instructions. This will put GPIR in your personal working directory of tomcat.

The '-Dinitdb=true' argument will initialize the database to its default state. If you need to re-deploy the service without re-initializing the database you should omit this argument. The web service URL of the GPIR service is http://localhost:8080/gpir/webservices. The administrative client is located at http://localhost:8080/gpir. The default user is tomcat, password tomcat.