You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Ralf S. Engelschall" <rs...@engelschall.com> on 1998/06/05 10:45:04 UTC

binbuild.sh: Script for building binary tarballs

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 <rs...@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


Re: binbuild.sh: Script for building binary tarballs

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
I've already said I don't like the "usr/local" stuff in the
tarball, but maybe I'm not understanding.  One of Ralf's
messages makes me think it's to aid the goal of having a
binary you can just "./httpd" to start, with no -d nor -f
flags.  If that *is* the purpose, the tarball tree may be
justifiable - but I question the "usr/local" choice (IMHO
"apache" would be better) and I don't see how the relative
path works here anyway.  (But as I said, I'm very tired.)

#ken	P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Group member         <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>

Re: binbuild.sh: Script for building binary tarballs

Posted by Mark J Cox <ma...@awe.com>.
> We need to get buy-in from everyone who's going to be providing
> a binary that they'll use the same method, whether it's this
> new APACI script or the old binbuild one.

I can quickly produce binaries for: Irix 6.2, Irix 5.3, FreeBSD 2.1,
NetBSD 1.3 and SunOS 4.1.3.  I'm going to wait until there is a consensus
on how to build them though as I don't like the usr/local prefix stuff
being inside the tarballs. 

Mark



Re: binbuild.sh: Script for building binary tarballs

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Ralf S. Engelschall wrote:
> 
> 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 really don't like the inclusion of "usr/local/" in the path
within the tarball.  If someone unpacks this elsewhere than
at /, it's going to get two useless and empty levels of hierarchy.

Also, and more important, the 'binary' tarballs have *always*
contained the source tree from which the binary was built.  Unless
I'm missing something, the source *isn't* included in yours.
'Binary' tarballs have really been "source-plus" rather than
"binary-minimum."

Other than that, it looks like a clean solution (though I
haven't tried it).

We need to get buy-in from everyone who's going to be providing
a binary that they'll use the same method, whether it's this
new APACI script or the old binbuild one.

#ken	P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Group member         <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>

Re: binbuild.sh: Script for building binary tarballs

Posted by Ben Hyde <bh...@pobox.com>.
>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:
...
>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

ok, if people like this then where should I put them if I make up
a mess of 'em.  - ben hyde