Add pg_config --libs to pgsql_LDFLAGS.
[apr-util.git] / build / pkg / buildpkg.sh
blobba4f4d13d78855bd7542ba3664a5f4af8222791c
1 #!/bin/sh
2 # Copyright 2000-2005 The Apache Software Foundation or its licensors, as
3 # applicable.
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
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 PREFIX=/usr/local
23 TEMPDIR=/var/tmp/$USER/apr-util-root
24 rm -rf $TEMPDIR
26 apr_util_src_dir=.
27 apr_src_dir=../apr
28 expat_dir=/usr
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_src_dir=$optarg
42 esac
44 case "$1" in
45 --with-apr-util=*)
46 apr_util_src_dir=$optarg
48 esac
50 case "$1" in
51 --with-expat=*)
52 expat_dir=$optarg
54 esac
56 shift
57 done
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
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
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
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
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
94 cd $current
95 pkgtrans -s $TEMPDIR/pkg $current/$NAME-$VERSION-$ARCH-local
96 gzip $current/$NAME-$VERSION-$ARCH-local
98 rm -rf $TEMPDIR