spiderfoot-3.3.ebuild

This commit is contained in:
Anton Bolshakov 2021-06-10 09:01:21 +08:00
parent d12e1d45bc
commit 97949164ba
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
6 changed files with 162 additions and 2 deletions

View file

@ -1 +1,2 @@
DIST spiderfoot-3.0.tar.gz 3478605 BLAKE2B dbf6e058f01e768dfef85ddcb059ce5c5e5070adf96dbecdf40ef5e6bbbc99e0f25820ee67d68f59aa55d35d867c8648d70b99981840f07f36ed76db58f284b6 SHA512 abf64b6b819f8535f87237649be677af27aaddc729897eff8d4c27bd441e32862a42f8b84cf61ad3a0b9e1fc940fddf9d2e47d7decfcb62812239c5a9e01850a
DIST spiderfoot-3.3.tar.gz 3324791 BLAKE2B 3f72a8f9de6501d9f030ba8c907c33ba3d7da7704a81fdd141c4e12f4a9e20a7c774966cb3f2202890bb15f69fd882ecaadce2b4930fdf64d420730dacde9350 SHA512 5e888d263ec46466d501dc3b383d5b5bb29b4271556a14f40bedcda3eda910e1e100b00d440b0b5c2e744507273629ce0b18e56d4ca4f45d194d6924ce25794c

View file

