scapy/.travis/install.sh

54 lines
1.6 KiB
Bash
Raw Normal View History

2017-12-05 09:07:26 +00:00
PIP=`which pip || (python --version | grep -q 'Python 2' && which pip2) || (python --version | grep -q 'Python 3' && which pip3)`
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
else
SCAPY_SUDO="$SCAPY_SUDO -H"
fi
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U mock
if ! python --version 2>&1 | grep -q PyPy; then
# cryptography requires PyPy >= 2.6, Travis CI uses 2.5.0
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U cryptography
fi
2016-12-27 19:34:16 +00:00
# Install coverage
if [ "$SCAPY_COVERAGE" = "yes" ]
then
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U coverage
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U PyX
2017-12-24 17:47:37 +00:00
$SCAPY_SUDO `which pip` install $PIP_INSTALL_FLAGS -U codecov
fi
2017-12-22 10:53:40 +00:00
# Install pcap & dnet
if [ ! -z $SCAPY_USE_PCAPDNET ]
then
if [ "$TRAVIS_OS_NAME" = "linux" ]
then
$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
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