pentoo-overlay/app-forensics/pdf-parser/pdf-parser-0.7.3.ebuild
2019-10-03 12:09:10 +03:00

45 lines
1.1 KiB
Bash

# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
inherit python-r1 unpacker
DESCRIPTION="This tool will parse a PDF document to identify the fundamental elements used"
HOMEPAGE="https://blog.didierstevens.com/programs/pdf-tools/"
MY_P="${PN}_V$(ver_rs 1- '_')"
SRC_URI="http://www.didierstevens.com/files/software/${MY_P}.zip"
LICENSE="public-domain"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="unicode yara"
DEPEND="${PYTHON_DEPS}
$(unpacker_src_uri_depends)"
RDEPEND="${DEPEND}
yara? ( dev-python/yara-python[${PYTHON_USEDEP}] )"
S="${WORKDIR}"
src_prepare() {
# Enable check maximum version of the python3
sed -e 's/TestPythonVersion(enforceMaximumVersion=True)/# REM/' \
-i pdf-parser.py || die
# Fix encoding errors when reading files
use unicode && eapply "${FILESDIR}/${PV}_define_encoding_format.patch"
default
}
src_install() {
python_foreach_impl python_newscript pdf-parser.py pdf-parser
}
pkg_postinst() {
elog "\nSee more: https://blog.didierstevens.com/2008/04/09/quickpost-about-the-physical-and-logical-structure-of-pdf-files/\n"
}