Commit 75d25449 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

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


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@667 e5f2f494-b856-4b98-b285-d166d9295462
parent 34e45abf
bin_SCRIPTS = bind10 bin_SCRIPTS = bind10
CLEANFILES = bind10.py CLEANFILES = bind10.py
bind10dir = $(DESTDIR)$(pkgdatadir)
bind10_DATA = bob.spec
# TODO: does this need $$(DESTDIR) also? # TODO: does this need $$(DESTDIR) also?
# this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix # this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix
bind10: bind10.py bind10: bind10.py
......
#!@PYTHON@ #!@PYTHON@
import sys; sys.path.append ('@@PYTHONPATH@@') import sys; sys.path.append ('@@PYTHONPATH@@')
import os
"""\ """\
This file implements the Boss of Bind (BoB, or bob) program. This file implements the Boss of Bind (BoB, or bob) program.
...@@ -23,6 +24,18 @@ signal handling outside of that class, in the code running for ...@@ -23,6 +24,18 @@ signal handling outside of that class, in the code running for
__main__. __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 # TODO: start up statistics thingy
import subprocess import subprocess
...@@ -56,7 +69,8 @@ class ProcessInfo: ...@@ -56,7 +69,8 @@ class ProcessInfo:
spawn_stdout = None spawn_stdout = None
spawn_env = self.env spawn_env = self.env
spawn_env['PATH'] = os.environ['PATH'] 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, self.process = subprocess.Popen(self.args,
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=spawn_stdout, stdout=spawn_stdout,
...@@ -172,7 +186,7 @@ class BoB: ...@@ -172,7 +186,7 @@ class BoB:
time.sleep(1) time.sleep(1)
if self.verbose: if self.verbose:
print("[XX] starting ccsession") 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: if self.verbose:
print("[XX] ccsession started") print("[XX] ccsession started")
......
...@@ -11,6 +11,9 @@ export PATH ...@@ -11,6 +11,9 @@ export PATH
PYTHONPATH=@abs_top_srcdir@/src/lib/cc/python:@abs_top_srcdir@/src/lib/config/python PYTHONPATH=@abs_top_srcdir@/src/lib/cc/python:@abs_top_srcdir@/src/lib/config/python
export PYTHONPATH export PYTHONPATH
B10_SPECFILE_PATH=@abs_srcdir@
export B10_SPECFILE_PATH
cd ${BIND10_PATH} cd ${BIND10_PATH}
exec ${PYTHON_EXEC} -O bind10 $* exec ${PYTHON_EXEC} -O bind10 $*
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment