Hi,

this patch fixes Python package lookup for sphinx-builder. Now sphinx
picks up the correct files from the current source directory.

Christian
From 620872288075a9ffeb52d670d7e26543c87c067c Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Tue, 1 Mar 2016 11:08:59 +0100
Subject: [PATCH] Use CMAKE_CURRENT_SOURCE_DIR for sphinx-build

sphinx-build used wrong search path for pki Python package. This caused
builds to fail on some machines. On systems with pki-base installed,
sphinx-build picked up the wrong files.
---
 base/common/python/CMakeLists.txt | 8 ++++++--
 base/common/python/conf.py        | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/base/common/python/CMakeLists.txt b/base/common/python/CMakeLists.txt
index d667421bfb3d42577ee11a21d919a65ff6828633..a164597755e4a48169610fbf81a092c57cc0dd9f 100644
--- a/base/common/python/CMakeLists.txt
+++ b/base/common/python/CMakeLists.txt
@@ -16,23 +16,27 @@ configure_file(
 add_custom_target(dogtag_python_client_docs ALL
     ${SPHINX_EXECUTABLE}
         -b html
-        -c "${CMAKE_CURRENT_BINARY_DIR}"
+        -c "${CMAKE_CURRENT_SOURCE_DIR}"
         -w "${CMAKE_CURRENT_BINARY_DIR}/python-client-lib-html.log"
         -a
         -W
         "${CMAKE_CURRENT_SOURCE_DIR}"
         "${CMAKE_CURRENT_BINARY_DIR}/html"
+    WORKING_DIRECTORY
+        ${CMAKE_CURRENT_SOURCE_DIR}
     COMMENT "Building Python Client Library HTML documentation")
 
 add_custom_target(dogtag_python_client_man_docs ALL
     ${SPHINX_EXECUTABLE}
         -b man
-        -c "${CMAKE_CURRENT_BINARY_DIR}"
+        -c "${CMAKE_CURRENT_SOURCE_DIR}"
         -w "${CMAKE_CURRENT_BINARY_DIR}/python-client-lib-man.log"
         -a
         -W
         "${CMAKE_CURRENT_SOURCE_DIR}"
         "${CMAKE_CURRENT_BINARY_DIR}/man"
+    WORKING_DIRECTORY
+        ${CMAKE_CURRENT_SOURCE_DIR}
     COMMENT "Building Python Client Library manual pages")
 
 install(
diff --git a/base/common/python/conf.py b/base/common/python/conf.py
index 3e548147ea9b3c3928100e0f2dd0623a9bd68c02..f996c6371cbd545ae5fc9cc3e12cab0977d56cdb 100644
--- a/base/common/python/conf.py
+++ b/base/common/python/conf.py
@@ -19,7 +19,8 @@ import sphinx
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('pki'))
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
 
 # -- General configuration -----------------------------------------------
 
-- 
2.5.0

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Pki-devel mailing list
Pki-devel@redhat.com
https://www.redhat.com/mailman/listinfo/pki-devel

Reply via email to