upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr-util / build / pkg / buildpkg.sh
1 #!/bin/sh
2 # Copyright 2000-2005 The Apache Software Foundation or its licensors, as
3 # applicable.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 #
18
19 # buildpkg.sh: This script builds a Solaris PKG from the source tree
20 #              provided.
21
22 PREFIX=/usr/local
23 TEMPDIR=/var/tmp/$USER/apr-util-root
24 rm -rf $TEMPDIR
25
26 apr_util_src_dir=.
27 apr_src_dir=../apr
28 expat_dir=/usr
29
30 while test $# -gt 0 
31 do
32   # Normalize
33   case "$1" in
34   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
35   *) optarg= ;;
36   esac
37
38   case "$1" in
39   --with-apr=*)
40   apr_src_dir=$optarg
41   ;;
42   esac
43
44   case "$1" in
45   --with-apr-util=*)
46   apr_util_src_dir=$optarg
47   ;;
48   esac
49
50   case "$1" in
51   --with-expat=*)
52   expat_dir=$optarg
53   ;;
54   esac
55
56   shift
57 done
58
59 if [ -f "$apr_util_src_dir/configure.in" ]; then
60   cd $apr_util_src_dir
61 else
62   echo "The apr-util source could not be found within $apr_util_src_dir"
63   echo "Usage: buildpkg [--with-apr=dir] [--with-apr-util=dir] [--with-expat=dir]"
64   exit 1
65 fi
66
67 if [ ! -f "$apr_src_dir/configure.in" ]; then
68   echo "The apr source could not be found within $apr_src_dir"
69   echo "Usage: buildpkg [--with-apr=dir] [--with-apr-util=dir] [--with-expat=dir]"
70   exit 1
71 fi
72
73 if [ ! -d "$expat_dir" ]; then
74   echo "The expat directory could not be found within $expat_dir"
75   echo "Usage: buildpkg [--with-apr=dir] [--with-apr-util=dir] [--with-expat=dir]"
76   exit 1
77 fi
78
79 ./configure --prefix=$PREFIX --with-apr=$apr_src_dir \
80             --with-ldap --with-expat=$expat_dir
81 make
82 make install DESTDIR=$TEMPDIR
83 rm $TEMPDIR$PREFIX/lib/aprutil.exp
84 . build/pkg/pkginfo
85 cp build/pkg/pkginfo $TEMPDIR$PREFIX
86
87 current=`pwd`
88 cd $TEMPDIR$PREFIX
89 echo "i pkginfo=./pkginfo" > prototype
90 find . -print | grep -v ./prototype | grep -v ./pkginfo | pkgproto | awk '{print $1" "$2" "$3" "$4" root bin"}' >> prototype
91 mkdir $TEMPDIR/pkg
92 pkgmk -r $TEMPDIR$PREFIX -d $TEMPDIR/pkg
93
94 cd $current
95 pkgtrans -s $TEMPDIR/pkg $current/$NAME-$VERSION-$ARCH-local
96 gzip $current/$NAME-$VERSION-$ARCH-local
97
98 rm -rf $TEMPDIR
99