]> git.lizzy.rs Git - torbrowser-launcher.git/blob - setup.py
use platform.dist() to detect ubuntu instead of subprocessing out to lsb_release
[torbrowser-launcher.git] / setup.py
1 """
2 Tor Browser Launcher
3 https://github.com/micahflee/torbrowser-launcher/
4
5 Copyright (c) 2013-2014 Micah Lee <micah@micahflee.com>
6
7 Permission is hereby granted, free of charge, to any person
8 obtaining a copy of this software and associated documentation
9 files (the "Software"), to deal in the Software without
10 restriction, including without limitation the rights to use,
11 copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the
13 Software is furnished to do so, subject to the following
14 conditions:
15
16 The above copyright notice and this permission notice shall be
17 included in all copies or substantial portions of the Software.
18
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 OTHER DEALINGS IN THE SOFTWARE.
27 """
28
29 from distutils.core import setup
30 import os, sys, platform
31 SHARE = 'share'
32
33 # detect linux distribution
34 distro = platform.dist()[0]
35
36 def file_list(path):
37     files = []
38     for filename in os.listdir(path):
39         if os.path.isfile(path+'/'+filename):
40             files.append(path+'/'+filename)
41     return files
42
43 with open(os.path.join(SHARE, 'torbrowser-launcher/version')) as buf:
44     version = buf.read().strip()
45
46 datafiles = []
47 for root, dirs, files in os.walk(SHARE):
48     datafiles.append((os.path.join(sys.prefix, root),
49                       [os.path.join(root, f) for f in files]))
50
51 # disable shipping apparmor profiles until they work in ubuntu (#128)
52 if distro != 'Ubuntu':
53     if not hasattr(sys, 'real_prefix'):
54         # we're not in a virtualenv, so we can probably write to /etc
55         datafiles += [('/etc/apparmor.d/', [
56             'apparmor/torbrowser.Browser.firefox',
57             'apparmor/torbrowser.start-tor-browser',
58             'apparmor/torbrowser.Tor.tor',
59             'apparmor/usr.bin.torbrowser-launcher'])]
60
61 setup(
62     name='torbrowser-launcher',
63     version=version,
64     author='Micah Lee',
65     author_email='micah@micahflee.com',
66     url='https://www.github.com/micahflee/torbrowser-launcher',
67     platforms=['GNU/Linux'],
68     license='MIT',
69     description='A program to help you download, keep updated, and run the Tor Browser Bundle',
70     long_description="""
71 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.
72
73 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.
74
75 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.
76 """,
77     packages=['torbrowser_launcher'],
78     scripts=['torbrowser-launcher'],
79     data_files=datafiles
80 )
81