summaryrefslogtreecommitdiff
path: root/app-misc/binwalk
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-misc/binwalk
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-misc/binwalk')
-rw-r--r--app-misc/binwalk/Manifest5
-rw-r--r--app-misc/binwalk/binwalk-2.1.1.ebuild41
-rw-r--r--app-misc/binwalk/binwalk-9999.ebuild39
-rw-r--r--app-misc/binwalk/files/0001-Added-check-for-backports.lzma-when-importing-lzma-m.patch67
-rw-r--r--app-misc/binwalk/metadata.xml25
5 files changed, 177 insertions, 0 deletions
diff --git a/app-misc/binwalk/Manifest b/app-misc/binwalk/Manifest
new file mode 100644
index 000000000000..3c783d753a71
--- /dev/null
+++ b/app-misc/binwalk/Manifest
@@ -0,0 +1,5 @@
+AUX 0001-Added-check-for-backports.lzma-when-importing-lzma-m.patch 2295 BLAKE2B 42ceab5a3b276d9bb0206fc71a4d95e93a1ea8b93e623c7bdac3f846d957586b7522bc6b4a36d24ef182a8fc8623665b17abe0a8ebd529f12d55dd34b200786f SHA512 ad0a89521948ea381fef71c53f2a85e692ac46666fd93a18955f568fca583f5b5685a024152cd774a33df30e9b965513a57139d43db8357836e145d22710c006
+DIST binwalk-2.1.1.tar.gz 263977 BLAKE2B 8fd5f20dcdb22a6528131fbebc1454cc496079bfeafa63ddb0679c7c7b5d5c29d81dccd4f52e8f6f7d8881d9e672d691c2b2ef367f2bf3180ffbb4ad22dca021 SHA512 373e276a4d6ec845952f1091f85f953d3b0d52d561d9b74a54000ebdef85d13cafc997a4f8f76f25842db8b76fdcd1e602d4d81792a3ea01c9dea6c6ed5c2168
+EBUILD binwalk-2.1.1.ebuild 1110 BLAKE2B 91138bcad83793cbafed2da690706491f2e4481e35b740123da388b48502a678eefe3d85113ee9500ab85d6dec5639d3efd3153216af78d0dcfcfbe78579aac4 SHA512 77585899a0f0cb775376ea767f4b5f1ae8f6bacebc6d2df7ec4b6a4eb3a293ba3817a6c63be6e3714f386ddec685c921255f806058954f00e0cf56bb15a76f4a
+EBUILD binwalk-9999.ebuild 1021 BLAKE2B 2b1209d4211d85d9e2b7250234777b81c308a4551f21a2caa91c0dc325ea64034b7e670fcc9f836b3308d83c798a5f3b58b4c260e08b89fd6f78a8470364ecc2 SHA512 ec0c1b3954b6ec60982266666e3a64e989a1cd87f58451df7f2622cd8116b36fb66831bea034eca6dcdba6bba7ae5dada6fe86733150da62d79cc9c72d1acc57
+MISC metadata.xml 1043 BLAKE2B 3c31b5153464d9c439fdcab70b47aeccce5d0a8ec4acb57bf519830b80915bfe3e38dc0d995fc875f5b217bb354bc250043684188a2fc7988948039761204c2e SHA512 4f8c75bff33aee8f04748e52a6c13a866c08b1e0a9e4ff47fa5ccbf2a4e203e1324c6571edc57ce7713a1fc18af3f6d68645a725df84530aab03cf6f87dda5bc
diff --git a/app-misc/binwalk/binwalk-2.1.1.ebuild b/app-misc/binwalk/binwalk-2.1.1.ebuild
new file mode 100644
index 000000000000..fd5e23c75834
--- /dev/null
+++ b/app-misc/binwalk/binwalk-2.1.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit distutils-r1
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/devttys0/binwalk.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/devttys0/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="amd64 x86 ~x64-macos"
+fi
+
+DESCRIPTION="A tool for identifying files embedded inside firmware images"
+HOMEPAGE="https://github.com/devttys0/binwalk"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="graph"
+
+RDEPEND="
+ $(python_gen_cond_dep 'dev-python/backports-lzma[${PYTHON_USEDEP}]' python2_7)
+ graph? ( dev-python/pyqtgraph[opengl,${PYTHON_USEDEP}] )
+"
+
+PATCHES=( "${FILESDIR}"/0001-Added-check-for-backports.lzma-when-importing-lzma-m.patch )
+
+python_install_all() {
+ local DOCS=( API.md INSTALL.md README.md )
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "binwalk has many optional dependencies to automatically"
+ elog "extract/decompress data, see INSTALL.md for more details."
+ fi
+}
diff --git a/app-misc/binwalk/binwalk-9999.ebuild b/app-misc/binwalk/binwalk-9999.ebuild
new file mode 100644
index 000000000000..4e8eaf67d0ef
--- /dev/null
+++ b/app-misc/binwalk/binwalk-9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit distutils-r1
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/devttys0/binwalk.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/devttys0/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86 ~x64-macos"
+fi
+
+DESCRIPTION="A tool for identifying files embedded inside firmware images"
+HOMEPAGE="https://github.com/devttys0/binwalk"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="graph"
+
+RDEPEND="
+ $(python_gen_cond_dep 'dev-python/backports-lzma[${PYTHON_USEDEP}]' python2_7)
+ graph? ( dev-python/pyqtgraph[opengl,${PYTHON_USEDEP}] )
+"
+
+python_install_all() {
+ local DOCS=( API.md INSTALL.md README.md )
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "binwalk has many optional dependencies to automatically"
+ elog "extract/decompress data, see INSTALL.md for more details."
+ fi
+}
diff --git a/app-misc/binwalk/files/0001-Added-check-for-backports.lzma-when-importing-lzma-m.patch b/app-misc/binwalk/files/0001-Added-check-for-backports.lzma-when-importing-lzma-m.patch
new file mode 100644
index 000000000000..708498060bc7
--- /dev/null
+++ b/app-misc/binwalk/files/0001-Added-check-for-backports.lzma-when-importing-lzma-m.patch
@@ -0,0 +1,67 @@
+From 95bce4edcc6e92c9517b80ccb1fb956f591e0738 Mon Sep 17 00:00:00 2001
+From: Craig Heffner <heffnercj@gmail.com>
+Date: Tue, 5 Jan 2016 13:28:24 -0500
+Subject: [PATCH] Added check for backports.lzma when importing lzma module
+
+---
+ src/binwalk/modules/compression.py | 5 ++++-
+ src/binwalk/plugins/lzmaextract.py | 6 +++++-
+ src/binwalk/plugins/lzmavalid.py | 5 ++++-
+ 3 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/binwalk/modules/compression.py b/src/binwalk/modules/compression.py
+index 97ca68d..e919f7e 100644
+--- a/src/binwalk/modules/compression.py
++++ b/src/binwalk/modules/compression.py
+@@ -2,11 +2,14 @@
+
+ import os
+ import zlib
+-import lzma
+ import struct
+ import binwalk.core.compat
+ import binwalk.core.common
+ from binwalk.core.module import Option, Kwarg, Module
++try:
++ import lzma
++except ImportError:
++ from backports import lzma
+
+ class LZMAHeader(object):
+ def __init__(self, **kwargs):
+diff --git a/src/binwalk/plugins/lzmaextract.py b/src/binwalk/plugins/lzmaextract.py
+index 137b4cc..93f6240 100755
+--- a/src/binwalk/plugins/lzmaextract.py
++++ b/src/binwalk/plugins/lzmaextract.py
+@@ -12,7 +12,11 @@ class LZMAExtractPlugin(binwalk.core.plugin.Plugin):
+ # lzma package in Python 2.0 decompress() does not handle multiple
+ # compressed streams, only first stream is extracted.
+ # backports.lzma package could be used to keep consistent behaviour.
+- import lzma
++ try:
++ import lzma
++ except ImportError:
++ from backports import lzma
++
+ self.decompressor = lzma.decompress
+
+ # If the extractor is enabled for the module we're currently loaded
+diff --git a/src/binwalk/plugins/lzmavalid.py b/src/binwalk/plugins/lzmavalid.py
+index a343656..62e15b9 100644
+--- a/src/binwalk/plugins/lzmavalid.py
++++ b/src/binwalk/plugins/lzmavalid.py
+@@ -17,7 +17,10 @@ class LZMAPlugin(binwalk.core.plugin.Plugin):
+
+ def init(self):
+ try:
+- import lzma
++ try:
++ import lzma
++ except ImportError:
++ from backports import lzma
+ self.decompressor = lzma.decompress
+ except ImportError as e:
+ self.decompressor = None
+--
+2.12.2
+
diff --git a/app-misc/binwalk/metadata.xml b/app-misc/binwalk/metadata.xml
new file mode 100644
index 000000000000..9cd3f7b9f5c1
--- /dev/null
+++ b/app-misc/binwalk/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+ <longdescription lang="en">
+ Binwalk is a tool for searching a given binary image for embedded files.
+ Specifically, it is designed for identifying files embedded inside of firmware
+ images. Binwalk uses the libmagic library, so it is compatible with magic
+ signatures created for the Unix file utility.
+ Binwalk also includes a custom magic signature file which contains improved
+ signatures for files that are commonly found in firmware images such as
+ compressed/archived files, firmware headers, Linux kernels, bootloaders,
+ filesystems, etc.
+ </longdescription>
+ <upstream>
+ <remote-id type="google-code">binwalk</remote-id>
+ <remote-id type="github">devttys0/binwalk</remote-id>
+ </upstream>
+ <use>
+ <flag name="graph">Enable support for generating entropy graphs</flag>
+ </use>
+</pkgmetadata>