tMerge pull request #258 from tuxcanfly/master - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit a34d9a380c65135ed6e89a6977feba797bf970f6 DIR parent cd1ad84ed9319536e1696c02f10c2af8df2738cc HTML Author: ThomasV <thomasv1@gmx.de> Date: Sun, 4 Aug 2013 12:37:37 -0700 Merge pull request #258 from tuxcanfly/master fixes #245: use alternate datafiles location Diffstat: M setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- DIR diff --git a/setup.py b/setup.py t@@ -11,18 +11,23 @@ util = imp.load_source('version', 'lib/util.py') if sys.version_info[:3] < (2,6,0): sys.exit("Error: Electrum requires Python version >= 2.6.0...") +usr_share = '/usr/share' +if not os.access(usr_share, os.W_OK): + usr_share = os.getenv("XDG_DATA_HOME", + os.path.join(os.getenv("HOME"), ".local", "share")) + data_files = [] if (len(sys.argv) > 1 and (sys.argv[1] == "sdist")) or (platform.system() != 'Windows' and platform.system() != 'Darwin'): print "Including all files" data_files += [ - ('/usr/share/applications/',['electrum.desktop']), - ('/usr/share/app-install/icons/',['icons/electrum.png']) + (os.path.join(usr_share, 'applications/'),['electrum.desktop']), + (os.path.join(usr_share, 'app-install', 'icons/'),['icons/electrum.png']) ] if not os.path.exists('locale'): os.mkdir('locale') for lang in os.listdir('locale'): if os.path.exists('locale/%s/LC_MESSAGES/electrum.mo'%lang): - data_files.append( ('/usr/share/locale/%s/LC_MESSAGES'%lang, ['locale/%s/LC_MESSAGES/electrum.mo'%lang]) ) + data_files.append( (os.path.join(usr_share, 'locale/%s/LC_MESSAGES'%lang), ['locale/%s/LC_MESSAGES/electrum.mo'%lang]) ) data_files += [ (util.appdata_dir(), ["data/README"]),