httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject binbuild.sh: Script for building binary tarballs
Date Fri, 05 Jun 1998 08:45:04 GMT

Ok, I've rewritten the binbuild.sh script for Apache 1.3.0.
It now does things different, because IMHO this is the correct way:

1. It uses APACI and the --enable-shared=remain option which
   means that the httpd binary has all standard modules compiled statically
   (as in the past) but the remaining modules are also build as DSO. This is
   ok because we already have DSo support on all major platforms (and only for
   those we should build binary tarballs).

2. It uses APACI's "make install root=<dir>" feature to fake
   an installation and to roll a tarball which actually contains a _binary_
   contents. In the past our "binaries" were just a source dist plus a
   pre-compiled httpd binary (and it was named httpd-xxx which leaded to a lot
   of confusion and PRs).


In short:

:> ./binbuild.sh 
This is Apache binbuild.sh, Version 2.0
 + unpacking release tarball 
   $ gzip -d -c apache_1.3.0.tar.gz | tar xf -
 + guessed platform: i386-whatever-freebsd2.2.6
   $ cd apache_1.3.0
 + configuring source tree
   $ ./configure --prefix=/usr/local/apache --enable-shared=remain
 + building the programs
   $ make
 + installing for /usr/local/apache (only faked!)
   $ make install root=apache-root
 + packing binary tarball from installation files
   $ (cd apache-root; tar cf - *) | gzip -9 >../apache_1.3.0-i386-whatever-freebsd2.2.6.tar.gz
 + cleaning up
   $ cd ..
   $ rm -rf apache_1.3.0
 + generating MD5 checksum for tarball
Binary build complete.

And then a tarball apache_1.3.0-i386-whatever-freebsd2.2.6.tar.gz is made

:> ls -l apache_1.3.0-i386-whatever-freebsd2.2.6.tar.gz 
-rw-r--r--  1 rse  users  688002 Jun  5 10:41 apache_1.3.0-i386-whatever-freebsd2.2.6.tar.gz

which contains

:> gunzip <apache_1.3.0-i386-whatever-freebsd2.2.6.tar.gz | tar tvf -
drwxr-xr-x rse/users         0 Jun  5 10:40 1998 usr/
drwxr-xr-x rse/users         0 Jun  5 10:40 1998 usr/local/
drwxr-xr-x rse/users         0 Jun  5 10:40 1998 usr/local/apache/
drwxr-xr-x rse/users         0 Jun  5 10:40 1998 usr/local/apache/bin/
-rwxr-xr-x rse/users     12288 Jun  5 10:40 1998 usr/local/apache/bin/htpasswd
-rwxr-xr-x rse/users     16384 Jun  5 10:40 1998 usr/local/apache/bin/htdigest
-rwxr-xr-x rse/users      6419 Jun  5 10:40 1998 usr/local/apache/bin/dbmmanage
drwxr-xr-x rse/users         0 Jun  5 10:40 1998 usr/local/apache/sbin/
-rwxr-xr-x rse/users    274432 Jun  5 10:40 1998 usr/local/apache/sbin/httpd
   :

i.e. the actual installation hierarchy but packed relative so even a
non-root-user can unpack it.

The script is appended below.

Greetings,
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

#!/bin/sh 
##
##  binbuild.sh -- Apache binary release build script
##  Written by Ralf S. Engelschall <rse@apache.org>
##

#
#   configuration
#
name=apache_1.3.0
prefix=/usr/local/apache
options=--enable-shared=remain

#
#   build sequence
#
trap 'echo "binbuild.sh:Error: abnormal exit, binary release not properly built"; exit 1'
0 1 2 3 15
umask 022
echo "This is Apache binbuild.sh, Version 2.0"
echo " + unpacking release tarball $tarball"
echo "   \$ gzip -d -c $name.tar.gz | tar xf -"
gzip -d -c $name.tar.gz | tar xf -
gnutriple=`$name/src/helpers/GuessOS | sed 's/\//_/g` || exit 1
echo " + guessed platform: $gnutriple"
echo "   \$ cd $name";
cd $name
echo " + configuring source tree"
echo "   \$ ./configure --prefix=$prefix $options"
./configure --prefix=$prefix $options >../binbuild.log-$gnutriple 2>&1 || exit 1
echo " + building the programs"
echo "   \$ make"
make >>../binbuild.log-$gnutriple 2>&1 || exit 1
echo " + installing for $prefix (only faked!)"
echo "   \$ make install root=apache-root"
make install root=apache-root >>../binbuild.log-$gnutriple 2>&1 || exit 1
echo " + packing binary tarball from installation files"
echo "   \$ (cd apache-root; tar cf - *) | gzip -9 >../${name}-$gnutriple.tar.gz"
(cd apache-root; tar cf - *) | gzip -9 >../${name}-$gnutriple.tar.gz
echo " + cleaning up"
echo "   \$ cd .."
cd ..
echo "   \$ rm -rf $name"
rm -rf $name
echo " + generating MD5 checksum for tarball"
if [ ! -f $md5 ] ; then
    echo "   Warning, md5 not found, not generating hashes"
else
    md5 $name-$gnutriple.tar.gz >$name-$gnutriple.tar.gz.md5
fi
echo "Binary build complete."
trap 0 1 2 3 15


Mime
View raw message