pentoo-overlay/app-exploits/empire/empire-2.5.ebuild
2019-06-03 21:23:41 +08:00

84 lines
2.3 KiB
Bash

# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 )
EGO_PN=github.com/EmpireProject/Empire
inherit python-single-r1
if [[ ${PV} = *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/EmpireProject/Empire.git"
KEYWORDS=""
else
KEYWORDS="~amd64 ~x86"
EGIT_COMMIT="${PV}"
SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
fi
DESCRIPTION="A post-exploitation framework with Windows/Linux agents"
HOMEPAGE="https://github.com/EmpireProject/Empire"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="powershell java"
RDEPEND="dev-lang/swig
dev-python/xlrd[${PYTHON_USEDEP}]
dev-python/xlwt[${PYTHON_USEDEP}]
>=dev-python/urllib3-1.21.1[${PYTHON_USEDEP}]
>=dev-python/requests-2.18.4[${PYTHON_USEDEP}]
dev-python/python-iptools[${PYTHON_USEDEP}]
dev-python/pydispatcher[${PYTHON_USEDEP}]
dev-python/flask[${PYTHON_USEDEP}]
dev-python/macholib[${PYTHON_USEDEP}]
dev-python/dropbox-sdk[${PYTHON_USEDEP}]
>=dev-python/pyopenssl-17.2.0[${PYTHON_USEDEP}]
dev-python/pyinstaller[${PYTHON_USEDEP}]
dev-python/zlib_wrapper[${PYTHON_USEDEP}]
dev-python/netifaces[${PYTHON_USEDEP}]
dev-python/m2crypto[${PYTHON_USEDEP}]
dev-python/jinja[${PYTHON_USEDEP}]
dev-python/cryptography[${PYTHON_USEDEP}]
>=dev-python/pyminifier-2.1[${PYTHON_USEDEP}]
dev-python/xlutils[${PYTHON_USEDEP}]
dev-python/pycryptodome[${PYTHON_USEDEP}]
dev-python/pefile[${PYTHON_USEDEP}]
powershell? ( amd64? ( dev-lang/powershell-bin ) )
java? ( virtual/jre:* )"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]"
S="${WORKDIR}/Empire-${PV}"
src_prepare() {
sed -i "s|STAGING_KEY, INSTALL_PATH|STAGING_KEY, \"/usr/$(get_libdir)/${PN}/\"|" ./setup/setup_database.py
echo | python2 ./setup/setup_database.py
python_fix_shebang ./empire
default
}
src_install() {
# should be as simple as copying everything into the target...
dodir /usr/$(get_libdir)/${PN}
cp -R "${S}"/* "${D}"/usr/$(get_libdir)/${PN} || die "Copy files failed"
# dosym "${EPREFIX}"/usr/$(get_libdir)/${PN}/${PN}.py /usr/bin/${PN}
newbin - empire <<-EOF
#!/bin/sh
cd /usr/lib/empire
./empire \${@}
EOF
}
pkg_postinst() {
elog "Warning. This software does not support system-wide installation"
elog "You need to run it from /usr/lib/empire directory under 'root' account"
}