httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@engelschall.com (Ralf S. Engelschall)
Subject Re: wanted: list of package sytems
Date Sat, 28 Mar 1998 11:53:52 GMT

In article <Pine.BSF.3.95q.980327232506.18446L-100000@valis.worldgate.com> you wrote:

> FreeBSD ports.
> RPMs.

> Anyone have any other examples?  I'm looking for something to avoid
> reinventing the wheel, but that is more portable.  FreeBSD ports rely
> strongly on BSD make while RPMs don't really do things the way I want to
> and I was scared by the source the last time I looked at it.

Yeah, FreeBSD ports are really just for BSD systems. RPM is nice and portable
and one just has to write a single Spec-file but I personally dislike it, too.
It just isn't flexible enough. Because of this I hacked togehther a Perl-based
approach named Build'n'Play (BnP) which currently is not for public
consumption because there is no documentation and out-of-the-box installation,
but to give you a clue how it looks like I append you my Build script for my
webserver package which installs Perl+Apache on my webservers.  The trick of
BnP is that its build scripts are Perl scripts but behave like Makefiles:
Every successfuly command is recorded and if one fails, you can resume
building at this step after fixing. And because the script is a Perl script
you can program complicated command directly in Perl.  Perhaps it inspires you
a little bit. Or perhaps you want to  help me to make BnP ready for public
consumption if you think it is a useful approach...

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


:
eval 'exec ../BnP/BnP.aux.perl -S $0 ${1+"$@"}'
    if $running_under_some_shell;
require 5.000;
BEGIN { push(@INC, "../BnP"); }
use BnP;

#####################################################################
##
##  Build script for Webserver Bundle
##
#####################################################################

$bundlename = "websrv";
$bundlevers = "1.0.0";
$bundleid   = "$bundlename/$bundlevers";

BnP::init($bundlename, $bundlevers);
($prefix, $bindir, $libdir, $mandir, $vardir) = BnP::find_dirs($bundlename);
($gnutriple, $arch, $vendor, $os) = BnP::find_systype; 
($perl, $cc, $cxx, $cflags) = BnP::find_tools;

BnP::cmd(0, "mkdir work");
BnP::chdir("work");

#####################################################################
#
#   configuration
#
#####################################################################

$debug             = 0;
$build_perl        = 0;
$build_apache_perl = 1;
$build_apache      = 1;

#####################################################################
#
#   prepare environment
#
#####################################################################

BnP::cmd(0, "mkdir $prefix");
BnP::cmd(0, "mkdir $prefix/bin");
BnP::cmd(0, "mkdir $prefix/lib");
BnP::cmd(0, "mkdir $prefix/man");
BnP::cmd(0, "mkdir $prefix/man/man1");
BnP::cmd(0, "mkdir $prefix/man/man8");
BnP::cmd(0, "mkdir $vardir");
BnP::cmd(0, "mkdir $vardir/run");
BnP::cmd(0, "mkdir $vardir/log");
BnP::cmd(0, "mkdir $vardir/cache");

#####################################################################
#
#   First, we need a really good (=latest) Perl variant
#   to be sure the other stuff (mod_perl, ePerl, etc.) runs fine.
#
#####################################################################

$PV = "5.004_04";

