diff options
| author | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2009-03-27 00:59:17 +0000 |
|---|---|---|
| committer | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2009-03-27 00:59:17 +0000 |
| commit | b2e276565de7b76c6e2b5dade168fa88eb9399b8 (patch) | |
| tree | 6e4ad718061a6ea568a3761ef482e5574d83f7da | |
| parent | 19838bdf32ce33e8d14eb62f1aaf772bec52d88d (diff) | |
Bugzilla Bug #490947 - PrettyPrintCrl throws exceptions.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@339 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
| -rw-r--r-- | pki/base/java-tools/build.xml | 4 | ||||
| -rw-r--r-- | pki/base/java-tools/templates/pretty_print_cert_command_wrapper | 172 | ||||
| -rw-r--r-- | pki/base/java-tools/templates/pretty_print_crl_command_wrapper | 158 | ||||
| -rw-r--r-- | pki/dogtag/java-tools/pki-java-tools.spec | 4 |
4 files changed, 335 insertions, 3 deletions
diff --git a/pki/base/java-tools/build.xml b/pki/base/java-tools/build.xml index cb2ac2d21..43ad1d5f1 100644 --- a/pki/base/java-tools/build.xml +++ b/pki/base/java-tools/build.xml @@ -373,7 +373,7 @@ </exec> <delete file="./build/cmds/PKCS12Export.tmp"/> - <copy file="./templates/pki_java_command_wrapper" + <copy file="./templates/pretty_print_cert_command_wrapper" tofile="./build/cmds/PrettyPrintCert.tmp"/> <exec executable="sed" output="./build/cmds/PrettyPrintCert"> @@ -385,7 +385,7 @@ </exec> <delete file="./build/cmds/PrettyPrintCert.tmp"/> - <copy file="./templates/pki_java_command_wrapper" + <copy file="./templates/pretty_print_crl_command_wrapper" tofile="./build/cmds/PrettyPrintCrl.tmp"/> <exec executable="sed" output="./build/cmds/PrettyPrintCrl"> diff --git a/pki/base/java-tools/templates/pretty_print_cert_command_wrapper b/pki/base/java-tools/templates/pretty_print_cert_command_wrapper new file mode 100644 index 000000000..9f014ceee --- /dev/null +++ b/pki/base/java-tools/templates/pretty_print_cert_command_wrapper @@ -0,0 +1,172 @@ +#!/bin/sh +# +# --- BEGIN COPYRIGHT BLOCK --- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2007 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# + +# Check to insure that this script's original invocation directory +# has not been deleted! +CWD=`/bin/pwd > /dev/null 2>&1` +if [ $? -ne 0 ] ; then + echo "Cannot invoke '$0' from non-existent directory!" + exit 255 +fi + + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +PRODUCT=[PKI_PRODUCT] +COMMAND=[PKI_COMMAND] + + +############################################################################### +## (2) Check for valid usage of this command wrapper. ## +############################################################################### + + + +############################################################################### +## (3) Define helper functions. ## +############################################################################### + +invalid_operating_system() { + echo + echo "ERROR: '$0' does not execute on the '$1' operating system!" + echo +} + +invalid_architecture() { + echo + echo "ERROR: '$0' does not execute on the '$1' architecture!" + echo +} + + +############################################################################### +## (4) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +OS=`pkiname` +ARCHITECTURE=`pkiarch` + +if [ "${OS}" = "Linux" ] ; then + JAVA="java" + JAVA_OPTIONS="" + + if [ "${ARCHITECTURE}" = "i386" ] ; then + LD_LIBRARY_PATH=/usr/lib:/lib + LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH + elif [ "${ARCHITECTURE}" = "x86_64" ] ; then + LD_LIBRARY_PATH=/usr/lib:/lib + LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib64:/lib64:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib64/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib64/${PRODUCT}:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH + else + invalid_architecture "${ARCHITECTURE}" + exit 255 + fi +elif [ "${OS}" = "SunOS" ] ; then + if [ "${ARCHITECTURE}" = "sparc" ] ; then + JAVA="/usr/jdk/instances/jdk1.5.0/jre/bin/java" + JAVA_OPTIONS="" + + LD_LIBRARY_PATH=/usr/lib:/lib + LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH + elif [ "${ARCHITECTURE}" = "sparcv9" ] ; then + JAVA="/usr/jdk/instances/jdk1.5.0/jre/bin/java" + JAVA_OPTIONS="-d64" + + LD_LIBRARY_PATH=/usr/lib:/lib + LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/sparcv9:/lib/sparcv9:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/sparcv9/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/sparcv9/${PRODUCT}:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH + else + invalid_architecture "${ARCHITECTURE}" + exit 255 + fi +else + invalid_operating_system "${OS}" + exit 255 +fi + + +############################################################################### +## (5) Set the CP environment variable to determine the search ## +## order this command wrapper uses to find jar files. ## +############################################################################### + +CP=/usr/lib/java/jss4.jar +CP=/usr/lib/java/dirsec/jss4.jar:${CP} +CP=/usr/lib/java/osutil.jar:${CP} +CP=/usr/share/java/ldapjdk.jar:${CP} +CP=/usr/share/java/${PRODUCT}/nsutil.jar:${CP} +CP=/usr/share/java/${PRODUCT}/cmsutil.jar:${CP} +CP=/usr/share/java/${PRODUCT}/cstools.jar:${CP} +CP=/usr/share/${PRODUCT}/classes:${CP} +export CP + + +############################################################################### +## (6) Execute the java command specified by this java command wrapper ## +## based upon the preset LD_LIBRARY_PATH and CP environment variables. ## +############################################################################### + +if [ $# -eq 1 ] || + [ $# -eq 2 ] || + [ $# -eq 3 ] +then + if [ "$1" = "-simpleinfo" ] + then + file $2 | grep 'ASCII text' > /dev/null + if [ $? -ne 0 ] ; then + ${JAVA} ${JAVA_OPTIONS} -cp ${CP} com.netscape.cmstools.${COMMAND} + printf "\n" + printf " ERROR: '$2' is not an ASCII file!\n\n" + printf " First, use 'BtoA $2 $2.b64'\n" + printf " to convert a binary file into an ASCII file.\n\n" + exit 255 + fi + else + file $1 | grep 'ASCII text' > /dev/null + if [ $? -ne 0 ] ; then + ${JAVA} ${JAVA_OPTIONS} -cp ${CP} com.netscape.cmstools.${COMMAND} + printf "\n" + printf " ERROR: '$1' is not an ASCII file!\n\n" + printf " First, use 'BtoA $1 $1.b64'\n" + printf " to convert a binary file into an ASCII file.\n\n" + exit 255 + fi + fi +fi + +${JAVA} ${JAVA_OPTIONS} -cp ${CP} com.netscape.cmstools.${COMMAND} "$@" +exit $? + diff --git a/pki/base/java-tools/templates/pretty_print_crl_command_wrapper b/pki/base/java-tools/templates/pretty_print_crl_command_wrapper new file mode 100644 index 000000000..e8c82094a --- /dev/null +++ b/pki/base/java-tools/templates/pretty_print_crl_command_wrapper @@ -0,0 +1,158 @@ +#!/bin/sh +# +# --- BEGIN COPYRIGHT BLOCK --- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2007 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# + +# Check to insure that this script's original invocation directory +# has not been deleted! +CWD=`/bin/pwd > /dev/null 2>&1` +if [ $? -ne 0 ] ; then + echo "Cannot invoke '$0' from non-existent directory!" + exit 255 +fi + + +############################################################################### +## (1) Specify variables used by this script. ## +############################################################################### + +PRODUCT=[PKI_PRODUCT] +COMMAND=[PKI_COMMAND] + + +############################################################################### +## (2) Check for valid usage of this command wrapper. ## +############################################################################### + + + +############################################################################### +## (3) Define helper functions. ## +############################################################################### + +invalid_operating_system() { + echo + echo "ERROR: '$0' does not execute on the '$1' operating system!" + echo +} + +invalid_architecture() { + echo + echo "ERROR: '$0' does not execute on the '$1' architecture!" + echo +} + + +############################################################################### +## (4) Set the LD_LIBRARY_PATH environment variable to determine the ## +## search order this command wrapper uses to find shared libraries. ## +############################################################################### + +OS=`pkiname` +ARCHITECTURE=`pkiarch` + +if [ "${OS}" = "Linux" ] ; then + JAVA="java" + JAVA_OPTIONS="" + + if [ "${ARCHITECTURE}" = "i386" ] ; then + LD_LIBRARY_PATH=/usr/lib:/lib + LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH + elif [ "${ARCHITECTURE}" = "x86_64" ] ; then + LD_LIBRARY_PATH=/usr/lib:/lib + LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib64:/lib64:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib64/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib64/${PRODUCT}:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH + else + invalid_architecture "${ARCHITECTURE}" + exit 255 + fi +elif [ "${OS}" = "SunOS" ] ; then + if [ "${ARCHITECTURE}" = "sparc" ] ; then + JAVA="/usr/jdk/instances/jdk1.5.0/jre/bin/java" + JAVA_OPTIONS="" + + LD_LIBRARY_PATH=/usr/lib:/lib + LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH + elif [ "${ARCHITECTURE}" = "sparcv9" ] ; then + JAVA="/usr/jdk/instances/jdk1.5.0/jre/bin/java" + JAVA_OPTIONS="-d64" + + LD_LIBRARY_PATH=/usr/lib:/lib + LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/sparcv9:/lib/sparcv9:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/sparcv9/dirsec:${LD_LIBRARY_PATH} + LD_LIBRARY_PATH=/usr/lib/sparcv9/${PRODUCT}:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH + else + invalid_architecture "${ARCHITECTURE}" + exit 255 + fi +else + invalid_operating_system "${OS}" + exit 255 +fi + + +############################################################################### +## (5) Set the CP environment variable to determine the search ## +## order this command wrapper uses to find jar files. ## +############################################################################### + +CP=/usr/lib/java/jss4.jar +CP=/usr/lib/java/dirsec/jss4.jar:${CP} +CP=/usr/lib/java/osutil.jar:${CP} +CP=/usr/share/java/ldapjdk.jar:${CP} +CP=/usr/share/java/${PRODUCT}/nsutil.jar:${CP} +CP=/usr/share/java/${PRODUCT}/cmsutil.jar:${CP} +CP=/usr/share/java/${PRODUCT}/cstools.jar:${CP} +CP=/usr/share/${PRODUCT}/classes:${CP} +export CP + + +############################################################################### +## (6) Execute the java command specified by this java command wrapper ## +## based upon the preset LD_LIBRARY_PATH and CP environment variables. ## +############################################################################### + +if [ $# -eq 1 ] || + [ $# -eq 2 ] +then + file $1 | grep 'ASCII text' > /dev/null + if [ $? -ne 0 ] ; then + ${JAVA} ${JAVA_OPTIONS} -cp ${CP} com.netscape.cmstools.${COMMAND} + printf "\n" + printf "ERROR: '$1' is not an ASCII file!\n\n" + printf " First, use 'BtoA $1 $1.b64'\n" + printf " to convert a binary file into an ASCII file.\n\n" + exit 255 + fi +fi + +${JAVA} ${JAVA_OPTIONS} -cp ${CP} com.netscape.cmstools.${COMMAND} "$@" +exit $? + diff --git a/pki/dogtag/java-tools/pki-java-tools.spec b/pki/dogtag/java-tools/pki-java-tools.spec index 1450ab6a8..e096edd99 100644 --- a/pki/dogtag/java-tools/pki-java-tools.spec +++ b/pki/dogtag/java-tools/pki-java-tools.spec @@ -33,7 +33,7 @@ ## Package Header Definitions %define base_name %{base_prefix}-%{base_component} %define base_version 1.0.0 -%define base_release 8 +%define base_release 9 %define base_group System Environment/Shells %define base_vendor Red Hat, Inc. %define base_license GPLv2 with exceptions @@ -260,6 +260,8 @@ rm -rf ${RPM_BUILD_ROOT} ############################################################################### %changelog +* Thu Mar 26 2009 Matthew Harmsen <mharmsen@redhat.com> 1.0.0-9 +- Bugzilla Bug #490947 - PrettyPrintCrl throws exceptions * Sat Feb 14 2009 Matthew Harmsen <mharmsen@redhat.com> 1.0.0-8 - Bugzilla Bug #485522 - Need rpm spec file to require osutil * Sat Feb 14 2009 Matthew Harmsen <mharmsen@redhat.com> 1.0.0-7 |
