has anyone succesfully build the postgresql extension postgis with openpkg before?

i'm trying to build a rpm for postgis. postgis needs two additional libraries (proj and geos), for which i could easly build an rpm that creates them as static libraries.

postgis has no configure-option to build a static library.
but since postgresql-openpkg-rpm creates a static library for the plpgsql extension, i expected that postgis would run too.

but when i activate a postgis-function in postgres i get an error:

ERROR: could not load library "/opt/pintomap/lib/liblwgeom.so.1.1": /opt/pintomap/lib/liblwgeom.so.1.1: undefined symbol: _Znwj

it seems that the shared library misses needs c++-libraries. this makes sense, since geos is written in c++. unfortunatly i have no idea how to link the c++-stuff to the shared library. i tried to add c++-support to postgresql by using the build-option with_cxx, but that didn't change anything.

since i'm still quite unfamiliar with building openpkg-rpm any hint is welcome.

here's my spec-file:

#   package versions
%define       V_postgis         1.1.1

#   package information
Name:         postgis
Summary:      PostGIS GIS Extension for PostgreSQL Database
URL:          http://www.postgis.org/
Vendor:       Refractions Research
Packager:     OpenPKG
Distribution: OpenPKG
Class:        JUNK
Group:        Database
License:      GPL
Version:      %{V_postgis}
Release:      20060220

#   package options
%option       with_proj      yes
%option       with_geos      yes

#   list of sources
Source0:        
http://postgis.refractions.net/download/postgis-%{V_postgis}.tar.gz
Patch0:       postgis.patch

#   build information
Prefix:       %{l_prefix}
BuildRoot:    %{l_buildroot}
BuildPreReq:  OpenPKG, openpkg >= 20040130, postgresql >= 8.0.0, make, gcc
PreReq:       OpenPKG, openpkg >= 20040130, postgresql >= 8.0.0
%if "%{with_proj}" == "yes"
BuildPreReq:  proj >= 4.4.9
PreReq:       proj
%endif
%if "%{with_proj}" == "yes"
BuildPreReq:  geos >= 2.2.1
PreReq:       proj
%endif
AutoReq:      no
AutoReqProv:  no

%description
PostGIS adds support for geographic objects to the PostgreSQL object-relational database. In effect, PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend spatial database for geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS follows the OpenGIS "Simple Features Specification for SQL"
     and will be submitted for conformance testing at version 1.0.

%track
    prog postgis = {
        version   = %{V_postgis}
        url       = http://postgis.refractions.net/download/
        regex     = postgis-(__VER__)\.tar\.gz
    }

%prep
    %setup -q
#    %patch -p0

%build
    rm -rf $RPM_BUILD_ROOT

    #   configure package
    ( echo "ac_cv_func_isinf=no"
    ) >config.cache
    export CC="%{l_cxx}"
    export CFLAGS="%{l_cflags -O}"
    export LDFLAGS="%{l_ldflags} -lpq -lssl -lcrypto -lcrypt"
    export AROPT="rvc"
    export RANLIB="ranlib"
    export TAR="%{l_tar}"
    ./configure \
        --cache-file=./config.cache \
        --prefix=%{l_prefix} \
        --datadir=%{l_prefix}/share/postgis \
        --sysconfdir=%{l_prefix}/etc/postgis \
        --localstatedir=%{l_prefix}/var/postgis \
%if "%{with_proj}" == "yes"
        --with-proj \
%else
        --without-proj \
%endif
%if "%{with_proj}" == "yes"
        --with-geos \
%else
        --without-geos \
%endif
        --disable-shared

    #   build package
    %{l_make} %{l_mflags}


%install
    rm -rf $RPM_BUILD_ROOT

    #   perform standard installation procedure
    cp /dev/null register.txt
    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT

    #   determine installation files
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
        %{l_files_std} `cat perl-openpkg-files`

%files -f files

%clean
    rm -rf $RPM_BUILD_ROOT


______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
User Communication List                      openpkg-users@openpkg.org

Reply via email to