Files
vsmartcard/.travis.yml
Dominik 83047f139a Install PyCrypto via pip for Travis CI build
PyCrypto is currently not available when running the vpicc unittest so
the tests fails. In order to run the tests sucessfully we install
PyCrypto via pip. This only works only works on linux and only when not
using mingw32-gcc.
2016-03-07 01:58:26 +01:00

123 lines
5.1 KiB
YAML

language: C
matrix:
include:
- compiler: clang
- compiler: gcc
- compiler: i686-w64-mingw32-gcc
- compiler: x86_64-w64-mingw32-gcc
env:
global:
- PKG_CONFIG_PATH=/tmp/install/lib/pkgconfig
- PREFIX=/tmp/install
- PYTHONPATH=$PYTHONPATH:$PREFIX/lib/python2.7/site-packages/
- ac_cv_func_malloc_0_nonnull=yes
- ac_cv_func_realloc_0_nonnull=yes
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "M+eNZPASDoFdWZUeSyu4whvPKaOwd0AlCmGWKc7SRbQPD8x8Ao8y3+kr++YonsWBnDUqQSNg3v4uWsJOo2Q57qMQ+FYcNlEjrYpXXSRdH4BnYnTH1WfNnTce7N5Bln9wxE+khe7cZJcxy+gvd+YiutQvHjT+bTzrs2MtHD0Odlw="
before_install:
- sudo apt-get update
install:
- if [ "$CC" == i686-w64-mingw32-gcc -o "$CC" == x86_64-w64-mingw32-gcc ]; then
export HOST=${CC%%-gcc};
fi
- if [ $TRAVIS_OS_NAME == linux ]; then
if [ -z "$HOST" ]; then
sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/libgcc_s.so;
sudo apt-get -qq install libpcsclite-dev libusb-dev xutils-dev gengetopt help2man swig python-dev;
pip install --user pycrypto;
else
sudo apt-get -qq install libpcsclite-dev libusb-dev xutils-dev gengetopt help2man binutils-mingw-w64 gcc-mingw-w64;
fi
fi
before_script:
# libnpa requires OpenPACE
- git clone https://github.com/frankmorgner/openpace && cd openpace
- autoreconf -vis
- if [ -z "$HOST" ]; then
./configure --prefix=$PREFIX --enable-openssl-install --enable-python || cat config.log;
else
export CROSS_COMPILE=$HOST-;
./configure --prefix=$PREFIX --enable-openssl-install --host=$HOST --enable-openssl-install || cat config.log;
touch src/cvc-create.1 src/cvc-print.1;
fi
- make install
# libnpa requires OpenSC
- cd $TRAVIS_BUILD_DIR/npa/src/opensc
- grep _sc_card_add_ec_alg src/libopensc/libopensc.exports || echo _sc_card_add_ec_alg >> src/libopensc/libopensc.exports
- grep _sc_card_add_rsa_alg src/libopensc/libopensc.exports || echo _sc_card_add_rsa_alg >> src/libopensc/libopensc.exports
- grep _sc_match_atr src/libopensc/libopensc.exports || echo _sc_match_atr >> src/libopensc/libopensc.exports
- grep sc_apdu_set_resp src/libopensc/libopensc.exports || echo sc_apdu_set_resp >> src/libopensc/libopensc.exports
- grep sc_apdu_get_octets src/libopensc/libopensc.exports || echo sc_apdu_get_octets >> src/libopensc/libopensc.exports
- grep sc_pkcs15_pincache_add src/libopensc/libopensc.exports || echo sc_pkcs15_pincache_add >> src/libopensc/libopensc.exports
- ./bootstrap
- if [ -z "$HOST" ]; then
./configure --prefix=$PREFIX || cat config.log;
else
./configure --prefix=$PREFIX --host=$HOST LDFLAGS="-I$PREFIX/include" CFLAGS="-I$PREFIX/include" CXXFLAGS="-I$PREFIX/include" LIBS="-I$PREFIX/include" || cat config.log;
fi
- make install
# Configure libnpa
- cd $TRAVIS_BUILD_DIR/npa
- autoreconf -vsi
- if [ -z "$HOST" ]; then
./configure OPENSC_LIBS="-L$PREFIX/lib -lopensc -lcrypto" || cat config.log;
else
./configure --host=$HOST OPENSC_LIBS="-L$PREFIX/lib -lopensc -lcrypto" || cat config.log;
touch src/npa-tool.1;
fi
# Configure virtualsmartcard
- cd $TRAVIS_BUILD_DIR/virtualsmartcard && autoreconf -vsi
- if [ -z "$HOST" ]; then
./configure || cat config.log;
else
./configure --host=$HOST --enable-libpcsclite || cat config.log;
fi
# pcsc-relay requires libnfc
- git clone https://github.com/nfc-tools/libnfc.git && cd libnfc && autoreconf -vsi
- if [ -z "$HOST" ]; then
./configure --prefix=$PREFIX || cat config.log;
make install;
fi
# Configure pcsc-relay
- if [ -z "$HOST" ]; then
cd $TRAVIS_BUILD_DIR/pcsc-relay;
autoreconf -vsi;
./configure --host=$HOST || cat config.log;
fi
- if [ -z "$HOST" ]; then
cd $TRAVIS_BUILD_DIR/ccid && autoreconf -vsi && ./configure OPENSSL_CFLAGS="-I$PREFIX/include" OPENSSL_LIBS="-L$PREFIX/lib -lcrypto" OPENSC_LIBS="-L$PREFIX/lib -lopensc" || cat config.log;
fi
addons:
coverity_scan:
project:
name: "frankmorgner/vsmartcard"
description: "Umbrella project for various projects concerned with the emulation of different types of smart card readers or smart cards themselves"
notification_email: morgner@informatik.hu-berlin.de
build_command: make -C $TRAVIS_BUILD_DIR/npa -C $TRAVIS_BUILD_DIR/virtualsmartcard -C $TRAVIS_BUILD_DIR/ccid -C $TRAVIS_BUILD_DIR/pcsc-relay
branch_pattern: coverity_scan
script:
# Build libnpa
- make -C $TRAVIS_BUILD_DIR/npa
# Build virtualsmartcard
- make -C $TRAVIS_BUILD_DIR/virtualsmartcard
# Verify virtualsmartcard
- if [ -z "$HOST" ]; then
cd $TRAVIS_BUILD_DIR/virtualsmartcard/src/vpicc && export PYTHONPATH=$PYTHONPATH:`pwd` && export LD_LIBRARY_PATH=$PREFIX/lib/ && python -m unittest discover -s virtualsmartcard.tests -p *_test.py -v;
fi
# Build pcsc-relay
- if [ -z "$HOST" ]; then
make -C $TRAVIS_BUILD_DIR/pcsc-relay;
fi
# Build ccid
- if [ -z "$HOST" ]; then
make -C $TRAVIS_BUILD_DIR/ccid;
fi