diff --git a/SConstruct b/SConstruct index d1adb102b..d2fa42ae1 100644 --- a/SConstruct +++ b/SConstruct @@ -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('BINDINGS','Language bindings to build','all',['python'])) 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', '') env = Environment(ENV=os.environ, options=opts) diff --git a/bindings/python/SConscript b/bindings/python/SConscript index 4b5870cbc..39a73c4d9 100644 --- a/bindings/python/SConscript +++ b/bindings/python/SConscript @@ -24,6 +24,7 @@ import glob Import('env') prefix = env['PYTHON_PREFIX'] + '/'+ 'lib' + '/python' + env['PYTHON_VERSION'] + '/site-packages/' +install_prefix = env['DESTDIR'] + '/' + prefix libraries = ['mapnik', 'boost_python%s' % env['BOOST_APPEND']] 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',)) 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') -env.Alias(target='install', source=env.Install(prefix+'/mapnik/ogcserver', pymapnik2)) -pymapniklib = env.Install(prefix+'/mapnik',_mapnik) +env.Alias(target='install', source=env.Install(install_prefix+'/mapnik/ogcserver', pymapnik2)) +pymapniklib = env.Install(install_prefix+'/mapnik',_mapnik) env.Alias(target="install",source=pymapniklib) diff --git a/fonts/SConscript b/fonts/SConscript index 01a24726b..5c4666468 100644 --- a/fonts/SConscript +++ b/fonts/SConscript @@ -22,6 +22,7 @@ import glob Import('env') prefix = env['PREFIX'] +install_prefix = env['DESTDIR'] + '/' + prefix 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)) diff --git a/plugins/input/postgis/SConscript b/plugins/input/postgis/SConscript index d7ea75ae2..d21b875cd 100644 --- a/plugins/input/postgis/SConscript +++ b/plugins/input/postgis/SConscript @@ -22,6 +22,7 @@ Import ('env') prefix = env['PREFIX'] +install_prefix = env['DESTDIR'] + '/' + prefix postgis_src = Split( """ @@ -32,5 +33,5 @@ postgis_src = Split( postgis_inputdriver = env.SharedLibrary('postgis', source=postgis_src, SHLIBPREFIX='', LIBS='pq') -env.Install(prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', postgis_inputdriver) -env.Alias('install', prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') +env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', postgis_inputdriver) +env.Alias('install', install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') diff --git a/plugins/input/raster/SConscript b/plugins/input/raster/SConscript index 50e8ec547..ea3d89627 100644 --- a/plugins/input/raster/SConscript +++ b/plugins/input/raster/SConscript @@ -22,6 +22,7 @@ Import ('env') prefix = env['PREFIX'] +install_prefix = env['DESTDIR'] + '/' + prefix raster_src = Split( """ @@ -33,5 +34,5 @@ raster_src = Split( raster_inputdriver = env.SharedLibrary('raster', source=raster_src, SHLIBPREFIX='', LIBS=[]) -env.Install(prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', raster_inputdriver) -env.Alias('install', prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') +env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', raster_inputdriver) +env.Alias('install', install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') diff --git a/plugins/input/shape/SConscript b/plugins/input/shape/SConscript index f374f3a7b..c718109a3 100644 --- a/plugins/input/shape/SConscript +++ b/plugins/input/shape/SConscript @@ -23,6 +23,7 @@ Import ('env') prefix = env['PREFIX'] +install_prefix = env['DESTDIR'] + '/' + prefix shape_src = Split( """ @@ -38,5 +39,5 @@ shape_src = Split( shape_inputdriver = env.SharedLibrary('shape', source=shape_src, SHLIBPREFIX='', LIBS=[]) -env.Install(prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', shape_inputdriver) -env.Alias('install', prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') +env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input', shape_inputdriver) +env.Alias('install', install_prefix + '/' + env['LIBDIR_SCHEMA'] + '/mapnik/input') diff --git a/src/SConscript b/src/SConscript index c20b17231..33276974b 100644 --- a/src/SConscript +++ b/src/SConscript @@ -25,6 +25,7 @@ import glob Import('env') prefix = env['PREFIX'] +install_prefix = env['DESTDIR'] + '/' + prefix libraries = ['agg'] + env['LIBS'] @@ -73,6 +74,6 @@ source += Split( 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') -env.Alias(target='install', source=env.Install(prefix+'/include/mapnik', includes)) +env.Alias(target='install', source=env.Install(install_prefix+'/include/mapnik', includes)) diff --git a/utils/shapeindex/SConscript b/utils/shapeindex/SConscript index 6feb80050..7d9e49744 100644 --- a/utils/shapeindex/SConscript +++ b/utils/shapeindex/SConscript @@ -24,6 +24,7 @@ import glob Import ('env') prefix = env['PREFIX'] +install_prefix = env['DESTDIR'] + '/' + prefix 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']) -env.Install(prefix + '/bin', shapeindex) -env.Alias('install', prefix + '/bin') +env.Install(install_prefix + '/bin', shapeindex) +env.Alias('install', install_prefix + '/bin')