Author: Paul_R
Date: 2008-09-09 10:43:22 +0200 (Tue, 09 Sep 2008)
New Revision: 1830

Modified:
   software_suite_v2/tuxware/pytuxisalive/trunk/src/setup.py
Log:
* BUG :
  On some distros, the python file are installed on /usr/local/lib/..., but the
  .so libraries are installed on /usr/lib/...
  This cause a several bugs, because the lbraries are not located at the same
  place than the python files. The result is that the TTS and the driver doesn't
  works.


Modified: software_suite_v2/tuxware/pytuxisalive/trunk/src/setup.py
===================================================================
--- software_suite_v2/tuxware/pytuxisalive/trunk/src/setup.py   2008-09-08 
13:07:48 UTC (rev 1829)
+++ software_suite_v2/tuxware/pytuxisalive/trunk/src/setup.py   2008-09-09 
08:43:22 UTC (rev 1830)
@@ -7,6 +7,8 @@
 import os
 import sys 
 
+os.environ['PYTHONHOME']='/usr'
+get_python_lib()
 #
 # Check dependencies
 #
@@ -57,9 +59,10 @@
     mPackages.append('tuxisalive.lib.wordlogger')
 
 #
-# Install the package
+# Install the package (python files only)
 #
 PACKAGE_BASE_PATH = get_python_lib()
+
 setup(name = 'tuxisalive',
       version = '0.0.2-Alpha',
       description = 'Python utilities for Tuxdroid',
@@ -67,6 +70,34 @@
       author_email = '[EMAIL PROTECTED]',
       url = 'http://www.tuxisalive.com',
       packages = mPackages,
+      )
+
+# Some distro (like OpenSUSE) install the site-package on /usr/local/lib/...
+# but install the data files on /usr/lib/...
+# If the .so files are not located with the site-package installation, they're
+# not found, and the server wont start.
+# To prevent this problem, installation is made three steps :
+# - 1st : python file installation on the standard location.
+# - 2nd : verify if the installation had been made on /usr/lib or 
/usr/local/lib
+# - 3rd : change the path if needed, and install the .so libraries on the
+#         correct place.
+
+# XXX I'm not sure that trick will works on Windows.
+if os.name != 'nt':
+    # Test if tuxisalive has been installed on /usr/local/lib/...
+    if  os.system("test -d /usr/local/lib/python2.5/site-packages/tuxisalive") 
== 0:
+        # Change the installation PATH for the .so libraries.
+        PACKAGE_BASE_PATH = "/usr/local/lib/python2.5/site-packages"
+
+#
+# Install the package (.so files only)
+#
+setup(name = 'tuxisalive',
+      version = '0.0.1.1-Alpha',
+      description = 'Python utilities for Tuxdroid',
+      author = 'Remi Jocaille',
+      author_email = '[EMAIL PROTECTED]',
+      url = 'http://www.tuxisalive.com',
       data_files = [
           (PACKAGE_BASE_PATH + '/tuxisalive/lib/driver', 
             ['tuxisalive/lib/driver/libtuxdriver.dll', 
@@ -75,4 +106,4 @@
             ['tuxisalive/lib/osl/libtuxosl.dll', 
              'tuxisalive/lib/osl/libtuxosl.so']),
       ]    
-      )
\ No newline at end of file
+      )


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to