3 https://github.com/micahflee/torbrowser-launcher/
5 Copyright (c) 2013-2017 Micah Lee <micah@micahflee.com>
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
16 The above copyright notice and this permission notice shall be
17 included in all copies or substantial portions of the Software.
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.
33 from distutils.core import setup
37 # detect linux distribution
38 distro = platform.dist()[0]
43 for filename in os.listdir(path):
44 if os.path.isfile(path+'/'+filename):
45 files.append(path+'/'+filename)
49 def create_mo_files():
51 if not os.path.exists(po_dir):
53 domain = 'torbrowser-launcher'
56 for f in next(os.walk(po_dir))[2]
57 if os.path.splitext(f)[1] == '.po']
58 for po_file in po_files:
59 filename, extension = os.path.splitext(po_file)
60 mo_file = domain + '.mo'
61 mo_dir = 'share/locale/' + filename + '/LC_MESSAGES/'
62 subprocess.call('mkdir -p ' + mo_dir, shell=True)
63 msgfmt_cmd = 'msgfmt {} -o {}'.format(po_dir + po_file, mo_dir + mo_file)
64 subprocess.call(msgfmt_cmd, shell=True)
65 mo_files.append(mo_dir + mo_file)
69 with open(os.path.join(SHARE, 'torbrowser-launcher/version')) as buf:
70 version = buf.read().strip()
73 for root, dirs, files in os.walk(SHARE):
75 datafiles.append((root, [os.path.join(root, f) for f in files]))
77 # disable shipping apparmor profiles until they work in ubuntu (#128)
78 if distro != 'Ubuntu':
79 if not hasattr(sys, 'real_prefix'):
80 # we're not in a virtualenv, so we can probably write to /etc
82 ('/etc/apparmor.d/', [
83 'apparmor/torbrowser.Browser.firefox',
84 'apparmor/torbrowser.Tor.tor']),
85 ('/etc/apparmor.d/local/', [
86 'apparmor/local/torbrowser.Browser.firefox',
87 'apparmor/local/torbrowser.Tor.tor']),
88 ('/etc/apparmor.d/tunables/', ['apparmor/tunables/torbrowser'])
91 datafiles += [(os.path.dirname(f), [f]) for f in create_mo_files()]
94 name='torbrowser-launcher',
97 author_email='micah@micahflee.com',
98 url='https://www.github.com/micahflee/torbrowser-launcher',
99 platforms=['GNU/Linux'],
101 description='A program to help you securely download and run Tor Browser',
103 Tor Browser Launcher is intended to make Tor Browser easier to install and use
104 for GNU/Linux users. You install torbrowser-launcher from your distribution's
105 package manager and it handles securely downloading the most recent version of
106 Tor Browser for you, in your language and for your architecture. It also adds a
107 "Tor Browser" application launcher to your operating system's menu. When you
108 first launch Tor Browser Launcher, it will download Tor Browser from
109 https://www.torproject.org/, verify the PGP signature, extract it in your home
110 directory, and launch it. When you run it after that it will just launch Tor
113 packages=['torbrowser_launcher'],
114 scripts=['torbrowser-launcher'],