[SCM] Packaging for cctbx branch, master, updated. upstream/2012.05.08.2305-23-gd0e9352

Radostan Riedel raybuntu at googlemail.com
Wed Jul 18 23:41:05 UTC 2012


The following commit has been merged in the master branch:
commit b11c1cfc1efbf109935c5078fdd751be0d09f08f
Author: Radostan Riedel <raybuntu at googlemail.com>
Date:   Thu Jul 19 00:11:08 2012 +0200

    Add patch for install targets and prefix support

diff --git a/debian/patches/0009-adding-install-targets-and-prefix-support.patch b/debian/patches/0009-adding-install-targets-and-prefix-support.patch
new file mode 100644
index 0000000..e002ed0
--- /dev/null
+++ b/debian/patches/0009-adding-install-targets-and-prefix-support.patch
@@ -0,0 +1,129 @@
+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/series b/debian/patches/series
index 7bbc147..9c6284f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
 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
diff --git a/debian/rules b/debian/rules
index cb3e3cc..62c7d1d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,7 +26,22 @@ BUILDDIR        = $(CURDIR)/$(builddir)
 %: 
 	dh $@ --with python2
 
+override_dh_auto_build: 
+	mkdir -p $(BUILDDIR)-shlibs
+	cd $(BUILDDIR)-shlibs; python $(SRCDIR)/libtbx/configure.py \
+		--libtoolize \
+		--build-boost-python-extensions=False \
+		--rpath "/usr/lib" \
+		--use_system_libs \
+		--install_prefix "$(CURDIR)/debian/tmp/usr" \
+		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
+	cd $(BUILDDIR)-shlibs;. $(BUILDDIR)-shlibs/setpaths_debug.sh; \
+		python /usr/bin/scons -j "`./bin/libtbx.show_number_of_processors`"
+	dh_auto_build
+
 override_dh_auto_install:
-	install -d $(CURDIR)/debian/tmp/usr/lib/
-	install $(BUILDDIR)$(PYDEF)/lib/usr/lib/* $(CURDIR)/debian/tmp/usr/lib/
+	cd $(BUILDDIR)-shlibs;. $(BUILDDIR)-shlibs/setpaths_debug.sh; \
+		python /usr/bin/scons install
 	dh_auto_install

-- 
Packaging for cctbx



More information about the debian-science-commits mailing list