if ($build_perl) {

#   first the base distribution
BnP::cmd(0, "gunzip -c ../dist/perl/perl$PV.tar.gz | tar xvf -");
BnP::chdir("perl$PV");
BnP::cmd(0, "patch -N <../../dist/perl/perl$PV.patch.1");
BnP::sed(0, "doio.c", "s/__linux__/__FreeBSD__/g");

if ($debug) {
    BnP::cmd(0, "sh Configure -s -d -e " .
                "-Dprefix=$prefix/lib/perl " .
                "-Dcc=\"$cc\" -Doptimize=\"-g\"");
}
else {
    BnP::cmd(0, "sh Configure -s -d -e " .
                "-Dprefix=$prefix/lib/perl " .
                "-Dcc=\"$cc\"");
}
BnP::cmd(0, "make");
BnP::cmd(0, "echo 'n' | make install");
BnP::chdir("..");
BnP::cmd(0, "rm -f $prefix/bin/perl; ln $prefix/lib/perl/bin/perl $prefix/bin/perl");
BnP::cmd(0, "rm -f $prefix/bin/perldoc; ln $prefix/lib/perl/bin/perldoc $prefix/bin/perldoc");

#   Now power up this Perl with useful modules
sub install_module {
    local($distdir, $distname, $dirname, $patchfunc) = @_;

    $dirname = $distname if ($dirname eq '');
    BnP::cmd(0, "gunzip -c ../dist/$distdir/$distname.tar.gz | tar xvf -");
    BnP::chdir("$dirname");
    &$patchfunc if ($patchfunc ne '');
    BnP::cmd(0, "$prefix/bin/perl Makefile.PL </dev/null");
    BnP::cmd(0, "make");
    BnP::cmd(0, "make install UNINST=1");
    BnP::chdir("..");
}
&install_module("perl/mod", "ExtUtils-Embed-1.14");
&install_module("perl/mod", "ExtUtils-DynaGlue-1.00a");
&install_module("perl/mod", "ExtUtils-Manifest-1.33");
&install_module("perl/mod", "C-DynaLib-0.53");
&install_module("perl/mod", "Devel-Symdump-2.00");
&install_module("perl/mod", "Tie-IxHash-1.2");
&install_module("perl/mod", "IO-1.19");
&install_module("perl/mod", "GD-1.18");
&install_module("perl/mod", "chart-0.94", "Chart-0.94");
&install_module("perl/mod", "GIFgraph-1.01");
&install_module("perl/mod", "Image-Size-2.6");
&install_module("perl/mod", "MD5-1.7");
&install_module("perl/mod", "SHA-1.2");
&install_module("perl/mod", "Data-Dumper-2.081");
&install_module("perl/mod", "libnet-1.0605");
&install_module("perl/mod", "libwww-perl-5.21");
&install_module("perl/mod", "WWW-Search-1.012");
&install_module("perl/mod", "HTTPD-Tools-0.55");
&install_module("perl/mod", "Robot-0.011");
&install_module("perl/mod", "CGI.pm-2.37b29", "CGI.pm-2.37029");
&install_module("perl/mod", "CGI-modules-2.76");
&install_module("perl/mod", "CGI_Imagemap-1.00");
&install_module("perl/mod", "CGI-Out-96.081401");
&install_module("perl/mod", "CGI_Lite-1.8");
&install_module("perl/mod", "MailTools-1.11");
&install_module("perl/mod", "MailFolder-0.06");
&install_module("perl/mod", "MIME-tools-4.116");
&install_module("perl/mod", "MIME-Lite-1.121");
&install_module("perl/mod", "MIME-Base64-2.05");
&install_module("perl/mod", "HTML-Stream-1.44");
&install_module("perl/mod", "HTML-QuickCheck-1.0b1");
&install_module("perl/mod", "DateManip-5.30");
&install_module("perl/mod", "DateCalc-3.2");
&install_module("perl/mod", "TimeDate-1.08");
&install_module("perl/mod", "Time-HiRes-01.16");
&install_module("perl/mod", "Time-modules-97.092101");
&install_module("perl/mod", "Period-1.20");
&install_module("perl/mod", "Bit-Vector-5.1");
&install_module("perl/mod", "DBI-0.93");
&install_module("perl/mod", "eperl-2.2.12");

#   make sure GenOpt does not install the stuff itself later
BnP::cmd(0, "touch $prefix/lib/perl/bin.nonopt");
BnP::cmd(0, "touch $prefix/lib/perl/lib.nonopt");
BnP::cmd(0, "touch $prefix/lib/perl/man.nonopt");

} ## $build_perl

