summaryrefslogtreecommitdiffstats
path: root/deployment/funcs_jars_pack_sign.sh
blob: fbfd4fa9b547ceb7068fe5d54598420cf6dc9d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#! /bin/bash

#
# wsdir_jars_repack  <wsdir>
# wsdir_jars_pack200 <wsdir>
# wsdir_jars_sign    <wsdir> <pkcs12-keystore> <storepass> [signarg]
#

function wsdir_jars_repack() {

wsdir=$1
shift 

if [ -z "$wsdir" ] ; then
    echo usage $0 webstartdir
    exit 1
fi

if [ ! -e $wsdir ] ; then
    echo $wsdir does not exist
    exit 1
fi

THISDIR=`pwd`

cd $wsdir

rm -rf orig-jars
mkdir -p orig-jars

for i in *.jar ; do
    cp -a $i orig-jars
    echo pack200 --repack $i
    pack200 --repack $i
done

cd $THISDIR

}

function wsdir_jars_pack200() {

wsdir=$1
shift 

if [ -z "$wsdir" ] ; then
    echo usage $0 webstartdir
    exit 1
fi

if [ ! -e $wsdir ] ; then
    echo $wsdir does not exist
    exit 1
fi

THISDIR=`pwd`

cd $wsdir

mkdir -p DLLS
mv *natives*.jar DLLS/

for i in *.jar ; do
    echo pack200 -E9 $i.pack.gz $i
    pack200 -E9 $i.pack.gz $i
done

mv DLLS/* .

rm -rf DLLS

cd $THISDIR

}


function wsdir_jars_sign() {

wsdir=$1
shift 

keystore=$1
shift 

storepass=$1
shift 

signarg=$1
shift 

if [ -z "$wsdir" -o -z "$keystore" -o -z "$storepass" ] ; then
    echo "usage $0 webstartdir pkcs12-keystore storepass [signarg]"
    exit 1
fi

if [ ! -e $wsdir ] ; then
    echo $wsdir does not exist
    exit 1
fi

if [ ! -e $keystore ] ; then
    echo $keystore does not exist
    exit 1
fi

THISDIR=`pwd`

cd $wsdir

rm -rf demo-jars
mkdir -p demo-jars
mv jogl.test.jar jogl-demos*jar jocl-demos.jar demo-jars/

for i in *.jar ; do
    echo jarsigner -storetype pkcs12 -keystore $keystore $i \"$signarg\"
    jarsigner -storetype pkcs12 -keystore $THISDIR/$keystore -storepass $storepass $i "$signarg"
done

mv demo-jars/* .
rm -rf demo-jars

cd $THISDIR

}