enhance packaging

This commit is contained in:
ziirish 2015-09-30 20:08:04 +02:00
parent c577763292
commit c694f3ab68
7 changed files with 16 additions and 11 deletions

View file

@ -1,6 +1,6 @@
include LICENSE
include README.rst
include VERSION
include burpui/VERSION
include requirements.txt
include test-requirements.txt
include share/burpui/etc/burpui.sample.cfg

View file

@ -1 +0,0 @@
0.1.0-dev

1
VERSION Symbolic link
View file

@ -0,0 +1 @@
burpui/VERSION

1
burpui/VERSION Normal file
View file

@ -0,0 +1 @@
0.1.0-dev

View file

@ -25,7 +25,7 @@ __author_email__ = 'ziirish+burpui@ziirish.info'
__url__ = 'https://git.ziirish.me/ziirish/burp-ui'
__description__ = 'Burp-UI is a web-ui for burp backup written in python with Flask and jQuery/Bootstrap'
__license__ = 'BSD 3-clause'
__version__ = '0.1.0-dev'
__version__ = open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'VERSION')).read().rstrip()
# First, we setup the app
app = Flask(__name__)

View file

@ -26,7 +26,7 @@ from select import select
from burpui.misc.utils import human_readable as _hr
from burpui.misc.backend.interface import BUIserverException
from burpui.misc.backend.burp1 import Burp as Burp1
from burpui.misc.parser.burp1 import Parser
from burpui.misc.parser.burp2 import Parser
if sys.version_info < (3, 3):
TimeoutError = OSError
@ -126,7 +126,7 @@ class Burp(Burp1):
# check the burp version because this backend only supports clients newer than BURP_MINIMAL_VERSION
try:
cmd = [self.burpbin, '-v']
version = subprocess.check_output(cmd, universal_newlines=True).rstrip('\n')
version = subprocess.check_output(cmd, universal_newlines=True).rstrip()
if version < BURP_MINIMAL_VERSION:
raise Exception('Your burp version ({}) does not fit the minimal requirements: {}'.format(version, BURP_MINIMAL_VERSION))
except subprocess.CalledProcessError as e:

View file

@ -11,6 +11,7 @@ from burpui.misc.parser.interface import BUIparser
class Parser(BUIparser, BUIlogging):
pver = 1
defaults = {
u'address': u'', # IP
u'atime': False, # bool

View file

@ -15,15 +15,16 @@ def readme():
"""
desc = ''
cpt = 0
skip = False
with open('README.rst') as f:
for l in f.readlines():
if l.rstrip() == 'Screenshots':
cpt += 1
elif cpt > 0:
skip = True
if skip:
cpt += 1
if cpt > 7:
cpt = 0
if cpt > 0:
skip = False
if skip:
continue
desc += l
return desc
@ -36,6 +37,7 @@ with open(os.path.join(os.path.dirname(__file__), 'burpui', '__init__.py')) as f
author_email = re.search("__author_email__ *= *'(.*)'", data).group(1)
description = re.search("__description__ *= *'(.*)'", data).group(1)
url = re.search("__url__ *= *'(.*)'", data).group(1)
version = re.search("__version__ *= *'(.*)'", data).group(1)
with open('requirements.txt', 'r') as f:
requires = [x.strip() for x in f if x.strip()]
@ -48,7 +50,7 @@ contrib = os.path.join('share', 'burpui', 'contrib')
setup(
name=name,
version=open('VERSION').read().rstrip(),
version=version,
description=description,
long_description=readme(),
license=open('LICENSE').read(),
@ -60,7 +62,8 @@ setup(
include_package_data=True,
package_data={
'static': 'burpui/static/*',
'templates': 'burpui/templates/*'
'templates': 'burpui/templates/*',
'VERSION': 'burpui/VERSION'
},
scripts=['bin/burp-ui', 'bin/bui-agent'],
data_files=[