removed some of the debug logging and added author details
[httpd-crcsyncproxy.git] / build / pkg / buildpkg.sh
blob028124057b05d1fb7c013b58c56449a34224a256
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 # buildpkg.sh: This script builds a Solaris PKG from the source tree
20 # provided.
22 LAYOUT=Apache
23 PREFIX=/usr/local/apache2
24 TEMPDIR=/var/tmp/$USER/httpd-root
25 rm -rf $TEMPDIR
27 apr_config=`which apr-1-config`
28 apu_config=`which apu-1-config`
30 while test $# -gt 0
32 # Normalize
33 case "$1" in
34 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
35 *) optarg= ;;
36 esac
38 case "$1" in
39 --with-apr=*)
40 apr_config=$optarg
42 esac
44 case "$1" in
45 --with-apr-util=*)
46 apu_config=$optarg
48 esac
50 shift
51 done
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
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
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
77 make
78 make install DESTDIR=$TEMPDIR
79 . build/pkg/pkginfo
80 cp build/pkg/pkginfo $TEMPDIR$PREFIX
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
89 cd $current
90 pkgtrans -s $TEMPDIR/pkg $current/$NAME-$VERSION-$ARCH-local
91 gzip $current/$NAME-$VERSION-$ARCH-local
93 rm -rf $TEMPDIR