#! /bin/bash #******************************************************************************* # E.S.O. - ACS project # # "@(#) $Id: buildJacORB,v 1.25 2012/01/09 14:39:47 tstaig Exp $" # # who when what # -------- -------- ---------------------------------------------- # almamgr 2003-03-11 created # sturolla 2005-10-09 ported to Bourne Shell and added external subroutine to check OS # jschwarz 2014-01-03 major modifications for move to JacORB 3.4 # #************************************************************************ # NAME # buildJacORB # # SYNOPSIS # # DESCRIPTION # This script is used to build JacORB and install it in the proper # ACS place ($ALMASW_ROOTDIR/$ALMASW_RELEASE/JacORB), # after having applied a number of patches. # The script assumes that: # - It is executed from the place where the JacORB download # tar ball is, together with all necessary patch files # - The environment variables # $ALMASW_ROOTDIR and $ALMASW_RELEASE # are set. # - The user has write permission in the installation directory # Any previous installation of JacORB will be erased. # # To download JacORB: # wget http://www.jacorb.org/releases/3.4/jacorb-3.4-source.zip # # FILES # # ENVIRONMENT # # RETURN VALUES # # CAUTIONS # # EXAMPLES # # SEE ALSO # # BUGS # #------------------------------------------------------------------------ # Load functions . standardUtilities # # Fetch operating system and release version # os_discovery LOG=buildJacORB.log # exec > $LOG 2>&1 date JACORB_VERSION=3.6.1 ALMASW_INSTDIR=$ALMASW_ROOTDIR/$ALMASW_RELEASE JACORB_SOURCES=`pwd`/../PRODUCTS CUR_DIR=`pwd` echo ==== Building JacORB from: $JACORB_SOURCES into: $ALMASW_INSTDIR if [ -d $JACORB_HOME ] then echo ==== JacORB build Directory exists. Removing it rm -rf $JACORB_HOME if [ $? -ne 0 ] then echo "========= FAILED ==========" exit 1 fi fi echo ==== Extracting package cd $ALMASW_INSTDIR unzip $JACORB_SOURCES/jacorb-$JACORB_VERSION-source.zip mv jacorb-$JACORB_VERSION $JACORB_HOME if [ $? -ne 0 ] then echo "========= FAILED ==========" exit 1 fi cd $JACORB_HOME # Apply a number of patches to JacORB. # All patches have been packed into one single patch command: # /bin/idltemplate # /build.xml # Original file produces hard coded classpath to installaiton # directory and is not relocatable # /idl/build.xml # Extend the set of services we build support for with Peoperty Service # /src/org/jacorb/idl/NameTable.java # /src/org/jacorb/idl/ScopedName.java # /src/org/jacorb/idl/parser.cup (v. 3.3 and later: JS changed to put change in parser source -- was in parser.java, which is generated in a full build) # Fix IDL compiler and handling of prefix/package names # /src/org/jacorb/orb/CDRInputStream.java # Fix problem with CDRInputStream.java read boolean # /idl/omg/orb.idl # Uncommented pragma inhibit_code_generation. # This was uncommented with JacORB 1.1.4, but it is commented now. # /src/org/jacorb/idl/StructType.java # Added support for forward declarations in IDL with JacORB 2.2.4 # # The patch file has been generated from the following command: # LC_ALL=C TZ=UTC0 diff -Naur jacorb-$JACORB_VERSION/ JacORB/ > JacORB-all-2014-01-03.patch # # corbaloc reference should have been resolved as GIOP 1.0 by default, but is GIOP 1.2. # src/org/jacorb/orb/iiop/IIOPProfile.java # .. and we get new comulative patch: JacORB-ACS-2006-07-31.patch.gz echo ==== Cumulative Patch if [ ! -f $JACORB_SOURCES/JacORB-all-2015-02-26.patch ] then echo "file $JACORB_SOURCES/JacORB-all-2015-02-26.patch not found" echo "Installation aborted" exit 3 fi patch -p1 < $JACORB_SOURCES/JacORB-all-2015-02-26.patch if [ $? -ne 0 ] then echo "========= FAILED ==========" exit 1 fi # # JacORB interoperability IR patch # #echo ==== IR Patch #if [ -f $JACORB_SOURCES/JacORB-ACS-IR-2007-02-12.patch.gz ] #then #gunzip -c $JACORB_SOURCES/JacORB-ACS-IR-2007-02-12.patch.gz >$JACORB_SOURCES/JacORB-ACS-IR-2007-02-12.patch #else #echo "file $JACORB_SOURCES/JacORB-ACS-IR-2007-02-12.patch.gz not found" #echo "Installation aborted" #exit 3 #fi #if [ "$OS" = "$CYGWIN_VER" ]; then #dos2unix $JACORB_SOURCES/JacORB-ACS-IR-2007-02-12.patch #dos2unix $JACORB_HOME/idl/omg/Corba.idl #fi #patch -p1 < $JACORB_SOURCES/JacORB-ACS-IR-2007-02-12.patch #if [ $? -ne 0 ] #then #rm $JACORB_SOURCES/JacORB-ACS-IR-2007-02-12.patch #echo "========= FAILED ==========" #exit 1 #else #rm $JACORB_SOURCES/JacORB-ACS-IR-2007-02-12.patch #fi # # # JacORB JVM-fork patch to avoid spurious JVM death in # # #echo ==== JVM fork patch #if [ -f $JACORB_SOURCES/JacORB-ACS-2007-10-19.patch.gz ] #then #gunzip -c $JACORB_SOURCES/JacORB-ACS-2007-10-19.patch.gz >$JACORB_SOURCES/JacORB-ACS-2007-10-19.patch #else #echo "file $JACORB_SOURCES/JacORB-ACS-2007-10-19.patch.gz not found" #echo "Installation aborted" #exit 3 #fi #if [ "$OS" = "$CYGWIN_VER" ]; then #dos2unix $JACORB_SOURCES/JacORB-ACS-2007-10-19.patch #fi #patch -p1 < $JACORB_SOURCES/JacORB-ACS-2007-10-19.patch #if [ $? -ne 0 ] #then #rm $JACORB_SOURCES/JacORB-ACS-2007-10-19.patch #echo "========= FAILED ==========" #exit 1 #else #rm $JACORB_SOURCES/JacORB-ACS-2007-10-19.patch #fi # # JacORB ACS profiling patch # #echo ==== ACS Profiling Patch #if [ -f $JACORB_SOURCES/JacORB-ACS-profiling-2009-09-18.patch.gz ] #then #gunzip -c $JACORB_SOURCES/JacORB-ACS-profiling-2009-09-18.patch.gz >$JACORB_SOURCES/JacORB-ACS-profiling-2009-09-18.patch #else #echo "file $JACORB_SOURCES/JacORB-ACS-profiling-2009-09-18.patch.gz not found" #echo "Installation aborted" #exit 3 #fi #if [ "$OS" = "$CYGWIN_VER" ]; then #dos2unix $JACORB_SOURCES/JacORB-ACS-profiling-2009-09-18.patch #fi #patch -p1 < $JACORB_SOURCES/JacORB-ACS-profiling-2009-09-18.patch #if [ $? -ne 0 ] #then #rm $JACORB_SOURCES/JacORB-ACS-profiling-2009-09-18.patch #echo "========= FAILED ==========" #exit 1 #else #rm $JACORB_SOURCES/JacORB-ACS-profiling-2009-09-18.patch #fi # # # JacORB ACS profiling update patch # #echo ==== ACS Profiling Update Patch #if [ -f $JACORB_SOURCES/JacORB-ACS-profiling-update-2011-07-04.patch.gz ] #then #gunzip -c $JACORB_SOURCES/JacORB-ACS-profiling-update-2011-07-04.patch.gz >$JACORB_SOURCES/JacORB-ACS-profiling-update-2011-07-04.patch #else #echo "file $JACORB_SOURCES/JacORB-ACS-profiling-update-2011-07-04.patch.gz not found" #echo "Installation aborted" #exit 3 #fi #if [ "$OS" = "$CYGWIN_VER" ]; then #dos2unix $JACORB_SOURCES/JacORB-ACS-profiling-update-2011-07-04.patch #fi #patch -p1 < $JACORB_SOURCES/JacORB-ACS-profiling-update-2011-07-04.patch #if [ $? -ne 0 ] #then #rm $JACORB_SOURCES/JacORB-ACS-profiling-update-2011-07-04.patch #echo "========= FAILED ==========" #exit 1 #else #rm $JACORB_SOURCES/JacORB-ACS-profiling-update-2011-07-04.patch #fi echo ==== JacORB Version Patch cp core/src/main/java-templates/org/jacorb/util/Version.java core/src/main/java-templates/org/jacorb/util/Version.java.bak BUILD_TS=`date "+%d %B %Y %H:%M"` sed -e "s/@releaseYear@/2015/;s/@timestamp@/$BUILD_TS/;s/@buildNumber@/ACS build based on 150a4c9/;s/@project.version@/$JACORB_VERSION/" < core/src/main/java-templates/org/jacorb/util/Version.java.bak > core/src/main/java-templates/org/jacorb/util/Version.java echo "========= Done with unpacking and patching, can compile now... ==========" #echo ==== Building jaco #ant jaco #if [ $? -ne 0 ] #then #echo "========= FAILED ==========" #exit 1 #fi echo "==== Building jars" cd $JACORB_HOME/ # get rid of precompiled jacorb jars which sometimes mess with the classpath # to the effect that incompatible versions of some org.omg interface come in from the JDK libs ###ant realclean || exit 1 # The files to purge are extracted from ACS-jacorb 3.4 build.xml directive rm -f $JACORB_HOME/lib/jacorb-3.6.1.jar rm -f $JACORB_HOME/lib/idl.jar #rm -f $JACORB_HOME/lib/jacorb-sources.jar #This jar is not present anymore rm -f $JACORB_HOME/lib/jacorb-services-3.6.1.jar ###cd $JACORB_SOURCES echo "==== Build Notification service IDL" cd $JACORB_HOME/idl echo "==== Copy extra IDLs CosProperty(Service), DsLogAdmin and AVStreams into JacORB directory tree" cd $JACORB_HOME/idl/omg cp $ACE_ROOT/TAO/orbsvcs/orbsvcs/CosProperty.idl . if [ $? -ne 0 ] then echo "========= FAILED ==========" exit 1 fi cp $ACE_ROOT/TAO/orbsvcs/orbsvcs/DsLogAdmin.idl . if [ $? -ne 0 ] then echo "========= FAILED ==========" exit 1 fi mkdir tao cp $ACE_ROOT/TAO/tao/TimeBase.pidl tao/ if [ $? -ne 0 ] then echo "========= FAILED ==========" exit 1 fi cp $ACE_ROOT/TAO/orbsvcs/orbsvcs/AVStreams.idl . if [ $? -ne 0 ] then echo "========= FAILED ==========" exit 1 fi ###cd $JACORB_HOME/idl echo ==== Build with extra IDLs cd $JACORB_HOME if [ "$OS" = "$CYGWIN_VER" ]; then dos2unix $JACORB_HOME/bin/idl fi # the main jacorb compilation # To include debug information, exchange the following two lines: #ant -DJVERSION=$JACORB_VERSION -Ddebug=true -Ddebuglevel=lines,vars,source all mvn clean install -e -X -DskipTests=true -DskipPDFGeneration=true -DskipJavadoc=true -Dmaven.clean.failOnError=false -Dmaven.javadoc.failOnError=false ###CLASSPATH="" ant -DJVERSION=$JACORB_VERSION ###if [ $? -ne 0 ] ###then ### echo "========= FAILED ==========" ### exit 1 ###fi # 3.4 splits jacorb.jar into implementation and omg stub jars # The latter jar will be placed into an endorsed directory # so that it takes precedence over the JDK's obsolete CORBA # support. mkdir $JACORB_HOME/lib/endorsed mv $JACORB_HOME/lib/jacorb-omgapi-3.6.1.jar $JACORB_HOME/lib/endorsed cd $CUR_DIR echo "==== Built with extra IDLs" echo "==== JacORB fully built ==========" echo "Make sure that the following environment variables" echo "are set before using JacORB:" echo " - JACORB_HOME=$JACORB_HOME" echo " - CLASSPATH contains: $JACORB_HOME/lib/jacorb-3.6.1.jar:$JACORB_HOME/lib/jacorb-services-3.6.1.jar:$JACORB_HOME/lib/idl.jar" echo $ - jacorb-omgapii-3.6.1.jar is in $JACORB_HOME/lib/endorsed which is defined in java.endorsed.dirs echo " - PATH contains: $JACORB_HOME/bin" echo "========= DONE ==========" echo JacORB installation done! date