2 # Copyright 2000-2005 The Apache Software Foundation or its licensors, as
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
23 TEMPDIR=/var/tmp/$USER/apr-util-root
34 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
46 apr_util_src_dir=$optarg
59 if [ -f "$apr_util_src_dir/configure.in" ]; then
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]"
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]"
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]"
79 ./configure --prefix=$PREFIX --with-apr=$apr_src_dir \
80 --with-ldap --with-expat=$expat_dir
82 make install DESTDIR=$TEMPDIR
83 rm $TEMPDIR$PREFIX/lib/aprutil.exp
85 cp build/pkg/pkginfo $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
92 pkgmk -r $TEMPDIR$PREFIX -d $TEMPDIR/pkg
95 pkgtrans -s $TEMPDIR/pkg $current/$NAME-$VERSION-$ARCH-local
96 gzip $current/$NAME-$VERSION-$ARCH-local