bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / build / pkg / buildpkg.sh
1 #!/bin/sh
2 # Licensed to the Apache Software Foundation (ASF) under one or more
3 # contributor license agreements.  See the NOTICE file distributed with
4 # this work for additional information regarding copyright ownership.
5 # The ASF licenses this file to You under the Apache License, Version 2.0
6 # (the "License"); you may not use this file except in compliance with
7 # the License.  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 LAYOUT=Apache
23 PREFIX=/usr/local/apache2
24 TEMPDIR=/var/tmp/$USER/httpd-root
25 rm -rf $TEMPDIR
26
27 apr_config=`which apr-config`
28 apu_config=`which apu-config`
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_config=$optarg
41   ;;
42   esac
43
44   case "$1" in
45   --with-apr-util=*)
46   apu_config=$optarg
47   ;;
48   esac
49
50   shift
51 done
52
53 if [ ! -f "$apr_config" -a ! -f "$apr_config/configure.in" ]; then
54   echo "The apr source directory / apr-1-config could not be found"
55   echo "Usage: buildpkg [--with-apr=[dir|file]] [--with-apr-util=[dir|file]]"
56   exit 1
57 fi
58
59 if [ ! -f "$apu_config" -a ! -f "$apu_config/configure.in" ]; then
60   echo "The apu source directory / apu-1-config could not be found"
61   echo "Usage: buildpkg [--with-apr=[dir|file]] [--with-apr-util=[dir|file]]"
62   exit 1
63 fi
64
65 ./configure --enable-layout=$LAYOUT \
66             --with-apr=$apr_config \
67             --with-apr-util=$apu_config \
68             --enable-mods-shared=all \
69             --with-devrandom \
70             --with-ldap --enable-ldap --enable-authnz-ldap \
71             --enable-cache --enable-disk-cache --enable-mem-cache \
72             --enable-ssl --with-ssl \
73             --enable-deflate --enable-cgid \
74             --enable-proxy --enable-proxy-connect \
75             --enable-proxy-http --enable-proxy-ftp
76
77 make
78 make install DESTDIR=$TEMPDIR
79 . build/pkg/pkginfo
80 cp build/pkg/pkginfo $TEMPDIR$PREFIX
81
82 current=`pwd`
83 cd $TEMPDIR$PREFIX
84 echo "i pkginfo=./pkginfo" > prototype
85 find . -print | grep -v ./prototype | grep -v ./pkginfo | pkgproto | awk '{print $1" "$2" "$3" "$4" root bin"}' >> prototype
86 mkdir $TEMPDIR/pkg
87 pkgmk -r $TEMPDIR$PREFIX -d $TEMPDIR/pkg
88
89 cd $current
90 pkgtrans -s $TEMPDIR/pkg $current/$NAME-$VERSION-$ARCH-local
91 gzip $current/$NAME-$VERSION-$ARCH-local
92
93 rm -rf $TEMPDIR
94