pentoo-overlay/app-exploits/routersploit/routersploit-9999.ebuild

86 lines
2.7 KiB
Bash

# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 ) ## 3.x seems in the works.
inherit python-single-r1
# distutils-r1
if [[ ${PV} == "9999" ]] ; then
MY_P=${P}
EGIT_REPO_URI="git://github.com/reverse-shell/routersploit.git"
inherit git-r3
else
MY_P=${PN}-${PV/_/-}
SRC_URI="https://github.com/reverse-shell/routersploit/archive/v${PV}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
fi
DESCRIPTION="An open-source exploitation framework dedicated to embedded devices"
HOMEPAGE="https://github.com/reverse-shell/routersploit/wiki"
LICENSE="BSD"
SLOT="0"
KEYWORDS=""
IUSE="-doc -desktopicons"
DEPEND="dev-python/beautifulsoup
dev-python/requests
dev-python/pysnmp
dev-python/pexpect
dev-python/paramiko
dev-python/future"
RDEPEND="${DEPEND}"
#TESTDEPEND="virtual/python-mock
# dev-python/flake8
# app-emulation/docker"
S=${WORKDIR}/routersploit-${PV}/routersploit
#ewarn " live version may at time break or not recevies pulls frequently may work may bork, the stale version tends too."
src_prepare() {
### clean up makefile and friends apear to be nothing but docker linting Q/A testing & invoking pretty q/a SUITE test wizbangs.
## taking out the trash.... @ /dev/null
rm -f {Makefile,*.sh,Dockerfile,.travis.yml, .git* ,req*.txt}
rm -r {./.git*,} ## drop git dir trash.. so as to not cp into install dirs.
eapply_user
}
src_install() {
# mkdir -m 0755 -p /opt/routersploit
# chuck/cp in /opt/routersploit/rsy.py & /opt/routersploit/routersploit submodules...
# chmod +X +R fixperms recursively..
## add docs if user give 2 rats to read them , have a nice day...
mkdir -p "${S}"/opt/${PN}
insinto "${S}"/opt/${PN}
doins -r "${S}"/opt/${PN}
# dobin /opt/${PN}/rsf.py
dosym /opt/${PN}/rsf.py /usr/bin/rsf
chown -R root:root "${S}/opt/${PN}"
# fperms -R +x +r {*.py,*.pyc} "${S}"/opt/"${PN}"
if use doc; then
einstalldocs /usr/share/doc/${PN}/
dodoc -r /{README.md,LICENSE}
fi
}
desktop_install() {
if use desktopicons; then
dodir /usr/share/icons/${PN}/
cp ${FILES}/{routersploit.png,routersploit.svg} /usr/share/icons/${PN}/
dodir /usr/share/applications/${PN}/
cp ${FILES}*.desktop /usr/share/applications/${PN}/
fixperms +r +x /usr/share/applications/${PN}/*.desktop
fi
}
pkg_postinst(){
elog "routersploit-${PV} has installed enjoy.. "
einfo "more info @ WIKI https://github.com/reverse-shell/routersploit/wiki"
einfo "video demo also on wiki made with asciinema showing some of the basic features."
einfo "for more than your Home or Small biz routers I'd see the wiki, CLI takes some getting aqaunted with"
}