diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-05-18 18:05:36 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-05-24 12:04:03 -0500 |
commit | 739c50ee20704128e0bf4605ba7ca392d95070a2 (patch) | |
tree | 7658519f22f26cea6c7f7ed3e80cbc8ddba79b53 | |
parent | 924403a14e92112c3c3d696319759b65eb57a30c (diff) | |
download | pki-739c50ee20704128e0bf4605ba7ca392d95070a2.tar.gz pki-739c50ee20704128e0bf4605ba7ca392d95070a2.tar.xz pki-739c50ee20704128e0bf4605ba7ca392d95070a2.zip |
Added script to link JSS library.
The JSS library uses different paths on 32-bit and 64-bit platforms.
A script has been added to create a symbolic link such that Eclipse
can use the library without changing the classpath file. The script
could be extended further to simplify setting up the development
environment such as installing the dependencies.
Ticket #171
-rw-r--r-- | .classpath | 2 | ||||
-rwxr-xr-x | scripts/dev_setup | 55 |
2 files changed, 56 insertions, 1 deletions
diff --git a/.classpath b/.classpath index b07126a31..8e075a25e 100644 --- a/.classpath +++ b/.classpath @@ -25,7 +25,6 @@ <classpathentry kind="lib" path="/usr/share/java/idm-console-mcc.jar"/> <classpathentry kind="lib" path="/usr/share/java/idm-console-nmclf.jar"/> <classpathentry kind="lib" path="/usr/share/java/jakarta-commons-httpclient.jar"/> - <classpathentry kind="lib" path="/usr/lib64/java/jss4.jar"/> <classpathentry kind="lib" path="/usr/share/java/junit4.jar"/> <classpathentry kind="lib" path="/usr/share/java/ldapjdk.jar"/> <classpathentry kind="lib" path="/usr/share/java/glassfish-jaxb/jaxb-impl.jar"/> @@ -42,5 +41,6 @@ <classpathentry kind="lib" path="/usr/share/java/xml-commons-apis.jar"/> <classpathentry kind="lib" path="/usr/share/tomcat6/lib/catalina.jar"/> <classpathentry kind="lib" path="/usr/share/java/istack-commons-runtime.jar"/> + <classpathentry kind="lib" path="/usr/share/java/jss/jss4.jar"/> <classpathentry kind="output" path="build/classes"/> </classpath> diff --git a/scripts/dev_setup b/scripts/dev_setup new file mode 100755 index 000000000..7dd12a43f --- /dev/null +++ b/scripts/dev_setup @@ -0,0 +1,55 @@ +#!/bin/bash +# BEGIN COPYRIGHT BLOCK +# (C) 2012 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +## Always switch into this base directory +## prior to script execution so that all +## of its output is written to this directory + +cd `dirname $0` + + +## +## This script MUST be run as root! +## + +ROOTUID=0 + +OS=`uname` +if [ "${OS}" = "Linux" ] ; then + MY_EUID=`/usr/bin/id -u` + MY_UID=`/usr/bin/id -ur` + USERNAME=`/usr/bin/id -un` +else + printf "ERROR: Unsupported operating system '${OS}'!\n" + exit 255 +fi + +if [ "${MY_UID}" != "${ROOTUID}" ] && + [ "${MY_EUID}" != "${ROOTUID}" ] ; then + printf "ERROR: The '$0' script must be run as root!\n" + exit 255 +fi + + +if [ -f "/usr/lib64/java/jss4.jar" ] ; then + JSS_TARGET=/usr/lib64/java/jss4.jar + ARCH=64 + +elif [ -f "/usr/lib/java/jss4.jar" ] ; then + JSS_TARGET=/usr/lib/java/jss4.jar + ARCH=32 + +else + printf "ERROR: jss4.jar not found\n" + exit 255 +fi + +JSS_LINK=/usr/share/java/jss/jss4.jar + +mkdir -p `dirname $JSS_LINK` +ln -sf $JSS_TARGET $JSS_LINK + +printf "Created symlink to $ARCH-bit JSS library in $JSS_LINK.\n" |