]> git.lizzy.rs Git - torbrowser-launcher.git/blobdiff - setup.py
Allow url_list
[torbrowser-launcher.git] / setup.py
index 6bb44b69325e904d3c10b1397128ad8f80d662c9..4e06e60020b982973076cbd3f574dc9cecda38a4 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -28,14 +28,14 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 import os
 import sys
-import platform
+import distro
 import subprocess
 from distutils.core import setup
 
 SHARE = "share"
 
 # detect linux distribution
-distro = platform.dist()[0]
+distro = distro.linux_distribution()[0]
 
 
 def file_list(path):
@@ -52,7 +52,9 @@ def create_mo_files():
         return []
     domain = "torbrowser-launcher"
     mo_files = []
-    po_files = [f for f in next(os.walk(po_dir))[2] if os.path.splitext(f)[1] == ".po"]
+    po_files = sorted(
+        [f for f in next(os.walk(po_dir))[2] if os.path.splitext(f)[1] == ".po"]
+    )
     for po_file in po_files:
         filename, extension = os.path.splitext(po_file)
         mo_file = domain + ".mo"
@@ -69,9 +71,8 @@ with open(os.path.join(SHARE, "torbrowser-launcher/version")) as buf:
 
 datafiles = []
 for root, dirs, files in os.walk(SHARE):
-    datafiles.append(
-        (os.path.join(sys.prefix, root), [os.path.join(root, f) for f in files])
-    )
+    if files:
+        datafiles.append((root, [os.path.join(root, f) for f in files]))
 
 # disable shipping apparmor profiles until they work in ubuntu (#128)
 if distro != "Ubuntu":
@@ -92,7 +93,7 @@ if distro != "Ubuntu":
             ("/etc/apparmor.d/tunables/", ["apparmor/tunables/torbrowser"]),
         ]
 
-datafiles += [("/usr/share/locale/", create_mo_files())]
+datafiles += [(os.path.dirname(f), [f]) for f in create_mo_files()]
 
 setup(
     name="torbrowser-launcher",
@@ -117,4 +118,11 @@ Browser.
     packages=["torbrowser_launcher"],
     scripts=["torbrowser-launcher"],
     data_files=datafiles,
+    install_requires=[
+        'gpg',
+        'packaging',
+        'PyQt5',
+        'requests',
+        'PySocks',
+    ],
 )