| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved. |
| 4 |
# |
| 5 |
# This program and the accompanying materials are made available under the |
| 6 |
# terms of the Eclipse Public License v. 2.0, which is available at |
| 7 |
# http://www.eclipse.org/legal/epl-2.0. |
| 8 |
# |
| 9 |
# This Source Code may also be made available under the following Secondary |
| 10 |
# Licenses when the conditions for such availability set forth in the |
| 11 |
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, |
| 12 |
# version 2 with the GNU Classpath Exception, which is available at |
| 13 |
# https://www.gnu.org/software/classpath/license.html. |
| 14 |
# |
| 15 |
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 |
| 16 |
# |
| 17 |
|
| 18 |
# |
| 19 |
# Generate a new signature file. |
| 20 |
# |
| 21 |
# Usage: siggen jakarta.mail.jar mail.sig |
| 22 |
# |
| 23 |
SIGTEST=${SIGTEST:-/java/re/sigtest/4.0/promoted/fcs/latest/binaries/sigtest-4.0} |
| 24 |
SIGTEST_JAR=$SIGTEST/lib/sigtestdev.jar |
| 25 |
JAVA_HOME=${JAVA_HOME:-/opt/jdk1.8} |
| 26 |
PKG=jakarta.mail |
| 27 |
USAGE="siggen [-p package] jakarta.mail.jar mail.sig" |
| 28 |
|
| 29 |
while getopts p: opt |
| 30 |
do |
| 31 |
case $opt in |
| 32 |
p) PKG="$OPTARG";; |
| 33 |
\?) echo $USAGE; exit 1;; |
| 34 |
esac |
| 35 |
done |
| 36 |
shift `expr $OPTIND - 1` |
| 37 |
|
| 38 |
ver=$($JAVA_HOME/bin/java -version 2>&1 | sed -e 's/.*"\(.*\)".*/\1/;q') |
| 39 |
case "$ver" in |
| 40 |
1.[0-9]*) xjimage=; |
| 41 |
cp="$1:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/jce.jar";; |
| 42 |
*) xjimage="-xjimage ${JAVA_HOME}/bin/jimage"; |
| 43 |
cp="$1:${JAVA_HOME}/lib/modules";; |
| 44 |
esac |
| 45 |
|
| 46 |
${JAVA_HOME}/bin/java -jar $SIGTEST_JAR setup -static \ |
| 47 |
-classpath "$cp" $xjimage \ |
| 48 |
-filename "$2" -package "$PKG" -nonclosedfile |