| 1 | |
| 2 | = PostGIS RPM Installation = |
| 3 | |
| 4 | Version:1.0.4 for PostGIS RPM Set[[BR]] |
| 5 | Author:Devrim Gunduz <devrim@gunduz.org>[[BR]] |
| 6 | Date:Oct 04, 2005 |
| 7 | |
| 8 | == INTRODUCTION == |
| 9 | This document exists to explain the layout of the RPM for PostGIS . |
| 10 | |
| 11 | This document is written to be applicable to version 1.0.X of PostGIS |
| 12 | which is the current version of the RPM's as of this writing. More to the |
| 13 | point, versions prior to 1.0.X are not documented here. |
| 14 | |
| 15 | It is preferable for the distribution-specific set to be the one used. |
| 16 | If you want to stay up-to-date on the PostGIS core itself, use the community |
| 17 | RPMS. These RPMs are kept up2date. |
| 18 | |
| 19 | PostGIS RPM is installed as every RPM, so it is not mentioned in here. |
| 20 | |
| 21 | == BUILDING RPMS == |
| 22 | To build RPMs, you'll need the following: |
| 23 | * The source tarball of PostGIS. |
| 24 | * PostGIS spec (see extras/rpm/spec for the file) |
| 25 | * Some patches/sources from CVS (see extras/rpm/patches for the files) |
| 26 | |
| 27 | Please note that you'll need some development tools for building PostGIS. You'll |
| 28 | be prompted for this prerequisites. |
| 29 | |
| 30 | Here is a basic guide for building RPMs: |
| 31 | |
| 32 | # Move the patches/sources and source tarball into /usr/src/redhat/SOURCES |
| 33 | # Next, move the spec file under /usr/src/redhat/SPECS |
| 34 | # Run the following command: rpmbuild -bb postgis.spec |
| 35 | This will build RPMs for you. |
| 36 | |
| 37 | NOTES (neverhood@sibmail.com) for building postgis-1.3.1 on Fedora Core 6. |
| 38 | |
| 39 | I found that spec file in postgis-1.3.1tar.gz have invalid make command. In original spec file it is: |
| 40 | |
| 41 | {{{ |
| 42 | make %{?_smp_mflags} LPATH=`pg_config --pkglibdir` shlib="%{name}.so" |
| 43 | |
| 44 | }}} |
| 45 | |
| 46 | (and with that command you'll get incorrect lwpostgis.sql and spatial_ref_sys.sql files). |
| 47 | |
| 48 | Replace this command with that one: |
| 49 | |
| 50 | {{{ |
| 51 | make %{?_smp_mflags} LPATH=`pg_config --pkglibdir` |
| 52 | |
| 53 | }}} |
| 54 | |
| 55 | After this changes you'll get right postgis rpm package. |
| 56 | /* end of notes */ |
| 57 | |
| 58 | The RPMs will be placed under /usr/src/redhat/RPMS/i386/ |
| 59 | If you specify an explicit target while rpmbuild, then the directory may change: |
| 60 | |
| 61 | Command: rpmbuild -bb --target i686 postgis.spec[[BR]] |
| 62 | Resulting directory: /usr/src/redhat/RPMS/i686/ |
| 63 | |
| 64 | == RPM FILE LOCATIONS. == |
| 65 | To be in compliance with the Linux FHS, the PostGIS RPMs install files in |
| 66 | a manner not consistent with most of the PostGIS documentation. According |
| 67 | to the standard PostGIS documentation, PostGIS is installed under the |
| 68 | directory /usr/local, with executables, source, and data existing in |
| 69 | various subdirectories. |
| 70 | |
| 71 | Different distributions have different ideas of some of these file locations. |
| 72 | In particular, the documentation directory can be /usr/doc, /usr/doc/packages, |
| 73 | /usr/share/doc, /usr/share/doc/packages, or some other similar path. The current |
| 74 | Red Hat / Fedora Core locations are listed below. |
| 75 | |
| 76 | However, the RPM's install the files like this: |
| 77 | |
| 78 | |
| 79 | Executables: /usr/bin[[BR]] |
| 80 | Libraries: /usr/lib[[BR]] |
| 81 | Documentation: /usr/share/doc/postgis-x.y.z[[BR]] |
| 82 | JDBC2 related: /usr/shara/java[[BR]] |
| 83 | Perl utils: /usr/bin |
| 84 | |
| 85 | |
| 86 | |
| 87 | Use of 'rpm -ql' for each package is recommended as the 'Official' location source. |
| 88 | |
| 89 | While it may seem gratuitous to place these files in different locations, the |
| 90 | FHS requires it -- distributions should not ever touch /usr/local. It may |
| 91 | also seem like more work to keep track of where everything is -- but, that's |
| 92 | the beauty of RPM -- you don't have to keep track of the files, RPM does it |
| 93 | for you. |
| 94 | |
| 95 | These RPMs are designed to be LSB-compliant -- if you find this not to be the |
| 96 | case, please let me know by way of the postgis-devel@PostGIS.org mailing |
| 97 | list. |
| 98 | |
| 99 | == REBUILDING FROM SOURCE RPM == |
| 100 | If your distribution is not supported by the binary RPM's from PostGIS.org, |
| 101 | you will need to rebuild from the source RPM. Download the .src.rpm for this |
| 102 | release. You will need to be root to rebuild, unless you have already set up |
| 103 | a non-root build environment. |
| 104 | |
| 105 | Install the source RPM with rpm -i, then CD to the rpm building area (on RedHat |
| 106 | or Fedora Core, this is /usr/src/redhat by default). You will have to have a full |
| 107 | development environment to rebuild the RPM. |
| 108 | |
| 109 | This release of the RPM includes the ability to conditionally build |
| 110 | sets of packages. The parameters, their defaults, and the meanings are: |
| 111 | |
| 112 | jdbc2: Build the RPM with jdbc2 support (default value is 1)[[BR]] |
| 113 | utils: Build the RPM with perl utils (default value is 1) |
| 114 | |
| 115 | To use these defines, invoke a rebuild like this: |
| 116 | |
| 117 | {{{ |
| 118 | rpm --rebuild --define 'jdbc2 0 ' --define 'utils' postgis-1.0.4-1.src.rpm |
| 119 | |
| 120 | }}} |
| 121 | |
| 122 | This line would disable the jdbc2 and utils, if requested. |
| 123 | |
| 124 | Please note that the spec file needs some patches to PostGIS source tree to build, so you |
| 125 | may need to download them via CVS before rebuilding the package. |
| 126 | |
| 127 | == MORE INFORMATION == |
| 128 | You can get more information at http://www.PostGIS.org |
| 129 | |
| 130 | Please help make this packaging better -- let me know if you find problems, or |
| 131 | better ways of doing things. You can reach us by e-mail at |
| 132 | postgis-devel@lists.refractions.net . |