From 78575204de9e17fd798bad641a3ec611103972cb Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 30 Apr 2024 19:17:13 +0200 Subject: [PATCH] Initial import of the radare2 pip package --- dist/pip/Makefile | 9 +++++++++ dist/pip/README.md | 9 +++++++++ dist/pip/radare2/main.py | 2 ++ dist/pip/setup.py | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 dist/pip/Makefile create mode 100644 dist/pip/README.md create mode 100644 dist/pip/radare2/main.py create mode 100644 dist/pip/setup.py diff --git a/dist/pip/Makefile b/dist/pip/Makefile new file mode 100644 index 0000000000..cce58873c3 --- /dev/null +++ b/dist/pip/Makefile @@ -0,0 +1,9 @@ +PYTHON?=python3 + +all: + $(PYTHON) setup.py build + +pub: + $(PYTHON) setup.py build sdist + twine check dist/* + twine upload -u __token__ --repository-url https://upload.pypi.org/legacy/ --verbose dist/* diff --git a/dist/pip/README.md b/dist/pip/README.md new file mode 100644 index 0000000000..8fc34355b8 --- /dev/null +++ b/dist/pip/README.md @@ -0,0 +1,9 @@ +# radare2 for pip + +This package is boilerplate to install r2pipe and r2env. + +You must then run r2env to select the version of radare2 you want. + +[radare2](https://www.radare.org) + +--pancake diff --git a/dist/pip/radare2/main.py b/dist/pip/radare2/main.py new file mode 100644 index 0000000000..7d02204977 --- /dev/null +++ b/dist/pip/radare2/main.py @@ -0,0 +1,2 @@ +def main(): + print("Use: r2env install radare2") diff --git a/dist/pip/setup.py b/dist/pip/setup.py new file mode 100644 index 0000000000..94f28d27a8 --- /dev/null +++ b/dist/pip/setup.py @@ -0,0 +1,33 @@ +from setuptools import setup +import os + +def popen(x): + res = os.popen(x).read() + return res.strip() # decode("utf-8").strip() + +with open("README.md") as fd: + readme = fd.read() +r2_version = popen("../../configure -qV") + +setup( + name='radare2', + version=r2_version, + description="The UNIX friendly reverse engineering framework and toolchain", + long_description=readme, + long_description_content_type="text/markdown", + author="pancake", + author_email="pancake@nopcode.org", + url="https://www.radare.org/", + packages=[ + 'radare2', + ], + install_requires=[ + 'r2pipe', + 'r2env' + ], + entry_points = { + 'console_scripts': [ + 'r2 = radare2.main:main' + ] + }, +)