bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / tools / jkbindist.sh
1 #!/bin/ksh
2
3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements.  See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License.  You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17
18
19 # Make sure to set your path so that we can find
20 # the following binaries:
21 # cd, mkdir, cp, rm, find, zip
22
23 prefix="tomcat-connectors"
24 tools="`pwd`"
25 sign=""
26
27 #################### NO CHANGE BELOW THIS LINE ##############
28
29 #################### FUNCTIONS ##############
30
31 usage() {
32     echo "Usage:: $0 -v VERSION -w WEBSERVER -o OS -a ARCH <module file>"
33     echo "        -v: version to package"
34     echo "        -w: package for web server"
35     echo "        -o: Operating System"
36     echo "        -a: Architecture"
37     echo "        -p: GNU PG passphrrase used for signing"
38     echo "        -k: ID of GNU PG key to use for signing"
39 }
40
41 while getopts :v:w:o:a:p:k: c
42 do
43     case $c in
44     v)         version=$OPTARG;;
45     w)         websrv=$OPTARG;;
46     k)         sign="--default-key=$OPTARG $sign";;
47     p)         sign="--passphrase=$OPTARG $sign";;
48     o)         opsys=$OPTARG;;
49     a)         arch=$OPTARG;;
50     \:)        usage
51                exit 2;;
52     \?)        usage
53                exit 2;;
54     esac
55 done
56 shift `expr $OPTIND - 1`
57
58 if [ -z "$version" -o -z "$websrv" ]
59 then
60     usage
61     exit 2
62 fi
63 if [ -z "$opsys" ]
64 then
65     opsys="`uname -s | tr [A-Z] [a-z]`"
66     case "$opsys" in
67         cygwin*)
68             opsys=windows
69         ;;
70     esac
71 fi
72 if [ -z "$arch" ]
73 then
74     arch="`uname -m`"
75 fi
76
77 if [ ! -f "$1" ]
78 then
79     usage
80     exit 2
81 fi
82     
83 case "$websrv" in
84     httpd*)
85         webdesc="Apache HTTP Server"
86     ;;
87     iis*)
88         webdesc="Microsoft IIS Web Server"
89     ;;
90     netscape*|nsapi*)
91         webdesc="Oracle iPlanet Web Server"
92     ;;
93     *)
94         echo "Unknown web server: $webserv"
95         echo "   Supported are: httpd, iis, nsapi"
96     ;;
97 esac
98
99 dist=${prefix}-${version}-${opsys}-${arch}-${websrv}
100 dtop=${tools}/..
101 copy="KEYS LICENSE NOTICE"
102
103 rm -f ${copy} 2>/dev/null
104 rm -f ${dist} 2>/dev/null
105 rm -f ${dist}.* 2>/dev/null
106 cat << EOF > README
107   Licensed to the Apache Software Foundation (ASF) under one or more
108   contributor license agreements.  See the NOTICE file distributed with
109   this work for additional information regarding copyright ownership.
110   The ASF licenses this file to You under the Apache License, Version 2.0
111   (the "License"); you may not use this file except in compliance with
112   the License.  You may obtain a copy of the License at
113
114       http://www.apache.org/licenses/LICENSE-2.0
115
116   Unless required by applicable law or agreed to in writing, software
117   distributed under the License is distributed on an "AS IS" BASIS,
118   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119   See the License for the specific language governing permissions and
120   limitations under the License.
121
122
123
124 Apache Tomcat Connectors - $version
125
126 Here your'll find module binaries for $webdesc.
127 Check the online documentation at http://tomcat.apache.org/connectors-doc/
128 for installation instructions.
129
130 The Apache Tomcat Project
131 http://tomcat.apache.org
132 EOF
133
134 umask 022
135 for i in ${copy}
136 do
137     if [ -f ${dtop}/$i ]
138     then
139         cp ${dtop}/$i .
140     else
141         cp ${dtop}/native/$i .
142     fi
143 done
144
145 # Pack
146 zip -9 -j ${dist}.zip $1 README ${copy}
147
148 # Sign
149 archive=${dist}.zip
150 . ${tools}/signfile.sh ${sign} $archive
151
152 # Cleanup
153 rm -f README ${copy} 2>/dev/null