| 1 | = How to install ZOO-Project on MacOS X = |
| 2 | |
| 3 | [[TOC(noheading)]] |
| 4 | |
| 5 | In this page you'll find all the required informations to build and run your ZOO-Kernel using a demo page. |
| 6 | |
| 7 | == Requirements == |
| 8 | |
| 9 | Before you start downloading ZOO-Project source code, you'll need ot install somme tools required to compiel ZOO-Kernel properly. |
| 10 | |
| 11 | First of all install PROJ, GEOS and GDAL frameworks from [http://www.kyngchaos.com/software/frameworks here]. |
| 12 | |
| 13 | At this step you should get the following directories created : |
| 14 | |
| 15 | {{{ |
| 16 | #!sh |
| 17 | /Library/Frameworks/PROJ.framework |
| 18 | /Library/Frameworks/GEOS.framework |
| 19 | /Library/Frameworks/GDAL.framework |
| 20 | }}} |
| 21 | |
| 22 | Then, create a src directory and download inside [http://www.gnu.org/software/gettext/#TOCdownloading the gettext source code] and uncompress it. |
| 23 | |
| 24 | Now, compile gettext with the following commands to produce an universal binary : |
| 25 | {{{ |
| 26 | #!sh |
| 27 | cd gettext-0.18.1.1 |
| 28 | CFLAGS="-O -g -arch i386 -arch ppc -arch x86_64" \ |
| 29 | LDFLAGS="-arch i386 -arch ppc -arch x86_64" ./configure |
| 30 | make |
| 31 | sudo make install |
| 32 | }}} |
| 33 | |
| 34 | == Compiling and installing your ZOO-Kernel == |
| 35 | |
| 36 | Download source from SVN, then edit the {{{Makfile}}} 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 : |
| 37 | |
| 38 | {{{ |
| 39 | #!sh |
| 40 | svn co http://svn.zoo-project.org/svn/trunk zoo |
| 41 | cd zoo/thirds/cgic206 |
| 42 | make |
| 43 | }}} |
| 44 | |
| 45 | If you produce the {{{libcgic.a}}} file, you can start run autoconf and then configure. Note that you would comment first line of the configure.ac file to avoid error caused by different version of autoconf. |
| 46 | |
| 47 | {{{ |
| 48 | #!sh |
| 49 | cd zoo/zoo-kernel |
| 50 | autoconf |
| 51 | ./configure --with-gdal-config=/Library//Frameworks/GDAL.framework/Versions/1.7/Programs/gdal-config --with-python |
| 52 | }}} |
| 53 | |
| 54 | Now you need to edit the Makefile to do the following modifications : |
| 55 | * on line 6 : add {{{-arch i386 -arch ppc -arch x86_64}}} to the {{{CFLAGS}}} value |
| 56 | * on line 93 : add {{{-lcrypto -lintl}}} at the end |
| 57 | |
| 58 | Now, run the following content to compile and then deploy your ZOO-Kernel in your Apache server : |
| 59 | {{{ |
| 60 | #!sh |
| 61 | make |
| 62 | cp zoo_loader.cgi main.cfg /Library/WebServer/CGI-Executables |
| 63 | }}} |
| 64 | |
| 65 | 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 . |
| 66 | |
| 67 | If everything is ok, then you can follow next steps to deploy new Services Providers. |
| 68 | |
| 69 | == Deploy OGR Services Provider == |
| 70 | |
| 71 | === Requirements === |
| 72 | |
| 73 | Before your try to use any service, please set correct path in the main.cfg for {{{tmpPath}}} and {{{tmpUrl}}. |
| 74 | |
| 75 | You can use the following setup : |
| 76 | {{{ |
| 77 | tmpPath = /Library/WebServer/Documents/tmp |
| 78 | tmpUrl = ../../tmp |
| 79 | }}} |
| 80 | |
| 81 | Obviously you'll then need to create this directory, use the following command : |
| 82 | |
| 83 | {{{ |
| 84 | #!sh |
| 85 | mkdir /Library/WebServer/Documents |
| 86 | }}} |
| 87 | |
| 88 | |
| 89 | |
| 90 | === C Version === |
| 91 | |
| 92 | 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}}} to ensure that {{{gdal-config}}} tool will be found, run {{{make}}} and then copy {{{cgi-env}}} files in {{{/Library/WebServer/CGI-Executables}}} directory. |
| 93 | |
| 94 | {{{ |
| 95 | #!sh |
| 96 | cd zoo/zoo-services/ogr/base-vect-ops/ |
| 97 | export PATH=$PATH:/Library/Frameworks/GDAL.framework/Versions/1.7/Programs/ |
| 98 | make |
| 99 | cp cgi-env/* /Library/WebServer/CGI-Executables |
| 100 | }}} |
| 101 | |
| 102 | |
| 103 | {{{ |
| 104 | #!html |
| 105 | <p> |
| 106 | You can test using this |
| 107 | <a href="http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=Buffer&DataInputs=BufferDistance=1@datatype=interger;InputPolygon=Reference@xlink:href=http%3A%2F%2Fwww.zoo-project.org%3A8082%2Fgeoserver%2Fows%3FSERVICE%3DWFS%26REQUEST%3DGetFeature%26VERSION%3D1.0.0%26typename%3Dtopp%3Astates%26SRS%3DEPSG%3A4326%26FeatureID%3Dstates.15"> url</a> |
| 108 | if everything is ok with your setup. |
| 109 | </p> |
| 110 | }}} |
| 111 | |
| 112 | === Python Version === |
| 113 | |
| 114 | ==== Requirements ==== |
| 115 | |
| 116 | First of all run python from a Terminal.app and try the following import from the python interpreter : |
| 117 | {{{ |
| 118 | #!python |
| 119 | import osgeo.ogr |
| 120 | import libxml2 |
| 121 | }}} |
| 122 | |
| 123 | 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. |
| 124 | |
| 125 | ===== Install LibXML2 Python Module ===== |
| 126 | |
| 127 | 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: |
| 128 | {{{ |
| 129 | #!sh |
| 130 | xml2-config --version |
| 131 | }}} |
| 132 | |
| 133 | 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. |
| 134 | |
| 135 | Use the following command to install the python support : |
| 136 | {{{ |
| 137 | #!sh |
| 138 | cd src/libxml2-2.7.3/python/ |
| 139 | python setup.py install |
| 140 | }}} |
| 141 | |
| 142 | ==== Deploy OGR Python Services Provider ==== |
| 143 | |
| 144 | Now copy the {{{zoo-services/ogt/base-vect-ops/cgi-env}}} files into {{{/Library/WebServer/CGI-Executables}}}. |
| 145 | |
| 146 | {{{ |
| 147 | #!html |
| 148 | <p> |
| 149 | You can test using this |
| 150 | <a href="http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=BufferPy&DataInputs=BufferDistance=1@datatype=interger;InputPolygon=Reference@xlink:href=http%3A%2F%2Fwww.zoo-project.org%3A8082%2Fgeoserver%2Fows%3FSERVICE%3DWFS%26REQUEST%3DGetFeature%26VERSION%3D1.0.0%26typename%3Dtopp%3Astates%26SRS%3DEPSG%3A4326%26FeatureID%3Dstates.15"> url</a> |
| 151 | if everything is ok with your setup. |
| 152 | </p> |
| 153 | }}} |
| 154 | |
| 155 | == Test using Local Demo Page == |
| 156 | |
| 157 | Download using this zip archive then uncompress it in your Sites directory. Load your local demo pages using the following urls, replacing MyUserName by your MacOS user name : |
| 158 | * http://localhost/~MyUserName/zoo-demo/spatialtools.html |
| 159 | * http://localhost/~MyUserName/zoo-demo/spatialtools-py.html |