[Mapserver-users] Installing Python-MapScript (once again)

Björn Platzen bplatzen at sosnetz.de
Wed Feb 26 23:26:03 PST 2003


--------------Boundary-00=_FZHY1LZ7A98Z7YCZOQ9K
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello list,

I've been searching the mail-archive and found that there is a setup.py=20
written by Norman Vine.
But this setup-script seems to be for MS 3.5 and it doesn't work with MS=20
3.6.4.
I always get the following error:

mapscript_wrap.c: In function `_raise_ms_exception':
mapscript_wrap.c:706: `ms_error' undeclared (first use in this function)
mapscript_wrap.c:706: (Each undeclared identifier is reported only once
mapscript_wrap.c:706: for each function it appears in.)
error: command 'gcc' failed with exit status 1

does anyone have a setup-script that works with 3.6.4 or is there anyone=20
who can tell me, what is to change in the 3.5-setup-script?

The setup.py is attached.

Any help would be great!

Thanks in advance,

Bjoern
--=20
small office solutions
info at sosnetz.de  -  http://www.sosnetz.de
--------------Boundary-00=_FZHY1LZ7A98Z7YCZOQ9K
Content-Type: text/x-python;
  charset="us-ascii";
  name="setup.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="setup.py"

#! /usr/bin/env python
# Distutils setup for UMN Mapserver mapscript v.3.5
# Norman Vine 11/10/2001

# On cygwin this will require my Distutils mods available @
# http://www.vso.cape.com/~nhv/files/python/mydistutils.txt
# Should work as is on 'Unix' like systems
# needs testing on Windows compilers other then Cygwin

# To Install
# build mapserver
# Copy this file to $MAPSERVER_SRC / mapscript / python
# invoke as ./setup.py install

# should work on any python version with Distutils

__revision__ = "$Id: mapscript_setup.py,v 1.5 2001/11/10 15:22:02 nhv Exp $"

from distutils.core import setup, Extension
from distutils.spawn import spawn
from distutils.dir_util import mkpath
from distutils.file_util import copy_file
from distutils.sysconfig import parse_makefile

import os,sys
from os import path

noisy=1
swig_cmd = ["swig",
            "-python",
            "-shadow",
            "-opt",
            "-DPYTHON",
            "-module",
            "MapScript",
            "-o",
            "./mapscript_wrap.c",
            "../mapscript.i" ]

try:                        
    spawn(swig_cmd, verbose=noisy)
except:
    print "\nSwig Error"
    raise sys.exit()

# make package directory and package __init__ script
mkpath("mapscript")
init_file=open(path.join("mapscript","__init__.py"),"w")
init_file.write("from MapScript import *\n")
init_file.close()

copy_file("MapScript.py", path.join("mapscript","MapScript.py"), verbose=noisy)

# change to reflect the gd version you are using
#gd_dir="gd-1.8.4"
gd_dir="gd-1.2"
ms_dir=path.join("..","..")
local_dir="/usr/local"

setup (# Distribution meta-data
       name = "pyMapScript",
       version = "3.5",
       description = "pre release",
       author = "Steve Lime",
       author_email = "steve.lime at dnr.state.mn.us",
       url = "http://mapserver.gis.umn.edu/",

       # Description of the modules and packages in the distribution
       packages = ['mapscript'],
       ext_modules = 
           [Extension('MapScriptc', ['mapscript_wrap.c'],
                      define_macros=[('TIFF_STATIC',),('JPEG_STATIC',),('ZLIB_STATIC',),
                          ('IGNORE_MISSING_DATA',),('USE_EPPL',),('USE_PROJ',),('USE_PROJ_API_H',),
                          ('USE_WMS',),('USE_TIFF',),('USE_JPEG',),('USE_GD_PNG',),('USE_GD_JPEG',),
                          ('USE_GD_WBMP',),('USE_GDAL',),('USE_POSTGIS',)],
                      include_dirs=[ms_dir,
                          path.join(ms_dir,gd_dir),
#                          path.join(ms_dir,"gdft"),
                          path.join(local_dir,'include/freetype'),
                          path.join(local_dir,'include')],
                      library_dirs=[ms_dir,
                          path.join(ms_dir,gd_dir),
#                          path.join(ms_dir,"gdft"),
                          '/lib',
                          path.join(local_dir,'lib')],
                      extra_objects=[path.join(ms_dir,'libmap.a'),
                          path.join(local_dir,'lib/ogrsf_frmts.a'),
                          path.join(local_dir,'lib/gdal.a'),
                          path.join(local_dir,'lib/ogr.a'),
                          path.join(local_dir,'lib/gdal.a'),
                          path.join(local_dir,'lib/cpl.a')],
#                      libraries=['gd','gdft','freetype','ttf','proj','pq','png','z'],),
                      libraries=['gd','freetype','ttf','png.dll','proj','pq','z'],),                          
           ]
      )

--------------Boundary-00=_FZHY1LZ7A98Z7YCZOQ9K--




More information about the MapServer-users mailing list