[SCM] Packaging for cctbx branch, master, updated. upstream/2012.05.08.2305-27-g6474041

Radostan Riedel raybuntu at googlemail.com
Thu Jul 19 21:45:43 UTC 2012


The following commit has been merged in the master branch:
commit 5f73b356590f5b8903f6ae96f1718290c25e996f
Author: Radostan Riedel <raybuntu at googlemail.com>
Date:   Thu Jul 19 14:41:49 2012 +0200

    Change some patches and names

diff --git a/debian/patches/0004-adding-setup_py.patch b/debian/patches/0004-adding-setup_py.patch
deleted file mode 100644
index e3d1c1d..0000000
--- a/debian/patches/0004-adding-setup_py.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca at debian.org>
-Date: Sat, 30 Jun 2012 16:03:05 +0200
-Subject: adding-setup_py
-
----
- cctbx_sources/stdlib.py |    4 ++
- sconsutils.py           |  100 ++++++++++++++++++++++++++++++++++++++++++
- setup.py                |  111 +++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 215 insertions(+)
- create mode 100755 cctbx_sources/stdlib.py
- create mode 100644 sconsutils.py
- create mode 100755 setup.py
-
-diff --git a/cctbx_sources/stdlib.py b/cctbx_sources/stdlib.py
-new file mode 100755
-index 0000000..759f689
---- /dev/null
-+++ b/cctbx_sources/stdlib.py
-@@ -0,0 +1,4 @@
-+from libtbx.forward_compatibility import stdlib_import
-+
-+math = stdlib_import("math")
-+random = stdlib_import("random")
-diff --git a/sconsutils.py b/sconsutils.py
-new file mode 100644
-index 0000000..b1667da
---- /dev/null
-+++ b/sconsutils.py
-@@ -0,0 +1,100 @@
-+from distutils.command.build_ext import build_ext
-+
-+import sys, os
-+
-+BUILDDIR = ''
-+configure_list = []
-+scons_argv = []
-+
-+class build_ext(build_ext):
-+    def run(self):
-+        cwd = os.getcwd()
-+        if not os.path.exists(BUILDDIR):
-+            os.mkdir(BUILDDIR)
-+        elif not os.path.isdir(BUILDDIR):
-+            raise RuntimeError(("Build directory '%s' cannot be created "
-+                                "because of existing file") % BUILDDIR)
-+        os.chdir(BUILDDIR)
-+        import libtbx.env_config
-+        libtbx.env_config.cold_start(configure_list)
-+        argv_save = sys.argv
-+        sys.argv = scons_argv
-+        import SCons.Script
-+        try:
-+            SCons.Script.main()
-+        except SystemExit, s:
-+            # Prevent sys.exit on success.
-+            if s.code == 0:
-+                pass
-+            else:
-+                sys.exit(s)
-+
-+        os.chdir(cwd)
-+        for ext in self.extensions:
-+            src = ext.sources[0]
-+            bld = os.path.join(BUILDDIR, src)
-+            dst = self.get_ext_fullpath(ext.name)
-+            if os.path.isfile(bld):
-+                self.copy_file(bld, dst)
-+
-+# adapted from setuptools
-+# authors: Phillip J. Eby, Tarek Ziade and the distutils SIG
-+# licence: PSF or ZPL
-+
-+from distutils.util import convert_path
-+import re
-+
-+EXTPAT1 = re.compile(r"^from (\S+_ext) import")
-+EXTPAT2 = re.compile(r"^import (\S+_ext)$")
-+EXTPAT3 = re.compile(r"boost.python.import_ext\(['\"](\S+_ext)['\"]\)$")
-+
-+def find_packages_and_extensions(where='.', exclude=()):
-+    """Return a list all Python packages found within directory 'where'
-+    and a list all extensions that need to be installed inside those packages
-+
-+    'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it
-+    will be converted to the appropriate local path syntax.  'exclude' is a
-+    sequence of package names to exclude; '*' can be used as a wildcard in the
-+    names, such that 'foo.*' will exclude all subpackages of 'foo' (but not
-+    'foo' itself).
-+    """
-+    out = []
-+    outext = set()
-+    stack=[(convert_path(where), '')]
-+
-+    while stack:
-+
-+        where,prefix = stack.pop(0)
-+        for name in os.listdir(where):
-+
-+            fn = os.path.join(where,name)
-+            if ('.' not in name and os.path.isdir(fn) and
-+                os.path.isfile(os.path.join(fn,'__init__.py'))
-+            ):
-+
-+                out.append(prefix+name); stack.append((fn,prefix+name+'.'))
-+
-+            if name.endswith('.py'):
-+
-+                f = open(os.path.join(where, name))
-+                for l in f:
-+
-+                    m = EXTPAT1.match(l)
-+                    if m is not None:
-+                        outext.add(m.group(1))
-+
-+                    m = EXTPAT2.match(l)
-+                    if m is not None:
-+                        outext.add(m.group(1))
-+
-+                    m = EXTPAT3.search(l)
-+                    if m is not None:
-+                        outext.add(m.group(1))
-+
-+                f.close()
-+
-+    for pat in list(exclude)+['ez_setup', 'distribute_setup']:
-+        from fnmatch import fnmatchcase
-+        out = [item for item in out if not fnmatchcase(item,pat)]
-+
-+    return out, list(outext)
-diff --git a/setup.py b/setup.py
-new file mode 100755
-index 0000000..c0229b9
---- /dev/null
-+++ b/setup.py
-@@ -0,0 +1,111 @@
-+from distutils.core import setup, Extension
-+import sconsutils
-+from sconsutils import build_ext, find_packages_and_extensions
-+import sys, os, shutil
-+
-+# General settings
-+opj = os.path.join
-+CURDIR = os.getcwd()
-+SRCDIR = opj(CURDIR, 'cctbx_sources/')
-+BUILDDIR = opj(CURDIR, 'build%i.%i'%(sys.version_info[0], sys.version_info[1]))
-+clipper = 'clipper_adaptbx/clipper'
-+boost = 'boost_adaptbx/boost'
-+libtbx_pypath = 'libtbx/pythonpath'
-+scons_path = '/usr/lib/scons/'
-+PATHLIST= [ SRCDIR,
-+            opj(SRCDIR, libtbx_pypath),
-+            opj(SRCDIR, clipper),
-+            opj(SRCDIR, boost),
-+            scons_path,
-+          ]
-+for p in PATHLIST:
-+    if p not in sys.path:
-+        sys.path.append(p)
-+
-+
-+# Configure settings
-+# We need this directory to get env_config.cold_start to run!
-+# trailing slash is important
-+init_dir = opj(BUILDDIR, SRCDIR, 'libtbx/')
-+build_opts = [ '--libtoolize',
-+               '--rpath', '/usr/lib',
-+               '--use_system_libs',
-+             ]
-+conf_modules = [ 'annlib_adaptbx',
-+                 'boost_adaptbx',
-+                 'cbflib_adaptbx',
-+                 'ccp4io_adaptbx',
-+                 'cctbx',
-+                 'chiltbx',
-+                 'clipper_adaptbx',
-+                 'crys3d',
-+                 'fable',
-+                 'fftw3tbx',
-+                 'gltbx',
-+                 'iotbx',
-+                 'libtbx',
-+                 'mmtbx',
-+                 'omptbx',
-+                 'rstbx',
-+                 'scitbx',
-+                 'smtbx',
-+                 'spotfinder',
-+                 'tbxx',
-+                 'tntbx',
-+                 'ucif',
-+                 'wxtbx',
-+               ]
-+sconsutils.configure_list = [init_dir]
-+sconsutils.configure_list.extend(build_opts)
-+sconsutils.configure_list.extend(conf_modules)
-+sconsutils.BUILDDIR = BUILDDIR
-+
-+# Build settings
-+sconsutils.scons_argv = [ sys.argv[0], '-j', '8' ]
-+
-+# Setup settings
-+
-+NAME = 'cctbx'
-+VERSION = '0.1'
-+DESCRIPTION = 'cctbx'
-+AUTHOR = 'cctbx'
-+AUTHOR_EMAIL = 'cctbx at cci.lbl.gov'
-+URL = 'http://cctbx.sourceforge.net/'
-+LICENSE = 'CCTBX 2.0'
-+KEYWORDS = 'crystallography'
-+SCRIPTS = []
-+PKG_DATA = {}
-+EXTRA_PATH = 'cctbx'
-+PACKDIR = { 'boost' : SRCDIR + 'boost_adaptbx/boost',
-+            'clipper' : SRCDIR + 'clipper_adaptbx/clipper',
-+            'optik' : SRCDIR + 'libtbx/pythonpath/optik',
-+            'tntbx' : SRCDIR + 'tntbx/tntbx',
-+            '' : SRCDIR,
-+          }
-+
-+MODS = ['stdlib']
-+PACKS, EXT_MODULES = find_packages_and_extensions(SRCDIR)
-+PACKS.extend(['boost','clipper','optik','tntbx'])
-+# This is overlooked by regex in sconsutils
-+EXT_MODULES.append('_pycbf')
-+
-+# TODO: This should also work with Mac OSX and Windows without hard coding the
-+# file ext.
-+EXT_MODULES = [ Extension(e, ['lib/%s.so'%e]) for e in EXT_MODULES ]
-+
-+setup(name=NAME,
-+      version = VERSION,
-+      author = AUTHOR,
-+      author_email = AUTHOR_EMAIL,
-+      url = URL,
-+      description = DESCRIPTION,
-+      license = LICENSE,
-+      keywords = KEYWORDS,
-+      extra_path = EXTRA_PATH,
-+      scripts = SCRIPTS,
-+      packages = PACKS,
-+      package_dir = PACKDIR,
-+      ext_modules = EXT_MODULES,
-+      cmdclass = {'build_ext': build_ext},
-+      py_modules = MODS,
-+     )
--- 
diff --git a/debian/patches/0005-adding-shlib-versioning.patch b/debian/patches/0004-adding-shlib-versioning.patch
similarity index 100%
rename from debian/patches/0005-adding-shlib-versioning.patch
rename to debian/patches/0004-adding-shlib-versioning.patch
diff --git a/debian/patches/0006-upstream-fix-for-declaration-errors-in-gcc4.7.patch b/debian/patches/0005-upstream-fix-for-declaration-errors-in-gcc4.7.patch
similarity index 100%
rename from debian/patches/0006-upstream-fix-for-declaration-errors-in-gcc4.7.patch
rename to debian/patches/0005-upstream-fix-for-declaration-errors-in-gcc4.7.patch
diff --git a/debian/patches/0007-fix-for-gcc4.7-compilation-error.patch b/debian/patches/0006-fix-for-gcc4.7-compilation-error.patch
similarity index 100%
rename from debian/patches/0007-fix-for-gcc4.7-compilation-error.patch
rename to debian/patches/0006-fix-for-gcc4.7-compilation-error.patch
diff --git a/debian/patches/0007-options-for-system-libs-installtarget-and-prefix.patch b/debian/patches/0007-options-for-system-libs-installtarget-and-prefix.patch
new file mode 100644
index 0000000..033480b
--- /dev/null
+++ b/debian/patches/0007-options-for-system-libs-installtarget-and-prefix.patch
@@ -0,0 +1,545 @@
+From: Radostan Riedel <raybuntu at googlemail.com>
+Date: Thu, 19 Jul 2012 14:38:29 +0200
+Subject: options for system libs installtarget and prefix
+
+---
+ cctbx_sources/boost_adaptbx/SConscript             |   26 ++++--
+ cctbx_sources/cctbx/SConscript                     |    2 +-
+ cctbx_sources/clipper_adaptbx/SConscript           |   86 +++++++++++---------
+ cctbx_sources/clipper_adaptbx/clipper/SConscript   |    2 +-
+ cctbx_sources/gltbx/SConscript                     |    2 +-
+ cctbx_sources/iotbx/mtz/SConscript                 |    3 +-
+ cctbx_sources/iotbx/pdb/SConscript                 |    2 +-
+ cctbx_sources/libtbx/SConscript                    |   73 ++++++++++++++++-
+ cctbx_sources/libtbx/env_config.py                 |   19 +++++
+ cctbx_sources/mmtbx/den/SConscript                 |    2 +-
+ cctbx_sources/mmtbx/geometry_restraints/SConscript |    2 +-
+ cctbx_sources/mmtbx/secondary_structure/SConscript |    2 +-
+ cctbx_sources/rstbx/SConscript                     |    2 +-
+ cctbx_sources/scitbx/SConscript                    |    2 +-
+ cctbx_sources/scitbx/boost_python/SConscript       |    4 +-
+ .../smtbx/refinement/boost_python/SConscript       |    4 +-
+ .../refinement/constraints/boost_python/SConscript |    4 +-
+ cctbx_sources/spotfinder/SConscript                |    2 +-
+ 18 files changed, 173 insertions(+), 66 deletions(-)
+
+diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
+index 0d95318..5417e1b 100644
+--- a/cctbx_sources/boost_adaptbx/SConscript
++++ b/cctbx_sources/boost_adaptbx/SConscript
+@@ -9,7 +9,13 @@ import sys, os
+ op = os.path
+ Import("env_base", "env_etc")
+ env_etc.boost_dist = libtbx.env.dist_path("boost")
+-env_etc.boost_include = env_etc.boost_dist
++if not env_etc.check_syslib('boost_python', extra_libs='python%s'%env_etc.py_dot_str)\
++    or not env_etc.check_syslib('boost_thread'):
++  env_etc.boost_include = env_etc.boost_dist
++else:
++  # This way the compiler looks in the standard location for includes
++  # should work on all platforms.
++  env_etc.boost_include = ''
+ env_etc.boost_adaptbx_dist = libtbx.env.dist_path("boost_adaptbx")
+ env_etc.boost_adaptbx_include = os.path.dirname(env_etc.boost_adaptbx_dist)
+ 
+@@ -35,9 +41,10 @@ def build_boost_thread():
+                    lo="boost/libs/thread/src/libboost_thread.lo",
+                    dylib="lib/libboost_thread.dylib")
+   env.Repository(os.path.dirname(env_etc.boost_dist))
+-  env.SharedLibrary(
+-    target='#lib/boost_thread',
+-    source=source)
++  if not env_etc.check_syslib('boost_thread'):
++    env.SharedLibrary(
++      target='#lib/boost_thread',
++      source=source)
+ 
+ build_boost_thread()
+ 
+@@ -50,7 +57,7 @@ if (not env_etc.no_boost_python):
+   env_no_includes_boost_python_ext = env_base.Clone(
+     SHLINKFLAGS=env_etc.shlinkflags_bpl,
+     SHLIBPREFIX="",
+-    LIBS=["boost_python"] + env_etc.libs_python + env_etc.libm)
++    LIBS=[env_etc.boost_python] + env_etc.libs_python + env_etc.libm)
+   if (libtbx.env.build_options.libtoolize):
+     # Need to unset libtool since it does not support linking python-ext
+     env_etc.unset_libtool(env_no_includes_boost_python_ext, env_etc.rpath)
+@@ -238,10 +245,11 @@ object/function_doc_signature.cpp
+   bpl_dll_sources = [os.path.join(prefix, path) for path in bpl_dll_sources]
+   #
+   env.Repository(os.path.dirname(env_etc.boost_dist))
+-  if (env_etc.static_bpl):
+-    env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
+-  else:
+-    env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
++  if not env_etc.check_syslib('boost_python', extra_libs='python%s'%env_etc.py_dot_str):
++    if (env_etc.static_bpl):
++      env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
++    else:
++      env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
+   if (bool(int(ARGUMENTS.get("boost_python_tests", "0")))):
+     warn_if_unexpected_md5_hexdigest(
+       path=libtbx.env.under_dist("boost", "libs/python/test/Jamfile.v2"),
+diff --git a/cctbx_sources/cctbx/SConscript b/cctbx_sources/cctbx/SConscript
+index af767ae..6ce770c 100644
+--- a/cctbx_sources/cctbx/SConscript
++++ b/cctbx_sources/cctbx/SConscript
+@@ -106,7 +106,7 @@ if (not env_etc.no_boost_python):
+   Import("env_no_includes_boost_python_ext")
+ 
+   env_cctbx_boost_python_ext = env_no_includes_boost_python_ext.Clone()
+-  env_cctbx_boost_python_ext.Prepend(LIBS=["scitbx_boost_python"])
++  env_cctbx_boost_python_ext.Prepend(LIBS=[env_etc.scitbx_boost_python])
+   env_etc.include_registry.append(
+     env=env_cctbx_boost_python_ext,
+     paths=env_etc.cctbx_common_includes + [env_etc.python_include])
+diff --git a/cctbx_sources/clipper_adaptbx/SConscript b/cctbx_sources/clipper_adaptbx/SConscript
+index 9cce49e..21c81c4 100644
+--- a/cctbx_sources/clipper_adaptbx/SConscript
++++ b/cctbx_sources/clipper_adaptbx/SConscript
+@@ -3,54 +3,61 @@ Import("env_base", "env_etc")
+ 
+ env_etc.clipper_dist = libtbx.env.dist_path("clipper")
+ env_etc.clipper_include = env_etc.clipper_dist
++# This way the compiler looks in the standard location for includes
++# should work on all platforms
++env_etc.clipper_sysinclude = ''
+ 
+ env = env_base.Clone(
+   SHLINKFLAGS=env_etc.shlinkflags,
+   LIBS=env_etc.libm)
+-env.Prepend(CPPPATH=[env_etc.clipper_include])
++if not env_etc.check_syslib('clipper-core'):
++  env.Prepend(CPPPATH=[env_etc.clipper_include])
++else:
++  env.Prepend(CPPPATH=[env_etc.clipper_sysinclude])
+ 
+ if (env_etc.static_libraries): builder = env.StaticLibrary
+ else:                          builder = env.SharedLibrary
+-builder(target='#lib/clipper',
+-  source = ["../clipper/clipper/core/"+file_name for file_name in """
+-  atomsf.cpp
+-  cell.cpp
+-  clipper_memory.cpp
+-  clipper_message.cpp
+-  clipper_stats.cpp
+-  clipper_types.cpp
+-  clipper_util.cpp
+-  container.cpp
+-  container_hkl.cpp
+-  container_map.cpp
+-  container_types.cpp
+-  coords.cpp
+-  derivs.cpp
+-  hkl_compute.cpp
+-  hkl_data.cpp
+-  hkl_datatypes.cpp
+-  hkl_info.cpp
+-  hkl_lookup.cpp
+-  hkl_operators.cpp
+-  map_interp.cpp
+-  map_utils.cpp
+-  nxmap.cpp
+-  nxmap_operator.cpp
+-  ramachandran.cpp
+-  resol_basisfn.cpp
+-  resol_fn.cpp
+-  resol_targetfn.cpp
+-  rotation.cpp
+-  spacegroup.cpp
+-  spacegroup_data.cpp
+-  symop.cpp
+-  xmap.cpp
+-""".split()])
+-# fftmap_sparse.cpp
+-# fftmap.cpp
++if not env_etc.check_syslib('clipper-core'):
++    builder(target='#lib/clipper-core',
++      source = ["../clipper/clipper/core/"+file_name for file_name in """
++      atomsf.cpp
++      cell.cpp
++      clipper_memory.cpp
++      clipper_message.cpp
++      clipper_stats.cpp
++      clipper_types.cpp
++      clipper_util.cpp
++      container.cpp
++      container_hkl.cpp
++      container_map.cpp
++      container_types.cpp
++      coords.cpp
++      derivs.cpp
++      hkl_compute.cpp
++      hkl_data.cpp
++      hkl_datatypes.cpp
++      hkl_info.cpp
++      hkl_lookup.cpp
++      hkl_operators.cpp
++      map_interp.cpp
++      map_utils.cpp
++      nxmap.cpp
++      nxmap_operator.cpp
++      ramachandran.cpp
++      resol_basisfn.cpp
++      resol_fn.cpp
++      resol_targetfn.cpp
++      rotation.cpp
++      spacegroup.cpp
++      spacegroup_data.cpp
++      symop.cpp
++      xmap.cpp
++    """.split()])
++    # fftmap_sparse.cpp
++    # fftmap.cpp
+ 
+ env_exe = env.Clone()
+-env_exe.Prepend(LIBS=["clipper"])
++env_exe.Prepend(LIBS=["clipper-core"])
+ 
+ exe = env_exe.Program(
+   target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
+@@ -77,6 +84,7 @@ if (hasattr(env_etc, "cctbx_include")):
+       env=env_clipper_boost_python_ext,
+       paths=[
+         env_etc.clipper_include,
++        env_etc.clipper_sysinclude,
+         env_etc.libtbx_include,
+         env_etc.cctbx_include,
+         env_etc.scitbx_include,
+diff --git a/cctbx_sources/clipper_adaptbx/clipper/SConscript b/cctbx_sources/clipper_adaptbx/clipper/SConscript
+index 9f79f83..37280af 100644
+--- a/cctbx_sources/clipper_adaptbx/clipper/SConscript
++++ b/cctbx_sources/clipper_adaptbx/clipper/SConscript
+@@ -1,6 +1,6 @@
+ Import("env_clipper_boost_python_ext")
+ env = env_clipper_boost_python_ext.Clone()
+-env.Prepend(LIBS=["clipper", "cctbx"])
++env.Prepend(LIBS=["clipper-core", "cctbx"])
+ env.SharedLibrary(
+   target="#lib/clipper_ext",
+   source=[
+diff --git a/cctbx_sources/gltbx/SConscript b/cctbx_sources/gltbx/SConscript
+index 4b2213d..6d0e272 100644
+--- a/cctbx_sources/gltbx/SConscript
++++ b/cctbx_sources/gltbx/SConscript
+@@ -19,7 +19,7 @@ if (not env_etc.no_boost_python):
+   Import("env_base", "env_no_includes_boost_python_ext")
+   trial_env = env_base.Clone()
+   env = env_no_includes_boost_python_ext.Clone()
+-  env.Prepend(LIBS=["scitbx_boost_python"])
++  env.Prepend(LIBS=[env_etc.scitbx_boost_python])
+   if (env_etc.compiler == "win32_cl"):
+     for e in [trial_env, env]:
+       e.Append(LIBS=["glu32", "opengl32"])
+diff --git a/cctbx_sources/iotbx/mtz/SConscript b/cctbx_sources/iotbx/mtz/SConscript
+index c0a4bb0..cd539e6 100644
+--- a/cctbx_sources/iotbx/mtz/SConscript
++++ b/cctbx_sources/iotbx/mtz/SConscript
+@@ -22,7 +22,8 @@ if (not env_etc.no_boost_python):
+   env = env_iotbx_boost_python_ext.Clone()
+   env.Append(CXXFLAGS=env_etc.ccp4io_defines)
+   env.Append(SHCXXFLAGS=env_etc.ccp4io_defines)
+-  env.Prepend(LIBS=["iotbx_mtz", "cctbx", ccp4io_lib, "scitbx_boost_python"])
++  env.Prepend(LIBS=["iotbx_mtz", "cctbx", ccp4io_lib,
++                     env_etc.scitbx_boost_python])
+   env_etc.enable_more_warnings(env=env)
+   env.SharedLibrary(
+     target="#lib/iotbx_mtz_ext",
+diff --git a/cctbx_sources/iotbx/pdb/SConscript b/cctbx_sources/iotbx/pdb/SConscript
+index 6af2664..9b89fe1 100644
+--- a/cctbx_sources/iotbx/pdb/SConscript
++++ b/cctbx_sources/iotbx/pdb/SConscript
+@@ -33,7 +33,7 @@ env.Program(target="hybrid_36_fem", source=["hybrid_36_fem.cpp"])
+ if (not env_etc.no_boost_python):
+   Import("env_iotbx_boost_python_ext")
+   env = env_iotbx_boost_python_ext.Clone()
+-  env.Prepend(LIBS=["iotbx_pdb", "cctbx", "scitbx_boost_python"])
++  env.Prepend(LIBS=["iotbx_pdb", "cctbx", env_etc.scitbx_boost_python])
+   env_etc.enable_more_warnings(env=env)
+   env.SharedLibrary(
+     target="#lib/iotbx_pdb_ext",
+diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
+index 1443e6c..2bef63e 100644
+--- a/cctbx_sources/libtbx/SConscript
++++ b/cctbx_sources/libtbx/SConscript
+@@ -4,7 +4,7 @@ from libtbx import easy_run
+ from libtbx.utils import getenv_bool
+ from libtbx.str_utils import show_string
+ from libtbx.path import norm_join, full_command_path
+-import sys, os
++import sys, os, re
+ op = os.path
+ 
+ if (hasattr(Environment, "Clone")):
+@@ -1074,6 +1074,7 @@ def unset_libtool(env, rpath):
+   env.Append(LIBPATH=libtool_install_path)
+ env_etc.unset_libtool = unset_libtool
+ 
++env_etc.rpath = ''
+ if (libtbx.env.build_options.libtoolize):
+   env_etc.shlibsuffix = ".la"
+   env_base.Append(LIBSUFFIXES=[env_etc.shlibsuffix])
+@@ -1082,4 +1083,74 @@ if (libtbx.env.build_options.libtoolize):
+   env_etc.shlinkflags.extend(rpath_link)
+   env_etc.set_libtool(env_base, env_etc.rpath)
+ 
++env_etc.use_system_libs = False
++def check_syslib(lib, extra_libs=None):
++  """ Check if a system library is available """
++  if not env_etc.use_system_libs:
++    return False
++  env_syslib = env_base.Clone(LIBS=extra_libs)
++  conf = env_syslib.Configure()
++  if not conf.CheckLib(library=lib):
++    print 'Could not find %s library!'%(lib)
++    conf.Finish()
++    return False
++  else:
++    conf.Finish()
++    return True
++env_etc.check_syslib = check_syslib
++
++env_etc.py_vers = libtbx.env_config.python_version()
++env_etc.py_major = env_etc.py_vers[0]
++env_etc.py_minor = env_etc.py_vers[1]
++env_etc.py_dot_str = '%s.%s'%(env_etc.py_major, env_etc.py_minor)
++env_etc.py_str = '-py%s%s'%(env_etc.py_major, env_etc.py_minor)
++
++if (libtbx.env.build_options.use_system_libs):
++  env_etc.use_system_libs = True
++
++if env_etc.check_syslib('boost_python%s'%env_etc.py_str,
++    extra_libs='python%s'%env_etc.py_dot_str):
++  env_etc.boost_python = 'boost_python%s'%env_etc.py_str
++  env_etc.scitbx_boost_python = 'scitbx_boost_python%s'%env_etc.py_str
++else:
++  env_etc.boost_python = 'boost_python'
++  env_etc.scitbx_boost_python = 'scitbx_boost_python'
++
++env_etc.prefix = libtbx.env.build_options.install_prefix
++env_etc.libpath = os.path.join(env_etc.prefix, 'lib')
++env_etc.inclpath = os.path.join(env_etc.prefix, 'include')
++
++def create_install_targets():
++  cwd = os.getcwd()
++  rp = libtbx.env.repository_paths
++  lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
++  if not os.path.exists(lib_dir):
++    os.makedirs(lib_dir)
++  rp = list(rp)
++  rp.append(lib_dir)
++  for p in rp:
++    if isinstance(p, str):
++      src_dir = p
++    else:
++      src_dir = abs(p)
++    os.chdir(src_dir)
++    dest = None
++    for root, dirnames, filenames in os.walk('.'):
++      for filename in filenames:
++        if re.match('^lib.*\.(so.*|dylib.*|la|a)$', filename, flags=re.IGNORECASE):
++          dest = os.path.join(env_etc.libpath, root)
++          src = os.path.join(src_dir, root, filename)
++          env_base.Install(dest, src)
++          env_base.Alias("install-shlib", dest)
++        if re.match('^.*\.(h|hpp)$', filename, flags=re.IGNORECASE):
++          dest = os.path.join(env_etc.inclpath, root)
++          src = os.path.join(src_dir, root, filename)
++          env_base.Install(dest, src)
++          env_base.Alias("install-header", dest)
++  Alias('install', ['install-header', 'install-shlib'])
++  os.chdir(cwd)
++
++if 'install' in COMMAND_LINE_TARGETS:
++  create_install_targets()
++
+ Export("env_base", "env_etc")
+diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
+index 2285c9d..b6bab84 100644
+--- a/cctbx_sources/libtbx/env_config.py
++++ b/cctbx_sources/libtbx/env_config.py
+@@ -161,6 +161,9 @@ def python_include_path(must_exist=True):
+       % include_path)
+   return include_path
+ 
++def python_version(must_exist=True):
++  return sys.version_info
++
+ def ld_library_path_var_name():
+   if (os.name == "nt"):
+     return "PATH"
+@@ -703,6 +706,8 @@ Wait for the command to finish, then try again.""" % vars())
+         static_exe=command_line.options.static_exe,
+         libtoolize=command_line.options.libtoolize,
+         rpath=command_line.options.rpath,
++        use_system_libs=command_line.options.use_system_libs,
++        install_prefix=command_line.options.install_prefix,
+         scan_boost=command_line.options.scan_boost,
+         write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
+         boost_python_no_py_signatures
+@@ -1762,6 +1767,8 @@ class build_options:
+         static_libraries,
+         static_exe,
+         libtoolize,
++        use_system_libs,
++        install_prefix,
+         rpath,
+         scan_boost,
+         write_full_flex_fwd_h=default_write_full_flex_fwd_h,
+@@ -1833,6 +1840,8 @@ class build_options:
+     print >> f, "Enable OpenMP if possible:", self.enable_openmp_if_possible
+     print >> f, "Enable CUDA:", self.enable_cuda
+     print >> f, "Libtoolize:", self.libtoolize
++    print >> f, "Use System Libraries:", self.use_system_libs
++    print >> f, "Install Prefix:", self.install_prefix
+     print >> f, "Use opt_resources if available:", self.opt_resources
+     print >> f, "Use environment flags:", self.use_environment_flags
+     if( self.use_environment_flags ):
+@@ -1955,12 +1964,22 @@ class pre_process_args:
+         action="store_true",
+         default=False,
+         help="build all shared libraries with libtool. Optionally set --rpath")
++      parser.option(None, "--use_system_libs",
++        action="store_true",
++        default=False,
++        help="Use system Libraries to build.")
+       parser.option(None, "--rpath",
+         type="string",
+         action="store",
+         default="/usr/lib",
+         help="sets the rpath libtool (implies --libtoolize). Default: /usr/lib",
+         metavar="DIRECTORY")
++      parser.option(None, "--install_prefix",
++        type="string",
++        action="store",
++        default="/usr/local",
++        help="sets the prefix for the install targets. Default: /usr/local",
++        metavar="DIRECTORY")
+       parser.option(None, "--scan_boost",
+         action="store_true",
+         default=False,
+diff --git a/cctbx_sources/mmtbx/den/SConscript b/cctbx_sources/mmtbx/den/SConscript
+index 2d3ce36..1a2b171 100644
+--- a/cctbx_sources/mmtbx/den/SConscript
++++ b/cctbx_sources/mmtbx/den/SConscript
+@@ -3,7 +3,7 @@ Import("env_etc")
+ if (not env_etc.no_boost_python):
+   Import("env_iotbx_boost_python_ext")
+   env = env_iotbx_boost_python_ext.Clone()
+-  env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
++  env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
+   env_etc.enable_more_warnings(env=env)
+   env.SharedLibrary(
+     target="#lib/mmtbx_den_restraints_ext",
+diff --git a/cctbx_sources/mmtbx/geometry_restraints/SConscript b/cctbx_sources/mmtbx/geometry_restraints/SConscript
+index 222d5f6..e11e5f9 100644
+--- a/cctbx_sources/mmtbx/geometry_restraints/SConscript
++++ b/cctbx_sources/mmtbx/geometry_restraints/SConscript
+@@ -3,7 +3,7 @@ Import("env_etc")
+ if (not env_etc.no_boost_python):
+   Import("env_iotbx_boost_python_ext")
+   env = env_iotbx_boost_python_ext.Clone()
+-  env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
++  env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
+   env_etc.enable_more_warnings(env=env)
+   env.SharedLibrary(
+     target="#lib/mmtbx_hbond_restraints_ext",
+diff --git a/cctbx_sources/mmtbx/secondary_structure/SConscript b/cctbx_sources/mmtbx/secondary_structure/SConscript
+index 7e82b43..5698af5 100644
+--- a/cctbx_sources/mmtbx/secondary_structure/SConscript
++++ b/cctbx_sources/mmtbx/secondary_structure/SConscript
+@@ -3,7 +3,7 @@ Import("env_etc")
+ if (not env_etc.no_boost_python):
+   Import("env_iotbx_boost_python_ext")
+   env = env_iotbx_boost_python_ext.Clone()
+-  env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
++  env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
+   env_etc.enable_more_warnings(env=env)
+   env.SharedLibrary(
+     target="#lib/mmtbx_secondary_structure_ext",
+diff --git a/cctbx_sources/rstbx/SConscript b/cctbx_sources/rstbx/SConscript
+index a1ab8e5..e2958a1 100644
+--- a/cctbx_sources/rstbx/SConscript
++++ b/cctbx_sources/rstbx/SConscript
+@@ -39,7 +39,7 @@ if (not env_etc.no_boost_python):
+   Import("env_boost_python_ext")
+   env_rstbx_boost_python_ext = env_boost_python_ext.Clone()
+   env_rstbx_boost_python_ext.Prepend(
+-                 LIBS=["rstbx", "cctbx", "scitbx_boost_python"])
++                 LIBS=["rstbx", "cctbx", env_etc.scitbx_boost_python])
+   env_rstbx_boost_python_ext.SharedLibrary(
+                  target="#lib/rstbx_ext", source="ext.cpp")
+   env_rstbx_boost_python_ext.SharedLibrary(
+diff --git a/cctbx_sources/scitbx/SConscript b/cctbx_sources/scitbx/SConscript
+index 9199ae0..6045fbc 100644
+--- a/cctbx_sources/scitbx/SConscript
++++ b/cctbx_sources/scitbx/SConscript
+@@ -28,7 +28,7 @@ SConscript("sparse/tests/SConscript")
+ if (not env_etc.no_boost_python):
+   Import("env_no_includes_boost_python_ext")
+   env_scitbx_boost_python_ext = env_no_includes_boost_python_ext.Clone()
+-  env_scitbx_boost_python_ext.Prepend(LIBS=["scitbx_boost_python"])
++  env_scitbx_boost_python_ext.Prepend(LIBS=[env_etc.scitbx_boost_python])
+   env_etc.include_registry.append(
+     env=env_scitbx_boost_python_ext,
+     paths=env_etc.scitbx_common_includes + [env_etc.python_include])
+diff --git a/cctbx_sources/scitbx/boost_python/SConscript b/cctbx_sources/scitbx/boost_python/SConscript
+index eda7b03..1f396e5 100644
+--- a/cctbx_sources/scitbx/boost_python/SConscript
++++ b/cctbx_sources/scitbx/boost_python/SConscript
+@@ -7,7 +7,7 @@ env_etc.enable_more_warnings(env=env)
+ env.Append(CXXFLAGS=env_etc.cxxflags_bpl_defines_base)
+ env.Append(SHCXXFLAGS=env_etc.cxxflags_bpl_defines_base)
+ env.Append(LIBPATH=env_etc.libpath_python)
+-env.Append(LIBS=["boost_python"] + env_etc.libs_python)
++env.Append(LIBS=[env_etc.boost_python] + env_etc.libs_python)
+ env_etc.include_registry.append(
+   env=env,
+   paths=env_etc.scitbx_common_includes + [env_etc.python_include])
+@@ -20,5 +20,5 @@ lib_scitbx_boost_python_sources = [
+ if (env_etc.static_libraries): builder = env.StaticLibrary
+ else:                          builder = env.SharedLibrary
+ builder(
+-  target="#lib/scitbx_boost_python",
++  target="#lib/%s"%env_etc.scitbx_boost_python,
+   source=lib_scitbx_boost_python_sources)
+diff --git a/cctbx_sources/smtbx/refinement/boost_python/SConscript b/cctbx_sources/smtbx/refinement/boost_python/SConscript
+index 0387e1d..5144996 100644
+--- a/cctbx_sources/smtbx/refinement/boost_python/SConscript
++++ b/cctbx_sources/smtbx/refinement/boost_python/SConscript
+@@ -1,6 +1,6 @@
+-Import("env_smtbx_boost_python_ext")
++Import("env_smtbx_boost_python_ext", "env_etc")
+ env = env_smtbx_boost_python_ext.Clone()
+-env.Prepend(LIBS=["smtbx_refinement_constraints", "scitbx_boost_python"])
++env.Prepend(LIBS=["smtbx_refinement_constraints", env_etc.scitbx_boost_python])
+ env.SharedLibrary(target="#lib/smtbx_refinement_least_squares_ext", source=[
+   "least_squares_ext.cpp",
+   "weighting_schemes.cpp",
+diff --git a/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript b/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
+index 009d288..1eb176b 100644
+--- a/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
++++ b/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
+@@ -1,5 +1,5 @@
+-Import("env_smtbx_boost_python_ext")
++Import("env_smtbx_boost_python_ext", "env_etc")
+ env = env_smtbx_boost_python_ext.Clone()
+-env.Prepend(LIBS=["smtbx_refinement_constraints", "scitbx_boost_python"])
++env.Prepend(LIBS=["smtbx_refinement_constraints", env_etc.scitbx_boost_python])
+ env.SharedLibrary(target="#lib/smtbx_refinement_constraints_ext",
+                   source=Glob("*.cpp"))
+diff --git a/cctbx_sources/spotfinder/SConscript b/cctbx_sources/spotfinder/SConscript
+index 1d280d4..1d73677 100644
+--- a/cctbx_sources/spotfinder/SConscript
++++ b/cctbx_sources/spotfinder/SConscript
+@@ -54,7 +54,7 @@ if (not env_etc.no_boost_python):
+   Import("env_no_includes_boost_python_ext")
+ 
+   env_spotfinder_boost_python_ext = env_no_includes_boost_python_ext.Clone()
+-  env_spotfinder_boost_python_ext.Prepend(LIBS=[ "scitbx_boost_python"])
++  env_spotfinder_boost_python_ext.Prepend(LIBS=[ env_etc.scitbx_boost_python ])
+   env_etc.include_registry.append(
+     env=env_spotfinder_boost_python_ext,
+     paths=env_etc.spotfinder_common_includes + [env_etc.python_include])
+-- 
diff --git a/debian/patches/0008-add-with_pycbf-option.patch b/debian/patches/0008-add-with_pycbf-option.patch
new file mode 100644
index 0000000..52ad857
--- /dev/null
+++ b/debian/patches/0008-add-with_pycbf-option.patch
@@ -0,0 +1,74 @@
+From: Radostan Riedel <raybuntu at googlemail.com>
+Date: Thu, 19 Jul 2012 11:27:37 +0200
+Subject: add with_pycbf option
+
+---
+ cctbx_sources/cbflib_adaptbx/SConscript |    9 +++++----
+ cctbx_sources/libtbx/SConscript         |    1 +
+ cctbx_sources/libtbx/env_config.py      |    6 ++++++
+ 3 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/cctbx_sources/cbflib_adaptbx/SConscript b/cctbx_sources/cbflib_adaptbx/SConscript
+index 4ac6717..14deee3 100644
+--- a/cctbx_sources/cbflib_adaptbx/SConscript
++++ b/cctbx_sources/cbflib_adaptbx/SConscript
+@@ -77,10 +77,11 @@ if (not env_etc.no_boost_python):
+     env=env_cbflib_boost_python_ext,
+     paths=env_etc.cbflib_common_includes + [env_etc.python_include])
+ 
+-  env_cbflib_boost_python_ext.SharedLibrary(
+-    target='#lib/_pycbf',
+-    source=[prefix+"/pycbf/pycbf_wrap.c"],
+-    LIBS=["cbf"]+env_etc.libs_python+env_etc.libm)
++  if env_etc.with_pycbf:
++    env_cbflib_boost_python_ext.SharedLibrary(
++      target='#lib/_pycbf',
++      source=[prefix+"/pycbf/pycbf_wrap.c"],
++      LIBS=["cbf"]+env_etc.libs_python+env_etc.libm)
+ 
+   Export("env_cbflib_boost_python_ext")
+ 
+diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
+index 2bef63e..b97390f 100644
+--- a/cctbx_sources/libtbx/SConscript
++++ b/cctbx_sources/libtbx/SConscript
+@@ -1116,6 +1116,7 @@ else:
+   env_etc.boost_python = 'boost_python'
+   env_etc.scitbx_boost_python = 'scitbx_boost_python'
+ 
++env_etc.with_pycbf = libtbx.env.build_options.with_pycbf
+ env_etc.prefix = libtbx.env.build_options.install_prefix
+ env_etc.libpath = os.path.join(env_etc.prefix, 'lib')
+ env_etc.inclpath = os.path.join(env_etc.prefix, 'include')
+diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
+index b6bab84..687c00d 100644
+--- a/cctbx_sources/libtbx/env_config.py
++++ b/cctbx_sources/libtbx/env_config.py
+@@ -707,6 +707,7 @@ Wait for the command to finish, then try again.""" % vars())
+         libtoolize=command_line.options.libtoolize,
+         rpath=command_line.options.rpath,
+         use_system_libs=command_line.options.use_system_libs,
++        with_pycbf=command_line.options.with_pycbf,
+         install_prefix=command_line.options.install_prefix,
+         scan_boost=command_line.options.scan_boost,
+         write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
+@@ -1768,6 +1769,7 @@ class build_options:
+         static_exe,
+         libtoolize,
+         use_system_libs,
++        with_pycbf,
+         install_prefix,
+         rpath,
+         scan_boost,
+@@ -1968,6 +1970,10 @@ class pre_process_args:
+         action="store_true",
+         default=False,
+         help="Use system Libraries to build.")
++      parser.option(None, "--with_pycbf",
++        action="store_true",
++        default=False,
++        help="Build pycbf extension.")
+       parser.option(None, "--rpath",
+         type="string",
+         action="store",
+-- 
diff --git a/debian/patches/0008-upstream-fix-to-use-system-libraries.patch b/debian/patches/0008-upstream-fix-to-use-system-libraries.patch
deleted file mode 100644
index 7851cff..0000000
--- a/debian/patches/0008-upstream-fix-to-use-system-libraries.patch
+++ /dev/null
@@ -1,290 +0,0 @@
-From: Radostan Riedel <raybuntu at googlemail.com>
-Date: Fri, 13 Jul 2012 15:11:27 +0200
-Subject: upstream fix to use system libraries
-
----
- cctbx_sources/boost_adaptbx/SConscript           |   40 +++++++---
- cctbx_sources/clipper_adaptbx/SConscript         |   86 ++++++++++++----------
- cctbx_sources/clipper_adaptbx/clipper/SConscript |    2 +-
- cctbx_sources/libtbx/SConscript                  |   22 ++++++
- cctbx_sources/libtbx/env_config.py               |   10 +++
- 5 files changed, 108 insertions(+), 52 deletions(-)
-
-diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
-index 0d95318..b28a1cc 100644
---- a/cctbx_sources/boost_adaptbx/SConscript
-+++ b/cctbx_sources/boost_adaptbx/SConscript
-@@ -9,7 +9,14 @@ import sys, os
- op = os.path
- Import("env_base", "env_etc")
- env_etc.boost_dist = libtbx.env.dist_path("boost")
--env_etc.boost_include = env_etc.boost_dist
-+py_dot_str = '%s.%s'%(env_etc.py_major, env_etc.py_minor)
-+if not env_etc.check_syslib('boost_python', extra_libs='python%s'%py_dot_str) or \
-+   not env_etc.check_syslib('boost_thread'):
-+  env_etc.boost_include = env_etc.boost_dist
-+else:
-+  # This way the compiler looks in the standard location for includes
-+  # should work on all platforms.
-+  env_etc.boost_include = ''
- env_etc.boost_adaptbx_dist = libtbx.env.dist_path("boost_adaptbx")
- env_etc.boost_adaptbx_include = os.path.dirname(env_etc.boost_adaptbx_dist)
- 
-@@ -35,9 +42,10 @@ def build_boost_thread():
-                    lo="boost/libs/thread/src/libboost_thread.lo",
-                    dylib="lib/libboost_thread.dylib")
-   env.Repository(os.path.dirname(env_etc.boost_dist))
--  env.SharedLibrary(
--    target='#lib/boost_thread',
--    source=source)
-+  if not env_etc.check_syslib('boost_thread'):
-+    env.SharedLibrary(
-+      target='#lib/boost_thread',
-+      source=source)
- 
- build_boost_thread()
- 
-@@ -47,10 +55,17 @@ if (not env_etc.no_boost_python):
-   if (libtbx.env.build_options.boost_python_no_py_signatures):
-     env_etc.cxxflags_bpl_defines_base.append(
-       "-DBOOST_PYTHON_NO_PY_SIGNATURES")
--  env_no_includes_boost_python_ext = env_base.Clone(
--    SHLINKFLAGS=env_etc.shlinkflags_bpl,
--    SHLIBPREFIX="",
--    LIBS=["boost_python"] + env_etc.libs_python + env_etc.libm)
-+  py_str = '-py%s%s'%(env_etc.py_major, env_etc.py_minor)
-+  if env_etc.check_syslib('boost_python%s'%py_str, extra_libs='python%s'%py_dot_str):
-+    env_no_includes_boost_python_ext = env_base.Clone(
-+      SHLINKFLAGS=env_etc.shlinkflags_bpl,
-+      SHLIBPREFIX="",
-+      LIBS=['boost_python%s'%py_str] + env_etc.libs_python + env_etc.libm)
-+  else:
-+    env_no_includes_boost_python_ext = env_base.Clone(
-+      SHLINKFLAGS=env_etc.shlinkflags_bpl,
-+      SHLIBPREFIX="",
-+      LIBS=["boost_python"] + env_etc.libs_python + env_etc.libm)
-   if (libtbx.env.build_options.libtoolize):
-     # Need to unset libtool since it does not support linking python-ext
-     env_etc.unset_libtool(env_no_includes_boost_python_ext, env_etc.rpath)
-@@ -238,10 +253,11 @@ object/function_doc_signature.cpp
-   bpl_dll_sources = [os.path.join(prefix, path) for path in bpl_dll_sources]
-   #
-   env.Repository(os.path.dirname(env_etc.boost_dist))
--  if (env_etc.static_bpl):
--    env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
--  else:
--    env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
-+  if not env_etc.check_syslib('boost_python', extra_libs='python%s'%py_dot_str):
-+    if (env_etc.static_bpl):
-+      env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
-+    else:
-+      env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
-   if (bool(int(ARGUMENTS.get("boost_python_tests", "0")))):
-     warn_if_unexpected_md5_hexdigest(
-       path=libtbx.env.under_dist("boost", "libs/python/test/Jamfile.v2"),
-diff --git a/cctbx_sources/clipper_adaptbx/SConscript b/cctbx_sources/clipper_adaptbx/SConscript
-index 9cce49e..21c81c4 100644
---- a/cctbx_sources/clipper_adaptbx/SConscript
-+++ b/cctbx_sources/clipper_adaptbx/SConscript
-@@ -3,54 +3,61 @@ Import("env_base", "env_etc")
- 
- env_etc.clipper_dist = libtbx.env.dist_path("clipper")
- env_etc.clipper_include = env_etc.clipper_dist
-+# This way the compiler looks in the standard location for includes
-+# should work on all platforms
-+env_etc.clipper_sysinclude = ''
- 
- env = env_base.Clone(
-   SHLINKFLAGS=env_etc.shlinkflags,
-   LIBS=env_etc.libm)
--env.Prepend(CPPPATH=[env_etc.clipper_include])
-+if not env_etc.check_syslib('clipper-core'):
-+  env.Prepend(CPPPATH=[env_etc.clipper_include])
-+else:
-+  env.Prepend(CPPPATH=[env_etc.clipper_sysinclude])
- 
- if (env_etc.static_libraries): builder = env.StaticLibrary
- else:                          builder = env.SharedLibrary
--builder(target='#lib/clipper',
--  source = ["../clipper/clipper/core/"+file_name for file_name in """
--  atomsf.cpp
--  cell.cpp
--  clipper_memory.cpp
--  clipper_message.cpp
--  clipper_stats.cpp
--  clipper_types.cpp
--  clipper_util.cpp
--  container.cpp
--  container_hkl.cpp
--  container_map.cpp
--  container_types.cpp
--  coords.cpp
--  derivs.cpp
--  hkl_compute.cpp
--  hkl_data.cpp
--  hkl_datatypes.cpp
--  hkl_info.cpp
--  hkl_lookup.cpp
--  hkl_operators.cpp
--  map_interp.cpp
--  map_utils.cpp
--  nxmap.cpp
--  nxmap_operator.cpp
--  ramachandran.cpp
--  resol_basisfn.cpp
--  resol_fn.cpp
--  resol_targetfn.cpp
--  rotation.cpp
--  spacegroup.cpp
--  spacegroup_data.cpp
--  symop.cpp
--  xmap.cpp
--""".split()])
--# fftmap_sparse.cpp
--# fftmap.cpp
-+if not env_etc.check_syslib('clipper-core'):
-+    builder(target='#lib/clipper-core',
-+      source = ["../clipper/clipper/core/"+file_name for file_name in """
-+      atomsf.cpp
-+      cell.cpp
-+      clipper_memory.cpp
-+      clipper_message.cpp
-+      clipper_stats.cpp
-+      clipper_types.cpp
-+      clipper_util.cpp
-+      container.cpp
-+      container_hkl.cpp
-+      container_map.cpp
-+      container_types.cpp
-+      coords.cpp
-+      derivs.cpp
-+      hkl_compute.cpp
-+      hkl_data.cpp
-+      hkl_datatypes.cpp
-+      hkl_info.cpp
-+      hkl_lookup.cpp
-+      hkl_operators.cpp
-+      map_interp.cpp
-+      map_utils.cpp
-+      nxmap.cpp
-+      nxmap_operator.cpp
-+      ramachandran.cpp
-+      resol_basisfn.cpp
-+      resol_fn.cpp
-+      resol_targetfn.cpp
-+      rotation.cpp
-+      spacegroup.cpp
-+      spacegroup_data.cpp
-+      symop.cpp
-+      xmap.cpp
-+    """.split()])
-+    # fftmap_sparse.cpp
-+    # fftmap.cpp
- 
- env_exe = env.Clone()
--env_exe.Prepend(LIBS=["clipper"])
-+env_exe.Prepend(LIBS=["clipper-core"])
- 
- exe = env_exe.Program(
-   target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
-@@ -77,6 +84,7 @@ if (hasattr(env_etc, "cctbx_include")):
-       env=env_clipper_boost_python_ext,
-       paths=[
-         env_etc.clipper_include,
-+        env_etc.clipper_sysinclude,
-         env_etc.libtbx_include,
-         env_etc.cctbx_include,
-         env_etc.scitbx_include,
-diff --git a/cctbx_sources/clipper_adaptbx/clipper/SConscript b/cctbx_sources/clipper_adaptbx/clipper/SConscript
-index 9f79f83..37280af 100644
---- a/cctbx_sources/clipper_adaptbx/clipper/SConscript
-+++ b/cctbx_sources/clipper_adaptbx/clipper/SConscript
-@@ -1,6 +1,6 @@
- Import("env_clipper_boost_python_ext")
- env = env_clipper_boost_python_ext.Clone()
--env.Prepend(LIBS=["clipper", "cctbx"])
-+env.Prepend(LIBS=["clipper-core", "cctbx"])
- env.SharedLibrary(
-   target="#lib/clipper_ext",
-   source=[
-diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
-index 1443e6c..2d6f6bc 100644
---- a/cctbx_sources/libtbx/SConscript
-+++ b/cctbx_sources/libtbx/SConscript
-@@ -1082,4 +1082,26 @@ if (libtbx.env.build_options.libtoolize):
-   env_etc.shlinkflags.extend(rpath_link)
-   env_etc.set_libtool(env_base, env_etc.rpath)
- 
-+env_etc.use_system_libs = False
-+def check_syslib(lib, extra_libs=None):
-+  """ Check if a system library is available """
-+  if not env_etc.use_system_libs:
-+    return False
-+  env_syslib = env_base.Clone(LIBS=extra_libs)
-+  conf = env_syslib.Configure()
-+  if not conf.CheckLib(library=lib):
-+    print 'Could not find %s library!'%(lib)
-+    conf.Finish()
-+    return False
-+  else:
-+    conf.Finish()
-+    return True
-+env_etc.check_syslib = check_syslib
-+
-+env_etc.py_vers = libtbx.env_config.python_version()
-+env_etc.py_major = env_etc.py_vers[0]
-+env_etc.py_minor = env_etc.py_vers[1]
-+if (libtbx.env.build_options.use_system_libs):
-+  env_etc.use_system_libs = True
-+
- Export("env_base", "env_etc")
-diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
-index 2285c9d..8b0cc88 100644
---- a/cctbx_sources/libtbx/env_config.py
-+++ b/cctbx_sources/libtbx/env_config.py
-@@ -161,6 +161,9 @@ def python_include_path(must_exist=True):
-       % include_path)
-   return include_path
- 
-+def python_version(must_exist=True):
-+  return sys.version_info
-+
- def ld_library_path_var_name():
-   if (os.name == "nt"):
-     return "PATH"
-@@ -703,6 +706,7 @@ Wait for the command to finish, then try again.""" % vars())
-         static_exe=command_line.options.static_exe,
-         libtoolize=command_line.options.libtoolize,
-         rpath=command_line.options.rpath,
-+        use_system_libs=command_line.options.use_system_libs,
-         scan_boost=command_line.options.scan_boost,
-         write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
-         boost_python_no_py_signatures
-@@ -1762,6 +1766,7 @@ class build_options:
-         static_libraries,
-         static_exe,
-         libtoolize,
-+        use_system_libs,
-         rpath,
-         scan_boost,
-         write_full_flex_fwd_h=default_write_full_flex_fwd_h,
-@@ -1833,6 +1838,7 @@ class build_options:
-     print >> f, "Enable OpenMP if possible:", self.enable_openmp_if_possible
-     print >> f, "Enable CUDA:", self.enable_cuda
-     print >> f, "Libtoolize:", self.libtoolize
-+    print >> f, "Use System Libraries:", self.use_system_libs
-     print >> f, "Use opt_resources if available:", self.opt_resources
-     print >> f, "Use environment flags:", self.use_environment_flags
-     if( self.use_environment_flags ):
-@@ -1955,6 +1961,10 @@ class pre_process_args:
-         action="store_true",
-         default=False,
-         help="build all shared libraries with libtool. Optionally set --rpath")
-+      parser.option(None, "--use_system_libs",
-+        action="store_true",
-+        default=False,
-+        help="Use system Libraries to build.")
-       parser.option(None, "--rpath",
-         type="string",
-         action="store",
--- 
diff --git a/debian/patches/0009-adding-install-targets-and-prefix-support.patch b/debian/patches/0009-adding-install-targets-and-prefix-support.patch
deleted file mode 100644
index e002ed0..0000000
--- a/debian/patches/0009-adding-install-targets-and-prefix-support.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-From: Radostan Riedel <raybuntu at googlemail.com>
-Date: Thu, 19 Jul 2012 00:09:45 +0200
-Subject: adding install targets and prefix support
-
----
- cctbx_sources/libtbx/SConscript    |   55 +++++++++++++++++++++++++++++++++++-
- cctbx_sources/libtbx/env_config.py |    9 ++++++
- 2 files changed, 63 insertions(+), 1 deletion(-)
-
-diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
-index 2d6f6bc..ed1f857 100644
---- a/cctbx_sources/libtbx/SConscript
-+++ b/cctbx_sources/libtbx/SConscript
-@@ -4,7 +4,7 @@ from libtbx import easy_run
- from libtbx.utils import getenv_bool
- from libtbx.str_utils import show_string
- from libtbx.path import norm_join, full_command_path
--import sys, os
-+import sys, os, re
- op = os.path
- 
- if (hasattr(Environment, "Clone")):
-@@ -1074,6 +1074,7 @@ def unset_libtool(env, rpath):
-   env.Append(LIBPATH=libtool_install_path)
- env_etc.unset_libtool = unset_libtool
- 
-+env_etc.rpath = ''
- if (libtbx.env.build_options.libtoolize):
-   env_etc.shlibsuffix = ".la"
-   env_base.Append(LIBSUFFIXES=[env_etc.shlibsuffix])
-@@ -1104,4 +1105,56 @@ env_etc.py_minor = env_etc.py_vers[1]
- if (libtbx.env.build_options.use_system_libs):
-   env_etc.use_system_libs = True
- 
-+def install_headerfiles(prefix):
-+  rp = libtbx.env.repository_paths
-+  cwd = os.getcwd()
-+  for p in rp:
-+    src_dir = abs(p)
-+    os.chdir(src_dir)
-+    for root, dirnames, filenames in os.walk('.'):
-+      for filename in filenames:
-+        if re.match('^.*\.(h|hpp)$', filename, flags=re.IGNORECASE):
-+          dest = os.path.join(prefix, root)
-+          src = os.path.join(src_dir, root, filename)
-+          env_base.Install(dest, src)
-+          env_base.Alias("install", dest)
-+  os.chdir(cwd)
-+
-+env_etc.prefix = libtbx.env.build_options.install_prefix
-+env_etc.libpath = os.path.join(env_etc.prefix, 'lib')
-+env_etc.inclpath = os.path.join(env_etc.prefix, 'include')
-+
-+def create_install_targets():
-+  cwd = os.getcwd()
-+  rp = libtbx.env.repository_paths
-+  lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
-+  if not os.path.exists(lib_dir):
-+    os.makedirs(lib_dir)
-+  rp = list(rp)
-+  rp.append(lib_dir)
-+  for p in rp:
-+    if isinstance(p, str):
-+      src_dir = p
-+    else:
-+      src_dir = abs(p)
-+    os.chdir(src_dir)
-+    dest = None
-+    for root, dirnames, filenames in os.walk('.'):
-+      for filename in filenames:
-+        if re.match('^lib.*\.(so.*|dylib.*|la|a)$', filename, flags=re.IGNORECASE):
-+          dest = os.path.join(env_etc.libpath, root)
-+          src = os.path.join(src_dir, root, filename)
-+          env_base.Install(dest, src)
-+          env_base.Alias("install-shlib", dest)
-+        if re.match('^.*\.(h|hpp)$', filename, flags=re.IGNORECASE):
-+          dest = os.path.join(env_etc.inclpath, root)
-+          src = os.path.join(src_dir, root, filename)
-+          env_base.Install(dest, src)
-+          env_base.Alias("install-header", dest)
-+  Alias('install', ['install-header', 'install-shlib'])
-+  os.chdir(cwd)
-+
-+if 'install' in COMMAND_LINE_TARGETS:
-+  create_install_targets()
-+
- Export("env_base", "env_etc")
-diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
-index 8b0cc88..b6bab84 100644
---- a/cctbx_sources/libtbx/env_config.py
-+++ b/cctbx_sources/libtbx/env_config.py
-@@ -707,6 +707,7 @@ Wait for the command to finish, then try again.""" % vars())
-         libtoolize=command_line.options.libtoolize,
-         rpath=command_line.options.rpath,
-         use_system_libs=command_line.options.use_system_libs,
-+        install_prefix=command_line.options.install_prefix,
-         scan_boost=command_line.options.scan_boost,
-         write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
-         boost_python_no_py_signatures
-@@ -1767,6 +1768,7 @@ class build_options:
-         static_exe,
-         libtoolize,
-         use_system_libs,
-+        install_prefix,
-         rpath,
-         scan_boost,
-         write_full_flex_fwd_h=default_write_full_flex_fwd_h,
-@@ -1839,6 +1841,7 @@ class build_options:
-     print >> f, "Enable CUDA:", self.enable_cuda
-     print >> f, "Libtoolize:", self.libtoolize
-     print >> f, "Use System Libraries:", self.use_system_libs
-+    print >> f, "Install Prefix:", self.install_prefix
-     print >> f, "Use opt_resources if available:", self.opt_resources
-     print >> f, "Use environment flags:", self.use_environment_flags
-     if( self.use_environment_flags ):
-@@ -1971,6 +1974,12 @@ class pre_process_args:
-         default="/usr/lib",
-         help="sets the rpath libtool (implies --libtoolize). Default: /usr/lib",
-         metavar="DIRECTORY")
-+      parser.option(None, "--install_prefix",
-+        type="string",
-+        action="store",
-+        default="/usr/local",
-+        help="sets the prefix for the install targets. Default: /usr/local",
-+        metavar="DIRECTORY")
-       parser.option(None, "--scan_boost",
-         action="store_true",
-         default=False,
--- 
diff --git a/debian/patches/0011-build-libann-statically.patch b/debian/patches/0009-build-libann-statically.patch
similarity index 100%
rename from debian/patches/0011-build-libann-statically.patch
rename to debian/patches/0009-build-libann-statically.patch
diff --git a/debian/patches/0010-add-with_pycbf-option.patch b/debian/patches/0010-add-with_pycbf-option.patch
deleted file mode 100644
index 8e9a5d6..0000000
--- a/debian/patches/0010-add-with_pycbf-option.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From: Radostan Riedel <raybuntu at googlemail.com>
-Date: Thu, 19 Jul 2012 11:27:37 +0200
-Subject: add with_pycbf option
-
----
- cctbx_sources/cbflib_adaptbx/SConscript |    9 +++++----
- cctbx_sources/libtbx/SConscript         |    1 +
- cctbx_sources/libtbx/env_config.py      |    6 ++++++
- 3 files changed, 12 insertions(+), 4 deletions(-)
-
-diff --git a/cctbx_sources/cbflib_adaptbx/SConscript b/cctbx_sources/cbflib_adaptbx/SConscript
-index 4ac6717..14deee3 100644
---- a/cctbx_sources/cbflib_adaptbx/SConscript
-+++ b/cctbx_sources/cbflib_adaptbx/SConscript
-@@ -77,10 +77,11 @@ if (not env_etc.no_boost_python):
-     env=env_cbflib_boost_python_ext,
-     paths=env_etc.cbflib_common_includes + [env_etc.python_include])
- 
--  env_cbflib_boost_python_ext.SharedLibrary(
--    target='#lib/_pycbf',
--    source=[prefix+"/pycbf/pycbf_wrap.c"],
--    LIBS=["cbf"]+env_etc.libs_python+env_etc.libm)
-+  if env_etc.with_pycbf:
-+    env_cbflib_boost_python_ext.SharedLibrary(
-+      target='#lib/_pycbf',
-+      source=[prefix+"/pycbf/pycbf_wrap.c"],
-+      LIBS=["cbf"]+env_etc.libs_python+env_etc.libm)
- 
-   Export("env_cbflib_boost_python_ext")
- 
-diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
-index ed1f857..8b637c9 100644
---- a/cctbx_sources/libtbx/SConscript
-+++ b/cctbx_sources/libtbx/SConscript
-@@ -1120,6 +1120,7 @@ def install_headerfiles(prefix):
-           env_base.Alias("install", dest)
-   os.chdir(cwd)
- 
-+env_etc.with_pycbf = libtbx.env.build_options.with_pycbf
- env_etc.prefix = libtbx.env.build_options.install_prefix
- env_etc.libpath = os.path.join(env_etc.prefix, 'lib')
- env_etc.inclpath = os.path.join(env_etc.prefix, 'include')
-diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
-index b6bab84..687c00d 100644
---- a/cctbx_sources/libtbx/env_config.py
-+++ b/cctbx_sources/libtbx/env_config.py
-@@ -707,6 +707,7 @@ Wait for the command to finish, then try again.""" % vars())
-         libtoolize=command_line.options.libtoolize,
-         rpath=command_line.options.rpath,
-         use_system_libs=command_line.options.use_system_libs,
-+        with_pycbf=command_line.options.with_pycbf,
-         install_prefix=command_line.options.install_prefix,
-         scan_boost=command_line.options.scan_boost,
-         write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
-@@ -1768,6 +1769,7 @@ class build_options:
-         static_exe,
-         libtoolize,
-         use_system_libs,
-+        with_pycbf,
-         install_prefix,
-         rpath,
-         scan_boost,
-@@ -1968,6 +1970,10 @@ class pre_process_args:
-         action="store_true",
-         default=False,
-         help="Use system Libraries to build.")
-+      parser.option(None, "--with_pycbf",
-+        action="store_true",
-+        default=False,
-+        help="Build pycbf extension.")
-       parser.option(None, "--rpath",
-         type="string",
-         action="store",
--- 
diff --git a/debian/patches/0010-adding-setup_py.patch b/debian/patches/0010-adding-setup_py.patch
new file mode 100644
index 0000000..8e02c79
--- /dev/null
+++ b/debian/patches/0010-adding-setup_py.patch
@@ -0,0 +1,260 @@
+From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca at debian.org>
+Date: Sat, 30 Jun 2012 16:03:05 +0200
+Subject: adding-setup_py
+
+---
+ cctbx_sources/stdlib.py |    4 ++
+ sconsutils.py           |  109 ++++++++++++++++++++++++++++++++++++++++++++
+ setup.py                |  115 +++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 228 insertions(+)
+ create mode 100755 cctbx_sources/stdlib.py
+ create mode 100644 sconsutils.py
+ create mode 100755 setup.py
+
+diff --git a/cctbx_sources/stdlib.py b/cctbx_sources/stdlib.py
+new file mode 100755
+index 0000000..759f689
+--- /dev/null
++++ b/cctbx_sources/stdlib.py
+@@ -0,0 +1,4 @@
++from libtbx.forward_compatibility import stdlib_import
++
++math = stdlib_import("math")
++random = stdlib_import("random")
+diff --git a/sconsutils.py b/sconsutils.py
+new file mode 100644
+index 0000000..2d20eb4
+--- /dev/null
++++ b/sconsutils.py
+@@ -0,0 +1,109 @@
++from distutils.command.build_ext import build_ext as _build_ext
++from distutils.command.install import install as _install
++from distutils.cmd import Command as _Command
++import sys, os
++import SCons.Script
++import libtbx.env_config
++import libtbx
++import threading
++
++BUILDDIR = ''
++configure_list = []
++scons_buildargv = []
++scons_installargv = []
++PREFIX = ''
++
++class Command(_Command, object):
++    def run_scons(self, argv):
++        cwd = os.getcwd()
++        if not os.path.exists(BUILDDIR):
++            os.mkdir(BUILDDIR)
++        elif not os.path.isdir(BUILDDIR):
++            raise RuntimeError(("Build directory '%s' cannot be created "
++                                "because of existing file") % BUILDDIR)
++        os.chdir(BUILDDIR)
++        libtbx.env_config.cold_start(configure_list)
++        os.environ["LIBTBX_BUILD"] = BUILDDIR
++        os.environ['PYTHONPATH'] = ':'.join(sys.path)
++        self.spawn(argv)
++        os.chdir(cwd)
++class install(_install, Command):
++    def run(self):
++        super(install, self).run()
++        if self.root != None:
++            ip = '--install_prefix'
++            if ip not in configure_list:
++                configure_list.extend([ip, self.root + PREFIX])
++        self.run_scons(scons_installargv)
++
++class build_ext(_build_ext, Command):
++    def run(self):
++        self.run_scons(scons_buildargv)
++        for ext in self.extensions:
++            src = ext.sources[0]
++            bld = os.path.join(BUILDDIR, src)
++            dst = self.get_ext_fullpath(ext.name)
++            if os.path.isfile(bld):
++                self.copy_file(bld, dst)
++
++# adapted from setuptools
++# authors: Phillip J. Eby, Tarek Ziade and the distutils SIG
++# licence: PSF or ZPL
++
++from distutils.util import convert_path
++import re
++
++EXTPAT1 = re.compile(r"^from (\S+_ext) import")
++EXTPAT2 = re.compile(r"^import (\S+_ext)$")
++EXTPAT3 = re.compile(r"boost.python.import_ext\(['\"](\S+_ext)['\"]\)$")
++
++def find_packages_and_extensions(where='.', exclude=()):
++    """Return a list all Python packages found within directory 'where'
++    and a list all extensions that need to be installed inside those packages
++
++    'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it
++    will be converted to the appropriate local path syntax.  'exclude' is a
++    sequence of package names to exclude; '*' can be used as a wildcard in the
++    names, such that 'foo.*' will exclude all subpackages of 'foo' (but not
++    'foo' itself).
++    """
++    out = []
++    outext = set()
++    stack=[(convert_path(where), '')]
++
++    while stack:
++
++        where,prefix = stack.pop(0)
++        for name in os.listdir(where):
++
++            fn = os.path.join(where,name)
++            if ('.' not in name and os.path.isdir(fn) and
++                os.path.isfile(os.path.join(fn,'__init__.py'))
++            ):
++
++                out.append(prefix+name); stack.append((fn,prefix+name+'.'))
++
++            if name.endswith('.py'):
++
++                f = open(os.path.join(where, name))
++                for l in f:
++
++                    m = EXTPAT1.match(l)
++                    if m is not None:
++                        outext.add(m.group(1))
++
++                    m = EXTPAT2.match(l)
++                    if m is not None:
++                        outext.add(m.group(1))
++
++                    m = EXTPAT3.search(l)
++                    if m is not None:
++                        outext.add(m.group(1))
++
++                f.close()
++
++    for pat in list(exclude)+['ez_setup', 'distribute_setup']:
++        from fnmatch import fnmatchcase
++        out = [item for item in out if not fnmatchcase(item,pat)]
++
++    return out, list(outext)
+diff --git a/setup.py b/setup.py
+new file mode 100755
+index 0000000..633cc0b
+--- /dev/null
++++ b/setup.py
+@@ -0,0 +1,115 @@
++from distutils.core import setup, Extension
++import sys, os, shutil
++
++# General settings
++opj = os.path.join
++CURDIR = os.getcwd()
++SRCDIR = opj(CURDIR, 'cctbx_sources/')
++BUILDDIR = opj(CURDIR, 'build%i.%i'%(sys.version_info[0], sys.version_info[1]))
++clipper = 'clipper_adaptbx/clipper'
++boost = 'boost_adaptbx/boost'
++libtbx_pypath = 'libtbx/pythonpath'
++scons_path = '/usr/lib/scons/'
++PATHLIST= [ SRCDIR,
++            opj(SRCDIR, libtbx_pypath),
++            opj(SRCDIR, clipper),
++            opj(SRCDIR, boost),
++            scons_path,
++          ]
++for p in PATHLIST:
++    if p not in sys.path:
++        sys.path.append(p)
++
++import sconsutils
++from sconsutils import build_ext, find_packages_and_extensions, install
++
++
++# Configure settings
++# We need this directory to get env_config.cold_start to run!
++# trailing slash is important
++init_dir = opj(BUILDDIR, SRCDIR, 'libtbx/')
++build_opts = [ '--libtoolize',
++               '--rpath', '/usr/lib',
++               '--use_system_libs',
++             ]
++conf_modules = [ 'annlib_adaptbx',
++                 'boost_adaptbx',
++                 'cbflib_adaptbx',
++                 'ccp4io_adaptbx',
++                 'cctbx',
++                 'chiltbx',
++                 'clipper_adaptbx',
++                 'crys3d',
++                 'fable',
++                 'fftw3tbx',
++                 'gltbx',
++                 'iotbx',
++                 'libtbx',
++                 'mmtbx',
++                 'omptbx',
++                 'rstbx',
++                 'scitbx',
++                 'smtbx',
++                 'spotfinder',
++                 'tbxx',
++                 'tntbx',
++                 'ucif',
++                 'wxtbx',
++               ]
++sconsutils.configure_list = [init_dir]
++sconsutils.configure_list.extend(build_opts)
++sconsutils.configure_list.extend(conf_modules)
++sconsutils.BUILDDIR = BUILDDIR
++sconsutils.PREFIX = '/usr/'
++
++# Build settings
++sconsutils.scons_buildargv = [sys.executable, '/usr/bin/scons', '-j', '8']
++
++# Install settings
++sconsutils.scons_installargv = [sys.executable, '/usr/bin/scons', 'install']
++
++# Setup settings
++
++NAME = 'cctbx'
++VERSION = '0.1'
++DESCRIPTION = 'cctbx'
++AUTHOR = 'cctbx'
++AUTHOR_EMAIL = 'cctbx at cci.lbl.gov'
++URL = 'http://cctbx.sourceforge.net/'
++LICENSE = 'CCTBX 2.0'
++KEYWORDS = 'crystallography'
++SCRIPTS = []
++PKG_DATA = {}
++EXTRA_PATH = 'cctbx'
++PACKDIR = { 'boost' : SRCDIR + 'boost_adaptbx/boost',
++            'clipper' : SRCDIR + 'clipper_adaptbx/clipper',
++            'optik' : SRCDIR + 'libtbx/pythonpath/optik',
++            'tntbx' : SRCDIR + 'tntbx/tntbx',
++            '' : SRCDIR,
++          }
++
++MODS = ['stdlib']
++PACKS, EXT_MODULES = find_packages_and_extensions(SRCDIR)
++PACKS.extend(['boost','clipper','optik','tntbx'])
++
++# TODO: This should also work with Mac OSX and Windows without hard coding the
++# file ext.
++EXT_MODULES = [ Extension(e, ['lib/%s.so'%e]) for e in EXT_MODULES ]
++
++setup(name=NAME,
++      version = VERSION,
++      author = AUTHOR,
++      author_email = AUTHOR_EMAIL,
++      url = URL,
++      description = DESCRIPTION,
++      license = LICENSE,
++      keywords = KEYWORDS,
++      extra_path = EXTRA_PATH,
++      scripts = SCRIPTS,
++      packages = PACKS,
++      package_dir = PACKDIR,
++      ext_modules = EXT_MODULES,
++      cmdclass = {'build_ext': build_ext,
++                  'install': install},
++      py_modules = MODS,
++     )
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 9475ed2..e6f8210 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,11 +1,10 @@
 0001-remove-hardcoded-libtbx_build-env.patch
 0002-fix-opengl-header-missing-gltbx.patch
 0003-correct-paths-in-dispatcher-creation.patch
-0004-adding-setup_py.patch
-0005-adding-shlib-versioning.patch
-0006-upstream-fix-for-declaration-errors-in-gcc4.7.patch
-0007-fix-for-gcc4.7-compilation-error.patch
-0008-upstream-fix-to-use-system-libraries.patch
-0009-adding-install-targets-and-prefix-support.patch
-0010-add-with_pycbf-option.patch
-0011-build-libann-statically.patch
+0004-adding-shlib-versioning.patch
+0005-upstream-fix-for-declaration-errors-in-gcc4.7.patch
+0006-fix-for-gcc4.7-compilation-error.patch
+0007-options-for-system-libs-installtarget-and-prefix.patch
+0008-add-with_pycbf-option.patch
+0009-build-libann-statically.patch
+0010-adding-setup_py.patch

-- 
Packaging for cctbx



More information about the debian-science-commits mailing list