= How to install ZOO-Project on MacOS X = [[TOC(noheading)]] In this page you'll find all the required informations to build and run your ZOO-Kernel using a demo page. == Requirements == First of all, you'll need [http://developer.apple.com/technologies/tools/xcode.html XCode]. Before you start downloading ZOO-Project source code, you'll need ot install somme tools required to compile ZOO-Kernel properly. First of all install PROJ, GEOS and GDAL frameworks from [http://www.kyngchaos.com/software/frameworks here]. At this step, you should get the following directories on your local hard drive : {{{ #!sh /Library/Frameworks/PROJ.framework /Library/Frameworks/GEOS.framework /Library/Frameworks/GDAL.framework }}} Then, create a {{{src}}} directory and download inside [http://www.gnu.org/software/gettext/#TOCdownloading the gettext source code] and uncompress it. Now, compile gettext with the following commands to produce an universal binary : {{{ #!sh cd gettext-0.18.1.1 CFLAGS="-O -g -arch i386 -arch ppc -arch x86_64" \ LDFLAGS="-arch i386 -arch ppc -arch x86_64" ./configure make sudo make install }}} == Compiling and installing your ZOO-Kernel == Download source from SVN, then edit the {{{Makefile}}} in {{{zoo/thirds/cgic206/}}} directory to add on line 5 {{{-arch i386 -arch ppc -arch x86_64}}} to the {{{LIB}}} value. Then, use the following command to compile libcgic : {{{ #!sh svn co http://svn.zoo-project.org/svn/trunk zoo cd zoo/thirds/cgic206 make }}} If you produce the {{{libcgic.a}}} file, you can start run {{{autoconf}}} and then {{{configure}}} from {{{zoo-kernel}}} directory. {{{ #!sh cd zoo/zoo-kernel autoconf ./configure --with-gdal-config=/Library//Frameworks/GDAL.framework/Versions/1.7/Programs/gdal-config --with-python }}} Now you need to edit the Makefile to do the following modifications : * on line 6 : add "{{{-arch i386 -arch ppc -arch x86_64}}}" to the {{{CFLAGS}}} value * on line 93 : add "{{{-lcrypto -lintl /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation}}}" at the end Now, run the following content to compile and then deploy your ZOO-Kernel in your Apache server : {{{ #!sh make cp zoo_loader.cgi main.cfg /Library/WebServer/CGI-Executables }}} You should be ready to request your ZOO-Kernel installation using the following link : http://localhost/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS . If everything is ok, then you can follow next steps to deploy new Services Providers. == Deploy OGR Services Provider == === Requirements === Before your try to use any service, please set correct path in the main.cfg for {{{tmpPath}}} and {{{tmpUrl}}. You can use the following setup : {{{ tmpPath = /Library/WebServer/Documents/tmp tmpUrl = ../../tmp }}} Obviously you'll then need to create this directory, using the following command : {{{ #!sh mkdir /Library/WebServer/Documents }}} === C Version === To compile the base-vect-ops !ServicesProvider you'll need to edit the {{{Makefile}}} in {{{zoo/zoo-services/ogr/base-vect-ops/}}} directory. Add "{{{-I/Library//Frameworks/GEOS.framework/Versions/3/Headers/}}}" to the {{{CFLAGS}}} value on the first line. To compile, add GDAL framework to the {{{PATH}}} environmenet variable, to ensure that {{{gdal-config}}} tool will be found, run {{{make}}} and then copy {{{cgi-env}}} files in the {{{/Library/WebServer/CGI-Executables}}} directory. {{{ #!sh cd zoo/zoo-services/ogr/base-vect-ops/ export PATH=$PATH:/Library/Frameworks/GDAL.framework/Versions/1.7/Programs/ make cp cgi-env/* /Library/WebServer/CGI-Executables }}} {{{ #!html

You can test using this url if everything is ok with your setup.

}}} === Python Version === ==== Requirements ==== First of all run python from a Terminal.app and try the following import from the python interpreter : {{{ #!python import osgeo.ogr import libxml2 }}} If you don't get any trouble here then that means that you don't need to follow instructions from the next section, else you'll need. ===== Install LibXML2 Python Module ===== If you get an issue when importing the libxml2 module from your python interpreter then that mean you need to install the Python support for the libxml2 library which is already installed on you MacOS X environment. To accomplish this, you have first to determine what is the libxml2 installed on your platform, using the following command: {{{ #!sh xml2-config --version }}} Download the source corresponding to your version (i.e. on 10.6.6 you get 2.7.3) from the libxml2 [ftp://xmlsoft.org/libxml2/ download page] in src directory then uncompress it. Use the following command to install the python support : {{{ #!sh cd src/libxml2-2.7.3/python/ python setup.py install }}} ==== Deploy OGR Python Services Provider ==== Now copy the {{{zoo-services/ogt/base-vect-ops/cgi-env}}} files into {{{/Library/WebServer/CGI-Executables}}}. {{{ #!html

You can test using this url if everything is ok with your setup.

}}} == Test using Local Demo Page == Download this [/../trac/raw-attachment/wiki/ZooDocumentation/ZOOKernel/MacOSX_installation/zoo-demo.zip zip archive] then uncompress it in your personnal Sites directory (in your home directory). Load your local demo pages using the following urls, replacing !MyUserName by your MacOS user name : * http://localhost/~MyUserName/zoo-demo/spatialtools.html * http://localhost/~MyUserName/zoo-demo/spatialtools-py.html