[svn] commit: r667 - in /branches/parkinglot/src/bin/bind10: Makefile.am bind10.py.in run_bind10.sh.in

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jan 29 23:42:44 UTC 2010


Author: jelte
Date: Fri Jan 29 23:42:44 2010
New Revision: 667

Log:
install bob.spec

bind10.py now uses the specfile at the install targets location, unless the environment variable B10_SPECFILE_PATH is set, in which case that path is used

run_bind10.sh sets that variable

Modified:
    branches/parkinglot/src/bin/bind10/Makefile.am
    branches/parkinglot/src/bin/bind10/bind10.py.in
    branches/parkinglot/src/bin/bind10/run_bind10.sh.in

Modified: branches/parkinglot/src/bin/bind10/Makefile.am
==============================================================================
--- branches/parkinglot/src/bin/bind10/Makefile.am (original)
+++ branches/parkinglot/src/bin/bind10/Makefile.am Fri Jan 29 23:42:44 2010
@@ -1,5 +1,8 @@
 bin_SCRIPTS = bind10
 CLEANFILES = bind10.py
+
+bind10dir = $(DESTDIR)$(pkgdatadir)
+bind10_DATA = bob.spec
 
 # TODO: does this need $$(DESTDIR) also?
 # this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix

Modified: branches/parkinglot/src/bin/bind10/bind10.py.in
==============================================================================
--- branches/parkinglot/src/bin/bind10/bind10.py.in (original)
+++ branches/parkinglot/src/bin/bind10/bind10.py.in Fri Jan 29 23:42:44 2010
@@ -1,6 +1,7 @@
 #!@PYTHON@
 
 import sys; sys.path.append ('@@PYTHONPATH@@')
+import os
 
 """\
 This file implements the Boss of Bind (BoB, or bob) program.
@@ -22,6 +23,18 @@
 signal handling outside of that class, in the code running for
 __main__.
 """
+
+# If B10_SPECFILE_PATH is set in the environment, we use the specification
+# file there, instead of the installed one (for instance when we run
+# from the source tree)
+if "B10_SPECFILE_PATH" in os.environ:
+    SPECFILE_LOCATION = os.environ["B10_SPECFILE_PATH"] + "bob.spec"
+else:
+    PREFIX = "@prefix@"
+    DATAROOTDIR = "@datarootdir@"
+    SPECFILE_LOCATION = "@datadir@/@PACKAGE@/bob.spec".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
+    
+
 
 # TODO: start up statistics thingy
 
@@ -56,7 +69,8 @@
             spawn_stdout = None
         spawn_env = self.env
         spawn_env['PATH'] = os.environ['PATH']
-        spawn_env['PYTHON_EXEC'] = os.environ['PYTHON_EXEC']
+        if 'PYTHON_EXEC' in os.environ:
+            spawn_env['PYTHON_EXEC'] = os.environ['PYTHON_EXEC']
         self.process = subprocess.Popen(self.args,
                                         stdin=subprocess.PIPE,
                                         stdout=spawn_stdout,
@@ -172,7 +186,7 @@
         time.sleep(1)
         if self.verbose:
             print("[XX] starting ccsession")
-        self.ccs = isc.config.CCSession("bob.spec", self.config_handler, self.command_handler)
+        self.ccs = isc.config.CCSession(SPECFILE_LOCATION, self.config_handler, self.command_handler)
         if self.verbose:
             print("[XX] ccsession started")
 

Modified: branches/parkinglot/src/bin/bind10/run_bind10.sh.in
==============================================================================
--- branches/parkinglot/src/bin/bind10/run_bind10.sh.in (original)
+++ branches/parkinglot/src/bin/bind10/run_bind10.sh.in Fri Jan 29 23:42:44 2010
@@ -11,6 +11,9 @@
 PYTHONPATH=@abs_top_srcdir@/src/lib/cc/python:@abs_top_srcdir@/src/lib/config/python
 export PYTHONPATH
 
+B10_SPECFILE_PATH=@abs_srcdir@
+export B10_SPECFILE_PATH
+
 cd ${BIND10_PATH}
 exec ${PYTHON_EXEC} -O bind10 $*
 




More information about the bind10-changes mailing list