Commit a2b8f40e authored by Graham Leggett's avatar Graham Leggett
Browse files

aix: Add a set of build scripts that make packages suitable for installp

on the AIX platform.
Submitted by: Michael Felt <mamfelt gmail com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1240778 13f79535-47bb-0310-9956-ffa450edef68
parent c29dfad5
Loading
Loading
Loading
Loading

build/aix/README

0 → 100644
+32 −0
Original line number Diff line number Diff line
The script buildaix.ksh will attempt to build a AIX installp fileset
out of a source tree for httpd.

REQUIREMENTS:
fileset bos.adt.insttools

RECOMMENDED:
Toolbox filesets zlib and zlib-devel
Toolbox fileset coreutils

To build a package, make sure you are in the root of the source tree,
and run:

build/aix/buildaix.ksh

## coming - argument to leave the DESTDIR results for manual
## modifications to the template (to create seperate filesets)

An AIX fileset named <PKG>.<NAME>.<version>.<architecture>.I will be
created in the build/aix directory. Also included is the .template file.

KNOWN issues:
on AIX libtool is known to have issues with the install command.
many of these issues can be resolved by inserting the GNU install command
earlier in the PATH variable. Testing has shown that this may still
have issues when installing to DESTDIR. To compensate for this
the buildaix.ksh also does a "regular" make install before executing
the make DESTDIR=$TEMPDIR install command

TODO
Add Apache LICENSE to fileset and require acceptance
Add test for bos.adt.insttools at start of build script

build/aix/aixproto.ksh

0 → 100755
+78 −0
Original line number Diff line number Diff line
#!/usr/bin/ksh
TEMPDIR=$1
BUILD=`pwd`
. build/aix/pkginfo

package=$PKG
name=$NAME
vrmf=$VERSION
descr="$VENDOR $NAME for $ARCH"
umask 022
INFO=$BUILD/build/aix/.info
mkdir -p $INFO

template=${INFO}/${PKG}.${NAME}.${vrmf}.template
>$template

cd ${TEMPDIR}
rm -rf .info lpp_name tmp
# get the directory sizes in blocks
for d in etc opt var
do
        set `du -s $d/${NAME}`
        let sz$d=$1+1
done
set `du -s usr/share/man`
szman=$1+1

files=./httpd-root
cd ${TEMPDIR}/..
find ${files} -type d -exec chmod og+rx {} \;
chmod -R go+r ${files}
chown -R 0:0 ${files}

cat - <<EOF >>$template
Package Name: ${package}.${NAME}
Package VRMF: ${vrmf}.0
Update: N
Fileset
  Fileset Name: ${package}.${NAME}.rte
  Fileset VRMF: ${vrmf}.0
  Fileset Description: ${descr}
  USRLIBLPPFiles
  EOUSRLIBLPPFiles
  Bosboot required: N
  License agreement acceptance required: N
  Include license files in this package: N
  Requisites:
        Upsize: /usr/share/man ${szman};
        Upsize: /etc/${NAME} $szetc;
        Upsize: /opt/${NAME} $szopt;
        Upsize: /var/${NAME} $szvar;
  USRFiles
EOF

find ${files} | sed -e s#^${files}## | sed -e "/^$/d" >>$template

cat - <<EOF >>$template
  EOUSRFiles
  ROOT Part: N
  ROOTFiles
  EOROOTFiles
  Relocatable: N
EOFileset
EOF

cp ${template} ${BUILD}/build/aix

# use mkinstallp to create the fileset. result is in ${TEMPDIR}/tmp
mkinstallp -d ${TEMPDIR} -T ${template}

cp ${TEMPDIR}/tmp/$PKG.$NAME.$VERSION.0.bff ${BUILD}/build/aix
cd $BUILD/build/aix
rm -f $PKG.$NAME.$VERSION.$ARCH.I
mv $PKG.$NAME.$VERSION.0.bff $PKG.$NAME.$VERSION.$ARCH.I
rm .toc
inutoc .
installp -d . -ap ${PKG}.${NAME}
installp -d . -L

build/aix/buildaix.ksh

0 → 100755
+53 −0
Original line number Diff line number Diff line
#!/usr/bin/ksh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#

# buildaix.ksh: This script builds an AIX fileset

LAYOUT=AIX
TEMPDIR=/var/tmp/$USER/httpd-root
rm -rf $TEMPDIR

## strange interaction between install and libtool requires a regular install
## for all the links to succeed in the TEMPDIR
## httpd-2.0 does not include ssl by default
## will make a seperate build for that later

> nohup.out
./configure \
 	--enable-layout=$LAYOUT \
 	--enable-module=so \
 	--enable-proxy \
 	--enable-cache \
 	--enable-disk-cache \
 	--with-mpm=worker \
 	--enable-mods-shared=all | tee nohup.out

make | tee -a nohup.out

make install > install.log
make install DESTDIR=$TEMPDIR

# will make use of the pkginfo data as input for mkinstallp template
cp build/aix/pkginfo $TEMPDIR

## no seperate filesets for man pages, documents, etc.

build/aix/aixproto.ksh $TEMPDIR

# rm -rf $TEMPDIR
ls -ltr build/aix | grep -i aix