@ -0,0 +1,40 @@
diff -ur spiderfoot-3.3.orig/sflib.py spiderfoot-3.3/sflib.py
--- spiderfoot-3.3.orig/sflib.py 2021-01-25 04:38:26.000000000 +0800
+++ spiderfoot-3.3/sflib.py 2021-06-10 08:50:48.549810080 +0800
@@ -573,7 +573,7 @@
str: SpiderFoot cache file system path
"""
- path = self.myPath() + '/cache'
+ path = str(os.path.expanduser('~') + '/cache'
if not os.path.isdir(path):
os.mkdir(path)
return path
diff -ur spiderfoot-3.3.orig/spiderfoot/db.py spiderfoot-3.3/spiderfoot/db.py
--- spiderfoot-3.3.orig/spiderfoot/db.py 2021-01-25 04:38:26.000000000 +0800
+++ spiderfoot-3.3/spiderfoot/db.py 2021-06-10 08:50:00.226812752 +0800
@@ -13,6 +13,7 @@
import re
import sqlite3
import threading
+import os
import time
@@ -267,11 +268,15 @@
database_path = opts['__database']
+ DBPATH = str(os.path.expanduser('~') + '/.spiderfoot')
+ if not os.path.exists(DBPATH):
+ os.makedirs(os.path.join(DBPATH))
+
# connect() will create the database file if it doesn't exist, but
# at least we can use this opportunity to ensure we have permissions to
# read and write to such a file.
try:
- dbh = sqlite3.connect(database_path)
+ dbh = sqlite3.connect(DBPATH + "/" + database_path)
except Exception as e:
raise IOError(f"Error connecting to internal database {database_path}: {e}")

View file

@ -1,4 +1,4 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -16,7 +16,7 @@ if [[ ${PV} == *9999 ]]; then
EGIT_REPO_URI="https://github.com/smicallef/spiderfoot"
else
SRC_URI="https://github.com/smicallef/spiderfoot/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm64"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="GPL-2"

View file

@ -0,0 +1,97 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{7..9} )
PYTHON_REQ_USE="sqlite,ssl,readline"
inherit eutils python-single-r1
DESCRIPTION="The most complete OSINT collection and reconnaissance tool"
HOMEPAGE="https://www.spiderfoot.net"
if [[ ${PV} == *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/smicallef/spiderfoot"
else
SRC_URI="https://github.com/smicallef/spiderfoot/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="GPL-2"
SLOT="0"
DEPEND="${PYTHON_DEPS}"
RDEPEND="${DEPEND}
acct-group/spiderfoot
acct-user/spiderfoot
$(python_gen_cond_dep '
>=dev-python/adblockparser-0.7[${PYTHON_MULTI_USEDEP}]
>=dev-python/dnspython-1.16.0[${PYTHON_MULTI_USEDEP}]
>=dev-python/exifread-2.1.2[${PYTHON_MULTI_USEDEP}]
>=dev-python/cherrypy-18.0[${PYTHON_MULTI_USEDEP}]
dev-python/mako[${PYTHON_MULTI_USEDEP}]
dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
dev-python/lxml[${PYTHON_MULTI_USEDEP}]
>=dev-python/netaddr-0.7.18[${PYTHON_MULTI_USEDEP}]
>=dev-python/PySocks-1.7.1[${PYTHON_MULTI_USEDEP}]
dev-python/requests[${PYTHON_MULTI_USEDEP}]
~dev-python/ipwhois-1.0.0[${PYTHON_MULTI_USEDEP}]
>=dev-python/ipaddr-2.2.0[${PYTHON_MULTI_USEDEP}]
dev-python/phonenumbers[${PYTHON_MULTI_USEDEP}]
dev-python/pygexf[${PYTHON_MULTI_USEDEP}]
dev-python/PyPDF2[${PYTHON_MULTI_USEDEP}]
>=net-libs/stem-1.7.1[${PYTHON_MULTI_USEDEP}]
dev-python/python-whois[${PYTHON_MULTI_USEDEP}]
dev-python/python-secure[${PYTHON_MULTI_USEDEP}]
dev-python/pyopenssl[${PYTHON_MULTI_USEDEP}]
dev-python/python-docx[${PYTHON_MULTI_USEDEP}]
dev-python/python-pptx[${PYTHON_MULTI_USEDEP}]
dev-python/networkx[${PYTHON_MULTI_USEDEP}]
dev-python/cryptography[${PYTHON_MULTI_USEDEP}]
dev-python/publicsuffixlist[${PYTHON_MULTI_USEDEP}]
')"
#https://github.com/smicallef/spiderfoot/issues/1176
PATCHES=(
# "${FILESDIR}/${PN}-3.0_fix_module_bug_sfp_hackertarget.patch"
"${FILESDIR}/${P}_add_support_user_homedir.patch"
)
src_prepare() {
default
python_fix_shebang "${S}"
}
src_install() {
insinto /usr/share/${PN}
doins -r dicts/ dyn/ modules/ static/ *.py
for x in sf sfcli; do
make_wrapper $x \
"${EPYTHON} /usr/share/${PN}/${x}.py" \
"/usr/share/${PN}/"
done
dosym ./sf /usr/bin/${PN}
dosym ./sfcli /usr/bin/${PN}-cli
keepdir /var/lib/${PN}
fowners ${PN}:${PN} /var/lib/${PN}
newinitd "${FILESDIR}"/spiderfoot-daemon.initd-r1 spiderfoot-daemon
newconfd "${FILESDIR}"/spiderfoot-daemon.confd-r1 spiderfoot-daemon
dodoc *.md Dockerfile
python_optimize "${D}"/usr/share/${PN}
}
pkg_postinst() {
elog "\nJust run:"
elog " ~# rc-service spiderfoot-daemon start"
elog "and open in browser http://127.0.0.1:5001\n"
elog "See documentation: https://www.spiderfoot.net/documentation/\n"
}

View file

@ -0,0 +1 @@
DIST publicsuffixlist-0.7.8.tar.gz 91819 BLAKE2B bf125c90545ef69388b7bfa4947b0840b88ebaed0bba24d8bb012884d5494fec370d30d18113a43f4e1fac928b44f2058fe0b6a57e6a24d61b6bd4650e83d3b9 SHA512 1cf1e855cd1b8320f95995560e8d286f272d1d458f0bde7703245e088736a526f3044aba77d77c54f784bfae852770b9b0b5c19e27aeab6bc3dae24996f3adea

View file

@ -0,0 +1,21 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{7..9} )
inherit distutils-r1
DESCRIPTION="publicsuffixlist implement"
HOMEPAGE="https://github.com/ko-zu/psl"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="MPL-2.0"
SLOT="0"
KEYWORDS="amd64 arm64 x86"
IUSE="test"
RDEPEND=""
DEPEND="${RDEPEND}"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"