scapy/.travis/install.sh

47 lines
1.2 KiB
Bash
Raw Normal View History

# 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
fi
if python --version 2>&1 | grep -q PyPy; then
# cryptography requires PyPy >= 2.6, Travis CI uses 2.5.0
2017-07-31 12:12:37 +00:00
$SCAPY_SUDO pip install $PIP_INSTALL_FLAGS -U mock
else
2017-07-31 12:12:37 +00:00
$SCAPY_SUDO pip install $PIP_INSTALL_FLAGS -U cryptography mock
fi
2016-12-27 19:34:16 +00:00
# Install coverage
if [ "$SCAPY_COVERAGE" = "yes" ]
then
$SCAPY_SUDO pip install $PIP_INSTALL_FLAGS coverage
2017-09-25 10:52:25 +00:00
$SCAPY_SUDO apt-get install python-pyx
fi
# Install pcap & dnet
if [ ! -z $SCAPY_USE_PCAPDNET ]
then
if [ "$TRAVIS_OS_NAME" = "linux" ]
then
$SCAPY_SUDO apt-get install python-libpcap python-dumbnet openssl
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
# Install wireshark data
if [ ! -z "$SCAPY_SUDO" ] && [ "$TRAVIS_OS_NAME" = "linux" ]
then
$SCAPY_SUDO apt-get install libwireshark-data
fi