#####################################################################
#
#   The Perl part of the Apache/Perl integration
#
#####################################################################

$MPV = "1.10";

#   the source for mod_perl is always needed
BnP::cmd(0, "gunzip -c ../dist/apache-perl/mod_perl-$MPV.tar.gz | tar xvf -");

if ($build_apache_perl) {

#   the Perl part of mod_perl
BnP::chdir("mod_perl-$MPV");
BnP::cmd(0, "$prefix/bin/perl Makefile.PL NO_HTTPD=1 EVERYTHING=1");
BnP::cmd(0, "make");
BnP::cmd(0, "make install");
BnP::chdir("..");

#   additional modules
&install_module("apache-perl", "Apache-Perl-contrib-022398");
&install_module("apache-perl", "ApacheDBI-0.78");
#&install_module("apache-perl", "Apache-LogFile-0.11");
&install_module("apache-perl", "Apache-DBILogger-0.01");
&install_module("apache-perl", "Apache-DBILogin-1.3");
&install_module("apache-perl", "Apache-Mmap-0.05");
&install_module("apache-perl", "Apache-OutputChain-0.02");
&install_module("apache-perl", "Apache-Stage-1.18");
&install_module("apache-perl", "Apache-Sandwich-1.10");
&install_module("apache-perl", "Apache-GzipChain-0.06");
&install_module("apache-perl", "Apache-Traffic-1.02");
&install_module("apache-perl", "Apache_PSWD.pm-1.00");
&install_module("apache-perl", "Apache-DProf-0.01");
&install_module("apache-perl", "Apache-Peek-0.85");
&install_module("apache-perl", "Apache-Symbol-1.00_01");
&install_module("apache-perl", "Apache-AuthCookie-1.3");
&install_module("apache-perl", "Apache-ProxyPass-0.05");
&install_module("apache-perl", "Apache-Module-0.01");

} ## $build_apache_perl

#####################################################################
#
#   Now the Apache HTTP Server 
#
#####################################################################

$AV     = "1.3b6-dev";
$APACIV = "980320";

#   we use Apache + APACI
BnP::cmd(0, "gunzip -c ../dist/apache/apache_$AV.tar.gz | tar xvf -");
BnP::chdir("apache_$AV");
BnP::cmd(0, "gunzip -c ../../dist/apache/apaci-$APACIV.tar.gz | tar xvf -");

#   configure Apache
$add_module_options = '';
#    mod_auth_cookie_file.c 
#    mod_bandwidth.c 
#    mod_log_dir.c 
#    mod_setclass.c
foreach $m (qw(
    mod_allowdev.c 
    mod_auth_cookie.c 
    mod_auth_external.c
    mod_auth_inst.c 
    mod_auth_system.c 
    mod_cntr.c 
    mod_disallow_id.c
    mod_fastcgi.c 
    mod_lock.c 
    mod_peephole.c 
    mod_put.c
    mod_qs2ssi.c
    mod_session.c 
)) {
    $add_module_options .= "--add-module=../../dist/apache/mod/$m ";
}
BnP::cmd(0, "CC=$cc " .
            "./configure -v " .
                        "--prefix=$prefix " .
                        "--sbindir=$prefix/bin " .
                        "--libexecdir=$prefix/lib/apache " .
                        "--sysconfdir=$prefix/etc/apache " .
                        "--datadir==$prefix/lib/internal " .
                        "--localstatedir=$vardir " .
                        "--enable-suexec " .
                        "--suexec-caller=www " .
                        "--suexec-userdir=.www" .
                        "--enable-module=most " .
                        $add_module_options .
                        "--with-perl=$prefix/bin/perl " .
                        "--add-modperl=../mod_perl-$MPV " .
                        "--enable-shared=max "
);
BnP::cmd(0, "make");
BnP::cmd(0, "make install");


Mime
View raw message