mirrored from https://www.bouncycastle.org/repositories/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
bnd.sh
executable file
·46 lines (40 loc) · 1.34 KB
/
bnd.sh
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
#!/bin/sh
JAVA_HOME=/opt/jdk1.5.0
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
for jarFile in $*
do
base=`basename $jarFile .jar`
javaVersion=`echo $base | sed -e "s/.*\(jdk..\).*/\\1/"`
name=`echo $base | sed -e "s/\([^-]*\)-jdk.*/\\1/"`
bcVersion=`echo $base | sed -e "s/$name-${javaVersion}.*-\(1.*\)/\\1/" | sed -e "s/b/.0./"`
baseVersion=`echo $bcVersion | sed -e "s/[^.]*.\([0-9]*\).*/\\1/"`
bcMaxVersion="`expr "${baseVersion}" "+" "1"`"
if [ "`echo $bcVersion | fgrep b`" = "$bcVersion" ]
then
bcVersion=`echo $bcVersion | sed -e "s/50b/49./"`
fi
if `echo $jarFile | fgrep bcprov > /dev/null`
then
cat > /tmp/bnd.props <<%
Bundle-Version: $bcVersion
Bundle-Name: $name
Bundle-SymbolicName: $name
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.bouncycastle.*;version=$bcVersion
Import-Package: *;resolution:=optional
%
else
cat > /tmp/bnd.props <<%
Bundle-Version: $bcVersion
Bundle-Name: $name
Bundle-SymbolicName: $name
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.bouncycastle.*;version=$bcVersion
Import-Package: org.bouncycastle.*;version="[${bcVersion},1.${bcMaxVersion})",*;resolution:=optional
%
fi
java -jar $BND_HOME/biz.aQute.bnd-2.2.0.jar wrap --properties /tmp/bnd.props $jarFile
mv $base.jar $jarFile
done