<project name=“nativeIndian” default=“ApacheBuild” basedir=“.”>
<!–
11/2009 – ORN
===
– Apache -
http://www.apachelounge.com/viewtopic.php?t=778
http://www.devside.net/guides/windows/apache
-
http://www.openssl.org/source/
http://httpd.apache.org/download.cgi
http://www.zlib.net/
****
Note –
ActivePerl and Awk need to be present and available in the path.
VS2005 is used to compile.
****
This script will attempt the following
==========================================
* Unzip sources
* Set sources in place for compile
* Compile OpenSsl
* Test OpenSsl
* Compile Apache
–>
<!– set global properties for this build –>
<property name=“ApacheName” value=“Apache22″ />
<property name=“srcDir” location=“${basedir}/../” />
<property name=“libDir” location=“${basedir}/../lib/” />
<property name=“zipLibDir” location=“${basedir}/../lib/zlib/” />
<!– Source –>
<property name=“OpenSslTop” value=“openssl-0.9.8l” />
<property name=“OpenSslSourceGz” location=“${basedir}/../${OpenSslTop}.tar.gz” />
<property name=“OpenSslSourceTar” location=“${basedir}/../${OpenSslTop}.tar” />
<property name=“ZlibTop” value=“zlib-1.2.3″ />
<property name=“ZlibSourceGz” location=“${basedir}/../${ZlibTop}.tar.gz” />
<property name=“ZlibSourceTar” location=“${basedir}/../${ZlibTop}.tar” />
<property name=“ApacheSourceTop” value=“httpd-2.2.14″ />
<property name=“ApacheSource” location=“${basedir}/../${ApacheSourceTop}-win32-src.zip” />
<property name=“ApacheBin” value=“Apache_bin.zip” />
<!– Build dirs–>
<property name=“buildDir” location=“${basedir}/aphache/” />
<property name=“buildLibDir” location=“${buildDir}/${ApacheSourceTop}/srclib/” />
<property name=“buildLibZlibDir” location=“${buildDir}/${ApacheSourceTop}/srclib/zlib/” />
<property name=“buildLibOpenSslDir” location=“${buildDir}/${ApacheSourceTop}/srclib/OpenSsl/” />
<!– Hardcoded, VS2005 location –>
<property name=“VsEnvir” location=“D:\apps\dev\Ide\vs2005\VC\vcvarsall.bat” />
<!– TIMESTAMPS –>
<tstamp>
<format property=“TheStartTime” pattern=“dd-MM-yyyy hh:mm aa” />
</tstamp>
<!– DEFAULT RUN TARGETS –>
<target name=“ApacheBuild” depends=“startme,cleanUp,setup,compile,zipbin” >
<echo message=“– Ending=${TheStartTime}” />
<echo message=“– Done !” />
</target>
<!– Startup –>
<target name=“startme” >
<echo message=“– Start startme:” />
<echo message=“– ${TheStartTime}” />
<mkdir dir=“${buildDir}” />
</target>
<!– Fails on cleanup, as it might be clean already, or never created –>
<target name=“cleanUp” >
<echo message=“– Start cleanup:” />
<delete dir=“${buildDir}” failonerror=“yes”/>
<delete file=“${basedir}/${ApacheBin}” />
</target>
<!– Unzip and copy –>
<target name=“setup” >
<echo message=“– Start setup:” />
<!– make sure the build dir is present –>
<mkdir dir=“${buildDir}” />
<!– Apache source –>
<unzip src=“${ApacheSource}” dest=“${buildDir}”/>
<!– OpenSsl source –>
<gunzip src=“${OpenSslSourceGz}”/>
<untar src=“${OpenSslSourceTar}” dest=“${buildDir}”/>
<!– Add openssl to source dir –>
<move todir=“${buildLibOpenSslDir}”>
<fileset dir=“${buildDir}/${OpenSslTop}”/>
</move>
<!– Zlib source –>
<gunzip src=“${ZlibSourceGz}”/>
<untar src=“${ZlibSourceTar}” dest=“${buildDir}”/>
<!– Add Zlib to source dir –>
<move todir=“${buildLibZlibDir}”>
<fileset dir=“${buildDir}/${ZlibTop}”/>
</move>
<!– Add zlib lib to source dir as well –>
<copy file=“${zipLibDir}/zdll.lib” todir=“${buildLibZlibDir}”/>
</target>
<!– Compile packages –>
<target name=“compile” >
<echo message=“– Start compile:” />
<!– Vs2005 environment variables –>
<exec executable=“cmd”>
<arg value=“/c”/>
<arg value=“${VsEnvir}”/>
</exec>
<!– Build OpenSsl –>
<echo message=“– Start compile OpenSsl:” />
<exec executable=“cmd” dir=“${buildLibOpenSslDir}” >
<arg value=“/c”/>
<arg value=“perl Configure VC-WIN32″/>
</exec>
<exec executable=“cmd” dir=“${buildLibOpenSslDir}”>
<arg value=“/c”/>
<arg value=“ms\do_masm”/>
</exec>
<exec executable=“cmd” dir=“${buildLibOpenSslDir}”>
<arg value=“/c”/>
<arg value=“nmake -f ms\ntdll.mak”/>
</exec>
<!– Test OpenSsl –>
<echo message=“– Start test OpenSsl:” />
<exec executable=“cmd” dir=“${buildLibOpenSslDir}/out32dll”>
<arg value=“/c”/>
<arg value=“..\ms\test”/>
</exec>
<!– Build Apache with the default localhost, port 80 –>
<echo message=“– Start compile Apache:” />
<exec executable=“cmd” dir=“${buildDir}/${ApacheSourceTop}”>
<arg value=“/c”/>
<arg value=“nmake /f Makefile.win SERVERNAME=localhost PORT=80 INSTDIR=${buildDir}/../${ApacheName} installr”/>
</exec>
</target>
<!– Zip up the Apache –>
<target name=“zipbin” >
<zip
destfile=“${basedir}/${ApacheBin}”
basedir=“${buildDir}/../${ApacheName}”
/>
</target>
</project>