]> git.lizzy.rs Git - torbrowser-launcher.git/blobdiff - setup.py
Fail to launch Tor Browser if its version is earlier than the minimum version (#224)
[torbrowser-launcher.git] / setup.py
index 32cacaa2c57a1589bb26be8e557df2b1d97630f0..ce7efe2b3557a113da0d1bc85c34cca3aa00c434 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 Tor Browser Launcher
 https://github.com/micahflee/torbrowser-launcher/
 
-Copyright (c) 2013 Micah Lee <micah@micahflee.com>
+Copyright (c) 2013-2014 Micah Lee <micah@micahflee.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
@@ -27,7 +27,11 @@ OTHER DEALINGS IN THE SOFTWARE.
 """
 
 from distutils.core import setup
-import os
+import os, sys, platform
+SHARE = 'share'
+
+# detect linux distribution
+distro = platform.dist()[0]
 
 def file_list(path):
     files = []
@@ -36,36 +40,37 @@ def file_list(path):
             files.append(path+'/'+filename)
     return files
 
-setup(name='torbrowser-launcher',
-      version='0.0.5',
-      author='Micah Lee',
-      author_email='micah@micahflee.com',
-      url='https://www.github.com/micahflee/torbrowser-launcher',
-      platforms=['GNU/Linux'],
-      license='BSD',
+with open(os.path.join(SHARE, 'torbrowser-launcher/version')) as buf:
+    version = buf.read().strip()
 
-      description='A program to help you download, keep updated, and run the Tor Browser Bundle',
-      long_description="""
-Tor Browser Launcher is intended to make the Tor Browser Bundle (TBB) easier to maintain and use for GNU/Linux users. You install torbrowser-launcher from your distribution's package manager and it handles downloading the most recent version of TBB for you, in your language and for your architecture. It also adds a "Tor Browser" application launcher to your operating system's menu.
+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]))
 
-When you first launch Tor Browser Launcher, it will download TBB from https://www.torproject.org/ and extract it in ~/.torproject, and then execute it. When you run it after that it will just execute TBB.
+# disable shipping apparmor profiles until they work in ubuntu (#128)
+if distro != 'Ubuntu':
+    if not hasattr(sys, 'real_prefix'):
+        # we're not in a virtualenv, so we can probably write to /etc
+        datafiles += [('/etc/apparmor.d/', [
+            'apparmor/torbrowser.Browser.firefox',
+            'apparmor/torbrowser.Tor.tor',
+            'apparmor/usr.bin.torbrowser-launcher'])]
 
-Tor Browser Launcher will get updated each time a new version of TBB is released. When you open Tor Browser after an update, it will download the newer version of TBB for you and extract it over your old TBB directory in ~/.torproject, so you will maintain your TBB bookmarks. 
+setup(
+    name='torbrowser-launcher',
+    version=version,
+    author='Micah Lee',
+    author_email='micah@micahflee.com',
+    url='https://www.github.com/micahflee/torbrowser-launcher',
+    platforms=['GNU/Linux'],
+    license='MIT',
+    description='A program to help you securely download and run Tor Browser',
+    long_description="""
+Tor Browser Launcher is intended to make Tor Browser easier to install and use for GNU/Linux users. You install torbrowser-launcher from your distribution's package manager and it handles downloading the most recent version of Tor Browser for you, in your language and for your architecture. It also adds a "Tor Browser" application launcher to your operating system's menu. When you first launch Tor Browser Launcher, it will download Tor Browser from https://www.torproject.org/, extract it in your home directory, and execute it. When you run it after that it will just launch Tor Browser.
 """,
+    packages=['torbrowser_launcher'],
+    scripts=['torbrowser-launcher'],
+    data_files=datafiles
+)
 
-      scripts=['torbrowser-launcher'],
-      data_files=[('/usr/share/applications', ['torbrowser.desktop', 'torbrowser-settings.desktop']),
-                  ('/usr/share/pixmaps', ['img/torbrowser32.xpm', 'img/torbrowser80.xpm']),
-                  ('/usr/share/torbrowser-launcher', ['keys/erinn.asc', 'keys/sebastian.asc', 'keys/alexandre.asc', 'keys/mike.asc', 'keys/mike-2013-09.asc', 'torproject.pem', 'mirrors.txt', 'modem.ogg']),
-                  ('/usr/share/torbrowser-launcher/locale/en', ['locale/en/messages.pot']),
-
-                  # unpackaged third party libraries
-                  ('/usr/share/torbrowser-launcher/lib/txsocksx', file_list('lib/txsocksx-0.0.2/txsocksx')),
-                  ('/usr/share/torbrowser-launcher/lib', ['lib/Parsley-1.1/parsley.py']),
-                  ('/usr/share/torbrowser-launcher/lib/ometa', file_list('lib/Parsley-1.1/ometa')),
-                  ('/usr/share/torbrowser-launcher/lib/ometa/_generated', file_list('lib/Parsley-1.1/ometa/_generated')),
-                  ('/usr/share/torbrowser-launcher/lib/ometa/test', file_list('lib/Parsley-1.1/ometa/test')),
-                  ('/usr/share/torbrowser-launcher/lib/terml', file_list('lib/Parsley-1.1/terml')),
-                  ('/usr/share/torbrowser-launcher/lib/terml/_generated', file_list('lib/Parsley-1.1/terml/_generated')),
-                  ('/usr/share/torbrowser-launcher/lib/terml/test', file_list('lib/Parsley-1.1/terml/test'))]
-      )