Skip to content

Commit

Permalink
[badKarma] Added distutils-based setup.py
Browse files Browse the repository at this point in the history
Signed-off-by: Eugenio Paolantonio (g7) <me@medesimo.eu>
  • Loading branch information
g7 committed Sep 13, 2018
1 parent c9e971c commit 8f9c497
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
3 changes: 3 additions & 0 deletions setup.cfg
@@ -0,0 +1,3 @@
[install]
install-lib=/usr/share/badkarma
install-scripts=/usr/share/badkarma
73 changes: 73 additions & 0 deletions setup.py
@@ -0,0 +1,73 @@
#!/usr/bin/env python3
# badKarma - advanced network reconnaissance toolkit
#
# Copyright (C) 2018 <Giuseppe `r3vn` Corti>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File contributed by Eugenio "g7" Paolantonio
#

import os

from distutils.core import setup

def asset_walk(directory, target_prefix):
"""
Walks through the specified directory and returns a distutils-compilant
tuple ready to be appended to data_files.
:param: directory: the directory to scan
:param: target_prefix: the prefix to append to the target directory
:returns: a tuple in the following format: ("%(target_prefix)s/%(directory)s", [files...])
"""

if os.path.isabs(directory):
raise Exception("directory must be a relative path")

return [
(
os.path.join(target_prefix, root),
[
os.path.join(root, file_)
for file_ in files
]
)
for root, directories, files in os.walk(directory)
if files
]

setup(
name="badKarma",
version="0.0.1",
description="advanced network reconnaissance toolkit",
author="Giuseppe Corti",
url="https://github.com/r3vn/badKarma",
scripts=["badkarma.py"],
packages=[
"core",
"extensions",
],
data_files= \
asset_walk("assets", "/usr/share/badkarma") + \
asset_walk("conf", "/usr/share/badkarma") + \
asset_walk("scripts", "/usr/share/badkarma") + \
asset_walk("wordlists", "/usr/share/badkarma"),
requires=[
"libnmap",
"sqlalchemy",
"shodan",
"gi",
]
)

0 comments on commit 8f9c497

Please sign in to comment.