diff options
author | Tushar Gohad <tusharsg@gmail.com> | 2015-07-23 01:19:55 -0700 |
---|---|---|
committer | Tushar Gohad <tusharsg@gmail.com> | 2015-07-23 01:19:55 -0700 |
commit | 7be5f2fa7ec403a8f98d7ab43b145eb73b0ce78c (patch) | |
tree | 16cbf0ef0d22407379081029d7c5275524c16a57 | |
parent | e2cd5e51dee8a7c21f385ff30a00d6636329d387 (diff) | |
parent | aa6dae1ccd2b9cddebaf543030a4365c18e5d495 (diff) | |
download | pyeclib-7be5f2fa7ec403a8f98d7ab43b145eb73b0ce78c.tar.gz |
Merged liberasurecode_install into master
-rw-r--r-- | setup.py | 49 | ||||
-rw-r--r-- | src/c/liberasurecode-1.0.8.tar.gz | bin | 0 -> 560559 bytes |
2 files changed, 44 insertions, 5 deletions
@@ -1,6 +1,7 @@ #!/usr/bin/env python -# Copyright (c) 2013, Kevin Greenan (kmgreen2@gmail.com) +# Copyright (c) 2013-2015, Kevin Greenan (kmgreen2@gmail.com) +# Copyright (c) 2013-2015, Tushar Gohad (tusharsg@gmail.com) # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -80,10 +81,14 @@ class build(_build): def check_liberasure(self): missing = True - library_suffix = ".so" + library_basename = "liberasurecode" + library_version = "1.0.8" if platform_str.find("Darwin") > -1: - library_suffix = ".dylib" - liberasure_file = "liberasurecode" + library_suffix + liberasure_file = \ + library_basename + "." + library_version + ".dylib" + else: + liberasure_file = \ + library_basename + ".so." + library_version for dir in (default_library_paths): liberasure_file_path = dir + os.sep + liberasure_file if (os.path.isfile(liberasure_file_path)): @@ -98,7 +103,10 @@ class build(_build): print("** PyECLib requires that the liberasurecode ") print("** library be installed. ") print("** ") - print("** Please retry after installing liberasurecode: ") + print("** Trying to install using the bundled tarball. If ") + print("** this fails, please retry after installing ") + print("** liberasurecode from: ") + print("** ") print("** https://bitbucket.org/tsg-/liberasurecode.git ") print("** ") print("** If you have liberasurecode already installed, ") @@ -106,6 +114,37 @@ class build(_build): print("** the loader cache. ") print("** ") print("***************************************************") + + # try using an integrated copy of the library + library = library_basename + "-" + library_version + library_url = "https://bitbucket.org/tsg-/liberasurecode.git" + + srcpath = "src/c/" + locallibsrcdir = (srcpath + library) + os.system("rm -r %s" % locallibsrcdir) + retval = os.system("tar -xzf %s/%s.tar.gz -C %s" % + (srcpath, library, srcpath)) + if (os.path.isdir(locallibsrcdir)): + curdir = os.getcwd() + os.chdir(locallibsrcdir) + configure_cmd = ("./configure --prefix=/usr/local") + print(configure_cmd) + retval = os.system(configure_cmd) + if retval != 0: + print("*** Error: " + library + " build failed! ") + print("*** Please install " + library + " manually. ") + print("*** project url: %s" % library_url) + os.chdir(curdir) + sys.exit(retval) + make_cmd = ("make && make install") + retval = os.system(make_cmd) + if retval != 0: + print("*** Error: " + library + " install failed! ") + print("*** Please install " + library + " manually. ") + print("*** project url: %s" % library_url) + os.chdir(curdir) + sys.exit(retval) + os.chdir(curdir) sys.exit(1) def run(self): diff --git a/src/c/liberasurecode-1.0.8.tar.gz b/src/c/liberasurecode-1.0.8.tar.gz Binary files differnew file mode 100644 index 0000000..d017df8 --- /dev/null +++ b/src/c/liberasurecode-1.0.8.tar.gz |