blob: 55a820288f54d49abae5ef0d9e05c7a6ef403146 [file] [log] [blame]
Guillaume Valadon6317ba02016-05-23 16:19:25 +02001# Install dependencies using pip
Guillaume Valadon8fc77d52016-12-27 20:34:16 +01002if [ -z "$SCAPY_SUDO" -o "$SCAPY_SUDO" = "false" ]
Pierre LALETa9937be2016-11-09 11:25:17 +01003then
Guillaume Valadon8fc77d52016-12-27 20:34:16 +01004 SCAPY_SUDO=""
Pierre LALETa9937be2016-11-09 11:25:17 +01005 if [ "$TRAVIS_OS_NAME" = "osx" ]
6 then
7 PIP_INSTALL_FLAGS="--user"
8 fi
Guillaume Valadon6317ba02016-05-23 16:19:25 +02009fi
Guillaume Valadon8fc77d52016-12-27 20:34:16 +010010$SCAPY_SUDO pip install $PIP_INSTALL_FLAGS ecdsa mock
Daniel Collins620f1952016-10-26 01:03:37 -070011
12# Pycrypto 2.7a1 isn't available on PyPi
13if [ "$TEST_COMBINED_MODES" = "yes" ]
14then
15 curl -sL https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz | tar xz
16 cd pycrypto-2.7a1
17 python setup.py build
Guillaume Valadon8fc77d52016-12-27 20:34:16 +010018 $SCAPY_SUDO python setup.py install
Daniel Collins620f1952016-10-26 01:03:37 -070019else
Guillaume Valadon8fc77d52016-12-27 20:34:16 +010020 $SCAPY_SUDO pip install $PIP_INSTALL_FLAGS pycrypto
21fi
22
23# Install coverage
24if [ "$SCAPY_COVERAGE" = "yes" ]
25then
26 $SCAPY_SUDO pip install $PIP_INSTALL_FLAGS coverage
Daniel Collins620f1952016-10-26 01:03:37 -070027fi
Guillaume Valadon6317ba02016-05-23 16:19:25 +020028
29# Install pcap & dnet
30if [ ! -z $SCAPY_USE_PCAPDNET ]
31then
32 if [ "$TRAVIS_OS_NAME" = "linux" ]
33 then
Guillaume Valadon8fc77d52016-12-27 20:34:16 +010034 $SCAPY_SUDO apt-get install python-libpcap python-dumbnet
Guillaume Valadon6317ba02016-05-23 16:19:25 +020035 elif [ "$TRAVIS_OS_NAME" = "osx" ]
36 then
37 mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages
38 echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth
39
40 brew update
41 brew install --with-python libdnet
42 brew install .travis/pylibpcap.rb
43 fi
44fi