packaging onionshare more proper-like

This commit is contained in:
Micah Lee 2014-05-24 21:16:44 -04:00
parent 8fa3fe3bfb
commit 6791fc48ce
7 changed files with 7 additions and 24 deletions

View File

@ -1,12 +0,0 @@
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "You need to run this as root" 1>&2
exit 1
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export ONIONSHARE_PLATFORM=Tails
$DIR/onionshare $@

1
onionshare/__init__.py Normal file
View File

@ -0,0 +1 @@
from onionshare import *

5
onionshare → onionshare/onionshare.py Executable file → Normal file
View File

@ -1,5 +1,3 @@
#!/usr/bin/env python
import os, sys, subprocess, time, hashlib, platform, json, locale, socket import os, sys, subprocess, time, hashlib, platform, json, locale, socket
from random import randint from random import randint
from functools import wraps from functools import wraps
@ -139,6 +137,3 @@ def main():
# shutdown # shutdown
tails_close_port(port) tails_close_port(port)
if __name__ == '__main__':
main()

View File

@ -4,13 +4,11 @@
import os import os
import sys import sys
try: try:
from setuptools import setup from setuptools import setup
except ImportError: except ImportError:
from distutils.core import setup from distutils.core import setup
if sys.argv[-1] == 'publish': if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload') os.system('python setup.py sdist upload')
sys.exit() sys.exit()
@ -23,24 +21,25 @@ setup(
author='Micah Lee', author='Micah Lee',
author_email='micah@micahflee.com', author_email='micah@micahflee.com',
url='https://github.com/micahflee/onionshare', url='https://github.com/micahflee/onionshare',
py_modules = ['onionshare'],
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[
'flask >= 0.10.1', 'flask >= 0.10.1',
'stem >= 1.1.1' 'stem >= 1.1.1'
], ],
license="GPL v3", license="GPL v3",
zip_safe=False,
keywords='onion, share, onionshare, tor, anonymous, web server', keywords='onion, share, onionshare, tor, anonymous, web server',
classifiers=[ classifiers=[
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: GPL License', 'License :: OSI Approved :: GPL License',
'Natural Language :: English',
'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
], ],
test_suite='tests', packages=['onionshare'],
entry_points={'console_scripts': ['onionshare = onionshare:main']} scripts=['bin/onionshare', 'bin/tails-onionshare']
) )