#!/bin/bash # # Build and package an EAPI-enabled Apache on Slackware. # (libmm is also installed with this package) # by: David Cantrell # modified by Gerrit to build # with modperl and modssl static included, all other # standard modules will build too. 2001-11-08 # (and all that on Cygwin;) ################################################################ # # # MAKE SURE THAT YU HAVE CYGWIN_PERL AND THE FOLLOWING # # PERL MODULES INSTALLED BEFORE RUNNING THIS SCRIPT! # # # # MIME::Base64 - Used in authentication headers # # Digest::MD5 - Needed to do Digest authentication # # URI 0.10 - There are URIs everywhere # # Net::FTP 2.00 - If you want ftp://-support # # HTML::HeadParser - To get the correct $res->base # # LWP - The reason why you need the modules above # # Devel::Symdump - Symbol table browsing with Apache::Status # # Data::Dumper - Used by Apache::PerlSections->dump # # CGI - CGI.pm - Well...why do ypu need modperl? # # Tie::IxHash - For order in sections # # # ################################################################ set -x APACHE_VER=1.3.20 MM_VER=1.1.3 MODSSL_VER=2.8.4 MODPERL_VER= CWD=`pwd` #TMP=/tmp TMP=$CWD PKG=$TMP/package-apache rm -rf $PKG mkdir -p $PKG ( cd $PKG ; tar zxf $CWD/_apache_ssl.tgz ) cd $TMP rm -rf $TMP/apache_$APACHE_VER rm -rf $TMP/mm-$MM_VER rm -rf $TMP/mod_ssl-$MODSSL_VER-$APACHE_VER rm -rf $TMP/modperl tar xzf $CWD/mm-$MM_VER.tar.gz tar xzf $CWD/apache_$APACHE_VER.tar.gz tar xzf $CWD/mod_ssl-$MODSSL_VER-$APACHE_VER.tar.gz tar xzf $CWD/modperl_20011107172048.tar.gz # build libmm cd $TMP/mm-$MM_VER ./configure --prefix=/usr --disable-shared 2>&1 | tee $CWD/log.configure-mm make 2>&1 | tee $CWD/log.make-mm # install libmm into the live system first, second install later for dist make install 2>&1 | tee $CWD/log.install-real-mm # EAPI is not part of Apache by default, it comes from mod_ssl. It # allows us to build and package mod_ssl seperately. We pull out the # EAPI patch and apply it to Apache so that our build will have that # support enabled. We also apply a few other patches from mod_ssl. ( cd $TMP/apache_$APACHE_VER cat $TMP/mod_ssl-$MODSSL_VER-$APACHE_VER/pkg.eapi/eapi.patch | patch -p0 cat $TMP/mod_ssl-$MODSSL_VER-$APACHE_VER/pkg.addon/addon.patch | patch -p0 ) ( cd $TMP/mod_ssl-$MODSSL_VER-$APACHE_VER/pkg.eapi cp -a *.h $TMP/apache_$APACHE_VER/src/include cp -a *.c $TMP/apache_$APACHE_VER/src/ap ) ( cd $TMP/mod_ssl-$MODSSL_VER-$APACHE_VER/pkg.addon cp -a *.c $TMP/apache_$APACHE_VER/src/modules/extra cp -a *.html $TMP/apache_$APACHE_VER/htdocs/manual/mod ) ( cp $TMP/modperl/htdocs/manual/mod/mod_perl.html \ $TMP/apache_$APACHE_VER/htdocs/manual/mod ) # configure mod_ssl cd $TMP/mod_ssl-$MODSSL_VER-$APACHE_VER ./configure \ --with-apache=../apache_$APACHE_VER \ --enable-rule=SSL_SDBM \ 2>&1 | tee $CWD/log.configure-mod_ssl # apply mod_perl to Apache source tree # and build/install the Perl-side of mod_perl ( in live system! ) #ln -s /lib/perl5/5.6.1/cygwin-multi/CORE/libperl5_6_1.a /lib/libperl.a #ln -s /lib/perl5/5.6.1/cygwin-multi/CORE/libperl5_6_1.a /lib/perl5/5.6.1/cygwin-multi/CORE/libperl.a cd $TMP/modperl perl Makefile.PL \ EVERYTHING=1 \ APACHE_SRC=../apache_$APACHE_VER/src \ USE_APACI=1 \ PREP_HTTPD=1 \ DO_HTTPD=1 2>&1 | tee $CWD/log.configure-mod_perl make 2>&1 | tee $CWD/log.make-mod_perl make install 2>&1 | tee $CWD/log.install-mod_perl # build apache cd $TMP/apache_$APACHE_VER cat $CWD/config.layout.slack >> config.layout patch -p1 < $CWD/apche.install.1.3.20.patch patch -p1 < $CWD/Config-1.3.20.patch SSL_BASE=/usr \ EAPI_MM=SYSTEM \ ./configure --enable-rule=SHARED_CORE \ --with-layout=Slackware \ --enable-module=most \ --enable-rule=eapi \ --enable-module=ssl \ --enable-rule=SSL_SDBM \ --activate-module=src/modules/perl/libperl.a \ --enable-module=perl \ --enable-module=rewrite \ 2>&1 | tee log.configure-apache-ssl-perl cd $TMP/apache_$APACHE_VER perl -i.bak -p -e 's#-lmm#-lmm -lperl5_6_1#;' $TMP/apache_$APACHE_VER/src/Makefile make 2>&1 | tee $CWD/log.make-apache # there is some interactivity when generating the certs # NOTE!!! make certificate 2>&1 | tee $CWD/log.certificate # install libmm cd $TMP/mm-$MM_VER make install prefix=$PKG/usr 2>&1 | tee $CWD/log.install-mm mkdir -p $PKG/usr/doc/mm-$MM_VER cp -a ChangeLog INSTALL LICENSE PORTING README THANKS \ $PKG/usr/doc/mm-$MM_VER # install apache cd $TMP/apache_$APACHE_VER make install root=$PKG 2>&1 | tee $CWD/log.install-apache mkdir -p $PKG/usr/doc/apache-$APACHE_VER cp -a ABOUT_APACHE Announcement INSTALL KEYS LICENSE README \ README.configure $PKG/usr/doc/apache-$APACHE_VER cp $TMP/mod_ssl-$MODSSL_VER-$APACHE_VER/pkg.eapi/README.EAPI \ $PKG/usr/doc/apache-$APACHE_VER cd $TMP/modperl mkdir -p $PKG/usr/doc/modperl cp CREDITS LICENSE apache-modlist.html mod_perl.gif README \ Changes SUPPORT ToDo $PKG/usr/doc/modperl mv $PKG/usr/libexec/libhttpd.dll $PKG/usr/bin # we do not want these in the package, if they don't exist on the system # then we copy the default one in place as the real file ( cd $PKG/etc/apache rm -rf access.conf httpd.conf magic mime.types srm.conf ) # we add a block to the end of httpd.conf and touch zero length files # for the SSL and PHP module packages cat << EOF >> $PKG/etc/apache/httpd.conf.default # By default, all external Apache modules are disabled. To enable a particular # module for Apache, make sure the necessary packages are installed. Then # uncomment the appropriate Include line below, save the file, and restart # Apache. Note that some modules may need additional configuration steps (for # example, mod_ssl requires a site certificate, you may need to generate that). # # Lastly, if you remove a module package, be sure to edit this file and comment # out the appropriate Include line. # ==> mod_php configuration settings <== # # PACKAGES REQUIRED: ossllibs.tgz (A series), mysql.tgz (AP series), # freetype.tgz (GTK series), gmp.tgz (GTK series), # and apache.tgz (N series) # #Include /etc/apache/mod_php.conf # ==> mod_ssl configuration settings <== # # PACKAGES REQUIRED: apache.tgz (N series) and openssl.tgz (N series) # #Include /etc/apache/mod_ssl.conf EOF # some housekeeping strip $PKG/usr/bin/* strip $PKG/usr/sbin/* gzip -9 $PKG/usr/man/*/* # make the package cd $PKG tar zcvf $TMP/apache-perl-ssl.tgz var usr etc tar jcvf $TMP/apache-perl-ssl.tbz var usr etc # clean up if [ "$1" = "--cleanup" ]; then cd $CWD rm -rf $TMP/apache_$APACHE_VER rm -rf $TMP/mm-$MM_VER rm -rf $TMP/mod_ssl-$MODSSL_VER-$APACHE_VER rm -rf $TMP/modperl rm -rf $PKG fi