From: Sascha Girrulat <sascha@girrulat.de>
Date: Sun, 1 Nov 2015 00:20:00 +0100
Subject: Use x_ignore_nofocus from /usr/lib/firefoxdriver

---
 py/selenium/webdriver/firefox/firefox_binary.py | 7 ++++---
 setup.py                                        | 4 +---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/py/selenium/webdriver/firefox/firefox_binary.py b/py/selenium/webdriver/firefox/firefox_binary.py
index 1bf072e..f151ead 100644
--- a/py/selenium/webdriver/firefox/firefox_binary.py
+++ b/py/selenium/webdriver/firefox/firefox_binary.py
@@ -181,14 +181,15 @@ class FirefoxBinary(object):
 
     def _extract_and_check(self, profile, no_focus_so_name, x86, amd64):
 
+        os_lib_path = '/usr/lib/firefoxdriver'
+
         paths = [x86, amd64]
         built_path = ""
         for path in paths:
             library_path = os.path.join(profile.path, path)
-            if not os.path.exists(library_path):
-                os.makedirs(library_path)
+            os.makedirs(library_path)
             import shutil
-            shutil.copy(os.path.join(os.path.dirname(__file__), path,
+            shutil.copy(os.path.join(os_lib_path, path,
               self.NO_FOCUS_LIBRARY_NAME),
               library_path)
             built_path += library_path + ":"
diff --git a/setup.py b/setup.py
index 8a9919d..a3ef32b 100644
--- a/setup.py
+++ b/setup.py
@@ -70,10 +70,8 @@ setup_args = {
                  'selenium.webdriver.remote',
                  'selenium.webdriver.support', ],
     'package_data': {
-        'selenium.webdriver.firefox': ['*.xpi', 'webdriver_prefs.json'],
+        'selenium.webdriver.firefox': ['webdriver_prefs.json'],
     },
-    'data_files': [('selenium/webdriver/firefox/x86', ['py/selenium/webdriver/firefox/x86/x_ignore_nofocus.so']),
-                   ('selenium/webdriver/firefox/amd64', ['py/selenium/webdriver/firefox/amd64/x_ignore_nofocus.so'])],
     'include_package_data': True,
     'zip_safe': False
 }
