Added DESTDIR option which is used as an additional prefix for the purposes of

installing files. It is useful for binary distributions (eg
RPM etc). Thanks to Dominic Hargreaves!
This commit is contained in:
Artem Pavlenko 2006-12-17 12:05:47 +00:00
parent dee8851b26
commit 31442b6bac
8 changed files with 22 additions and 14 deletions

View file

@ -48,6 +48,7 @@ opts.Add(PathOption('PYTHON','Python executable', sys.executable))
opts.Add(ListOption('INPUT_PLUGINS','Input drivers to include','all',['postgis','shape','raster'])) opts.Add(ListOption('INPUT_PLUGINS','Input drivers to include','all',['postgis','shape','raster']))
opts.Add(ListOption('BINDINGS','Language bindings to build','all',['python'])) opts.Add(ListOption('BINDINGS','Language bindings to build','all',['python']))
opts.Add('DEBUG', 'Compile a debug version of mapnik', '') opts.Add('DEBUG', 'Compile a debug version of mapnik', '')
opts.Add('DESTDIR', 'The root directory to install into. Useful mainly for binary package building', '/')
opts.Add('BIDI', 'BIDI support', '') opts.Add('BIDI', 'BIDI support', '')
env = Environment(ENV=os.environ, options=opts) env = Environment(ENV=os.environ, options=opts)

View file

@ -24,6 +24,7 @@ import glob
Import('env') Import('env')
prefix = env['PYTHON_PREFIX'] + '/'+ 'lib' + '/python' + env['PYTHON_VERSION'] + '/site-packages/' prefix = env['PYTHON_PREFIX'] + '/'+ 'lib' + '/python' + env['PYTHON_VERSION'] + '/site-packages/'
install_prefix = env['DESTDIR'] + '/' + prefix
libraries = ['mapnik', 'boost_python%s' % env['BOOST_APPEND']] libraries = ['mapnik', 'boost_python%s' % env['BOOST_APPEND']]
headers = [env['PYTHON_PREFIX'] + '/include/python' + env['PYTHON_VERSION']] + env['CPPPATH'] headers = [env['PYTHON_PREFIX'] + '/include/python' + env['PYTHON_VERSION']] + env['CPPPATH']
@ -39,8 +40,8 @@ fontscollectionpath = mapniklibpath + '/fonts'
file('mapnik/paths.py','w').write(paths % (env['PREFIX'] + '/'+env['LIBDIR_SCHEMA']+'/mapnik',)) file('mapnik/paths.py','w').write(paths % (env['PREFIX'] + '/'+env['LIBDIR_SCHEMA']+'/mapnik',))
pymapnik = glob.glob('mapnik/*.py') pymapnik = glob.glob('mapnik/*.py')
env.Alias(target='install', source=env.Install(prefix+'/mapnik', pymapnik)) env.Alias(target='install', source=env.Install(install_prefix+'/mapnik', pymapnik))
pymapnik2 = glob.glob('mapnik/ogcserver/*.py') pymapnik2 = glob.glob('mapnik/ogcserver/*.py')
env.Alias(target='install', source=env.Install(prefix+'/mapnik/ogcserver', pymapnik2)) env.Alias(target='install', source=env.Install(install_prefix+'/mapnik/ogcserver', pymapnik2))
pymapniklib = env.Install(prefix+'/mapnik',_mapnik) pymapniklib = env.Install(install_prefix+'/mapnik',_mapnik)
env.Alias(target="install",source=pymapniklib) env.Alias(target="install",source=pymapniklib)

View file

@ -22,6 +22,7 @@ import glob
Import('env') Import('env')
prefix = env['PREFIX'] prefix = env['PREFIX']
install_prefix = env['DESTDIR'] + '/' + prefix
includes = glob.glob('*/*.ttf') includes = glob.glob('*/*.ttf')
env.Alias(target='install', source=env.Install(prefix+'/' + env['LIBDIR_SCHEMA'] + '/mapnik/fonts', includes)) env.Alias(target='install', source=env.Install(install_prefix+'/' + env['LIBDIR_SCHEMA'] + '/mapnik/fonts', includes))

