added libpcap-dev installation insted of libcap-dev

This commit is contained in:
navjot 2021-02-08 23:44:48 +05:30
parent a863b41863
commit b1d07214ac
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C
3 changed files with 30 additions and 6 deletions

View File

@ -5,7 +5,7 @@ addons:
apt: apt:
packages: packages:
- build-essential - build-essential
- libcap-dev - libpcap-dev
- python-qt4 - python-qt4
- tor - tor
- xvfb - xvfb

View File

@ -10,6 +10,7 @@ Limitations:
EXTRAS_REQUIRE. This is fine because most developers do, too. EXTRAS_REQUIRE. This is fine because most developers do, too.
""" """
print('line...........................13')
import os import os
import sys import sys
from distutils.errors import CompileError from distutils.errors import CompileError
@ -44,9 +45,9 @@ EXTRAS_REQUIRE_DEPS = {
# The packages needed for this requirement, by OS # The packages needed for this requirement, by OS
"OpenBSD": [""], "OpenBSD": [""],
"FreeBSD": [""], "FreeBSD": [""],
"Debian": ["libcap-dev python-prctl"], "Debian": ["libpcap-dev python-prctl"],
"Ubuntu": ["libcap-dev python-prctl"], "Ubuntu": ["libpcap-dev python-prctl"],
"Ubuntu 12": ["libcap-dev python-prctl"], "Ubuntu 12": ["libpcap-dev python-prctl"],
"openSUSE": [""], "openSUSE": [""],
"Fedora": ["prctl"], "Fedora": ["prctl"],
"Guix": [""], "Guix": [""],
@ -56,19 +57,26 @@ EXTRAS_REQUIRE_DEPS = {
def detectPrereqs(missing=True): def detectPrereqs(missing=True):
print('line...........................60')
available = [] available = []
for module in PACKAGES: for module in PACKAGES:
try: try:
# import pdb;pdb.set_trace()
print('nodule---------: ', module)
import_module(module) import_module(module)
print('pass.........................')
if not missing: if not missing:
available.append(module) available.append(module)
except ImportError: except ImportError:
print('Fail.........................')
if missing: if missing:
available.append(module) available.append(module)
print('available------:', available)
return available return available
def prereqToPackages(): def prereqToPackages():
print('line...........................78')
if not detectPrereqs(): if not detectPrereqs():
return return
print("%s %s" % ( print("%s %s" % (
@ -77,6 +85,7 @@ def prereqToPackages():
def compilerToPackages(): def compilerToPackages():
print('line...........................87')
if not detectOS() in COMPILING: if not detectOS() in COMPILING:
return return
print("%s %s" % ( print("%s %s" % (
@ -84,6 +93,7 @@ def compilerToPackages():
def testCompiler(): def testCompiler():
print('line...........................95')
if not HAVE_SETUPTOOLS: if not HAVE_SETUPTOOLS:
# silent, we can't test without setuptools # silent, we can't test without setuptools
return True return True
@ -109,21 +119,26 @@ def testCompiler():
return os.path.isfile(fullPath) return os.path.isfile(fullPath)
print('line...........................121')
prereqs = detectPrereqs() prereqs = detectPrereqs()
compiler = testCompiler() compiler = testCompiler()
print('compiler-----------: ', compiler)
if (not compiler or prereqs) and detectOS() in PACKAGE_MANAGER: if (not compiler or prereqs) and detectOS() in PACKAGE_MANAGER:
print('line...........................126')
print( print(
"It looks like you're using %s. " "It looks like you're using %s. "
"It is highly recommended to use the package manager\n" "It is highly recommended to use the package manager\n"
"to install the missing dependencies." % detectOS.result) "to install the missing dependencies." % detectOS.result)
if not compiler: if not compiler:
print('line...........................133')
print( print(
"Building the bitmsghash module failed.\n" "Building the bitmsghash module failed.\n"
"You may be missing a C++ compiler and/or the OpenSSL headers.") "You may be missing a C++ compiler and/or the OpenSSL headers.")
if prereqs: if prereqs:
print('line...........................139')
mandatory = [x for x in prereqs if not PACKAGES[x].get("optional")] mandatory = [x for x in prereqs if not PACKAGES[x].get("optional")]
optional = [x for x in prereqs if PACKAGES[x].get("optional")] optional = [x for x in prereqs if PACKAGES[x].get("optional")]
if mandatory: if mandatory:
@ -136,17 +151,25 @@ if prereqs:
# Install the system dependencies of optional extras_require components # Install the system dependencies of optional extras_require components
OPSYS = detectOS() OPSYS = detectOS()
CMD = PACKAGE_MANAGER[OPSYS] if OPSYS in PACKAGE_MANAGER else 'UNKNOWN_INSTALLER' CMD = PACKAGE_MANAGER[OPSYS] if OPSYS in PACKAGE_MANAGER else 'UNKNOWN_INSTALLER'
print('CMD---------------: ', CMD)
print('line...........................152')
for lhs, rhs in EXTRAS_REQUIRE.items(): for lhs, rhs in EXTRAS_REQUIRE.items():
if OPSYS is None: if OPSYS is None:
break break
print()
if rhs and any([ if rhs and any([
EXTRAS_REQUIRE_DEPS[x][OPSYS] EXTRAS_REQUIRE_DEPS[x][OPSYS]
for x in rhs for x in rhs
if x in EXTRAS_REQUIRE_DEPS if x in EXTRAS_REQUIRE_DEPS
]): ]):
print('EXTRAS_REQUIRE_DEPS[x][OPSYS]: ', EXTRAS_REQUIRE_DEPS[rhs[0]][OPSYS])
try: try:
print('lhs---------: ', lhs, rhs)
import_module(lhs) import_module(lhs)
print('pass..................167')
# import pdb;pdb.set_trace()
except Exception as e: except Exception as e:
print('fail-----------------169')
rhs_cmd = ''.join([ rhs_cmd = ''.join([
CMD, CMD,
' ', ' ',
@ -162,6 +185,7 @@ for lhs, rhs in EXTRAS_REQUIRE.items():
"Optional dependency `pip install .[{}]` would require `{}`" "Optional dependency `pip install .[{}]` would require `{}`"
" to be run as root".format(lhs, rhs_cmd)) " to be run as root".format(lhs, rhs_cmd))
print('line...........................179')
if (not compiler or prereqs) and OPSYS in PACKAGE_MANAGER: if (not compiler or prereqs) and OPSYS in PACKAGE_MANAGER:
print("You can install the missing dependencies by running, as root:") print("You can install the missing dependencies by running, as root:")
if not compiler: if not compiler:

View File

@ -1,6 +1,6 @@
#python_prctl #python_prctl
python-prctl
psutil psutil
pycrypto pycrypto
#libssl-dev #libssl-dev
#libcap-dev #libcap-dev
python-prctl