2017-12-22 10:53:40 +00:00
|
|
|
# Install dependencies using pip
|
2016-12-27 19:34:16 +00:00
|
|
|
if [ -z "$SCAPY_SUDO" -o "$SCAPY_SUDO" = "false" ]
|
2016-11-09 10:25:17 +00:00
|
|
|
then
|
2016-12-27 19:34:16 +00:00
|
|
|
SCAPY_SUDO=""
|
2016-11-09 10:25:17 +00:00
|
|
|
if [ "$TRAVIS_OS_NAME" = "osx" ]
|
|
|
|
then
|
|
|
|
PIP_INSTALL_FLAGS="--user"
|
|
|
|
fi
|
2017-10-03 11:32:32 +00:00
|
|
|
else
|
|
|
|
SCAPY_SUDO="$SCAPY_SUDO -H"
|
2016-05-23 14:19:25 +00:00
|
|
|
fi
|
2016-12-03 18:17:44 +00:00
|
|
|
|
2017-10-03 11:32:32 +00:00
|
|
|
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U mock
|
|
|
|
|
|
|
|
if ! python --version 2>&1 | grep -q PyPy; then
|
2017-01-04 12:51:53 +00:00
|
|
|
# cryptography requires PyPy >= 2.6, Travis CI uses 2.5.0
|
2017-10-03 11:32:32 +00:00
|
|
|
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U cryptography
|
2016-12-03 18:17:44 +00:00
|
|
|
fi
|
2016-12-27 19:34:16 +00:00
|
|
|
|
|
|
|
# Install coverage
|
|
|
|
if [ "$SCAPY_COVERAGE" = "yes" ]
|
|
|
|
then
|
2017-10-03 11:32:32 +00:00
|
|
|
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U coverage
|
|
|
|
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U PyX
|
2016-10-26 08:03:37 +00:00
|
|
|
fi
|
2016-05-23 14:19:25 +00:00
|
|
|
|
2017-12-22 10:53:40 +00:00
|
|
|
# Install pcap & dnet
|
2016-05-23 14:19:25 +00:00
|
|
|
if [ ! -z $SCAPY_USE_PCAPDNET ]
|
|
|
|
then
|
|
|
|
if [ "$TRAVIS_OS_NAME" = "linux" ]
|
|
|
|
then
|
2017-10-03 11:32:32 +00:00
|
|
|
$SCAPY_SUDO apt-get install openssl
|
|
|
|
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U pylibpcap
|
|
|
|
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U pydumbnet
|
2016-05-23 14:19:25 +00:00
|
|
|
elif [ "$TRAVIS_OS_NAME" = "osx" ]
|
|
|
|
then
|
|
|
|
mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages
|
|
|
|
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth
|
|
|
|
|
|
|
|
brew update
|
|
|
|
brew install --with-python libdnet
|
|
|
|
brew install .travis/pylibpcap.rb
|
|
|
|
fi
|
|
|
|
fi
|
2017-04-10 15:33:08 +00:00
|
|
|
|
|
|
|
# Install wireshark data
|
|
|
|
if [ ! -z "$SCAPY_SUDO" ] && [ "$TRAVIS_OS_NAME" = "linux" ]
|
|
|
|
then
|
|
|
|
$SCAPY_SUDO apt-get install libwireshark-data
|
|
|
|
fi
|