View file

@ -22,6 +22,7 @@
Import ('env') Import ('env')
prefix = env['PREFIX'] prefix = env['PREFIX']
install_prefix = env['DESTDIR'] + '/' + prefix
postgis_src = Split( postgis_src = Split(
""" """
@ -32,5 +33,5 @@ postgis_src = Split(
postgis_inputdriver = env.SharedLibrary('postgis', source=postgis_src, SHLIBPREFIX='', LIBS='pq') postgis_inputdriver = env.SharedLibrary('postgis', source=postgis_src, SHLIBPREFIX='', LIBS='pq')
env.Install(prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', postgis_inputdriver) env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', postgis_inputdriver)
env.Alias('install', prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') env.Alias('install', install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input')

View file

@ -22,6 +22,7 @@
Import ('env') Import ('env')
prefix = env['PREFIX'] prefix = env['PREFIX']
install_prefix = env['DESTDIR'] + '/' + prefix
raster_src = Split( raster_src = Split(
""" """
@ -33,5 +34,5 @@ raster_src = Split(
raster_inputdriver = env.SharedLibrary('raster', source=raster_src, SHLIBPREFIX='', LIBS=[]) raster_inputdriver = env.SharedLibrary('raster', source=raster_src, SHLIBPREFIX='', LIBS=[])
env.Install(prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', raster_inputdriver) env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', raster_inputdriver)
env.Alias('install', prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') env.Alias('install', install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input')

View file

@ -23,6 +23,7 @@
Import ('env') Import ('env')
prefix = env['PREFIX'] prefix = env['PREFIX']
install_prefix = env['DESTDIR'] + '/' + prefix
shape_src = Split( shape_src = Split(
""" """
@ -38,5 +39,5 @@ shape_src = Split(
shape_inputdriver = env.SharedLibrary('shape', source=shape_src, SHLIBPREFIX='', LIBS=[]) shape_inputdriver = env.SharedLibrary('shape', source=shape_src, SHLIBPREFIX='', LIBS=[])
env.Install(prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', shape_inputdriver) env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', shape_inputdriver)
env.Alias('install', prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') env.Alias('install', install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input')

View file

@ -25,6 +25,7 @@ import glob
Import('env') Import('env')
prefix = env['PREFIX'] prefix = env['PREFIX']
install_prefix = env['DESTDIR'] + '/' + prefix
libraries = ['agg'] + env['LIBS'] libraries = ['agg'] + env['LIBS']
@ -73,6 +74,6 @@ source += Split(
mapnik = env.SharedLibrary('mapnik', source, LIBS=libraries, LINKFLAGS=linkflags) mapnik = env.SharedLibrary('mapnik', source, LIBS=libraries, LINKFLAGS=linkflags)
env.Alias(target='install', source=env.Install(prefix + '/' + env['LIBDIR_SCHEMA'], mapnik)) env.Alias(target='install', source=env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'], mapnik))
includes = glob.glob('../include/mapnik/*.hpp') includes = glob.glob('../include/mapnik/*.hpp')
env.Alias(target='install', source=env.Install(prefix+'/include/mapnik', includes)) env.Alias(target='install', source=env.Install(install_prefix+'/include/mapnik', includes))

View file

@ -24,6 +24,7 @@ import glob
Import ('env') Import ('env')
prefix = env['PREFIX'] prefix = env['PREFIX']
install_prefix = env['DESTDIR'] + '/' + prefix
source = Split( source = Split(
""" """
@ -37,5 +38,5 @@ headers = ['#plugins/input/shape'] + env['CPPPATH']
shapeindex = env.Program('shapeindex', source, CPPPATH=headers, LIBS='boost_program_options%s' % env['BOOST_APPEND']) shapeindex = env.Program('shapeindex', source, CPPPATH=headers, LIBS='boost_program_options%s' % env['BOOST_APPEND'])
env.Install(prefix + '/bin', shapeindex) env.Install(install_prefix + '/bin', shapeindex)
env.Alias('install', prefix + '/bin') env.Alias('install', install_prefix + '/bin')