Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dnsviz/dnsviz.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasey Deccio <casey@deccio.net>2016-01-19 21:35:23 +0300
committerCasey Deccio <casey@deccio.net>2016-01-19 21:35:23 +0300
commit56eb76104e1382d12619b21d03e82f1a49660c46 (patch)
tree9ced88a4e60bf3058c987640dfcdfcbe274bb996 /setup.py
parent17fedf19c7072931dfaa4aaadfb1191be0d6a04f (diff)
Use pkg-config to detect location of openssl lib
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 91281c3..4a41a42 100644
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@
import glob
import os
import stat
+import subprocess
import sys
from distutils.core import setup
@@ -14,7 +15,7 @@ JQUERY_UI_PATH = "'http://code.jquery.com/ui/1.11.4/jquery-ui.min.js'"
JQUERY_UI_CSS_PATH = "'http://code.jquery.com/ui/1.11.4/themes/redmond/jquery-ui.css'"
JQUERY_PATH = "'http://code.jquery.com/jquery-1.11.3.min.js'"
RAPHAEL_PATH = "'http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.4/raphael-min.js'"
-OPENSSL_LIB_DIR = "'/usr/lib/x86_64-linux-gnu'"
+OPENSSL_LIB_DIR = None
def apply_substitutions(filename, install_prefix):
assert filename.endswith('.in'), 'Filename supplied for customization must end with \'.in\': %s' % (filename)
@@ -45,6 +46,20 @@ def make_documentation():
finally:
os.chdir('..')
+def set_openssl_lib_path():
+ global OPENSSL_LIB_DIR
+
+ msg = ''
+ try:
+ libdir = subprocess.check_output(['pkg-config', '--variable=libdir', 'openssl']).strip()
+ except (subprocess.CalledProcessError, OSError), e:
+ libdir = None
+ msg = str(e)
+ if not libdir or not os.path.exists(libdir):
+ sys.stderr.write('Warning: Unable to identify the lib directory for openssl: %s\nProceeding without support for dynamically loaded engines.\n' % msg)
+ else:
+ OPENSSL_LIB_DIR = "'%s'" % libdir
+
class MyBuild(build):
def run(self):
make_documentation()
@@ -52,6 +67,7 @@ class MyBuild(build):
class MyInstall(install):
def run(self):
+ set_openssl_lib_path()
# if this an alternate root is specified, then embed the install_data
# path relative to that alternate root
if self.root is not None: