summaryrefslogtreecommitdiff
path: root/.travis
diff options
context:
space:
mode:
authorBernhard Schmidt <berni@debian.org>2020-08-15 21:29:54 +0200
committerBernhard Schmidt <berni@debian.org>2020-08-15 21:29:54 +0200
commit7c229d538824cb679351220ad8911f7b2daa7c23 (patch)
tree5c4d64b60da9018c7db3a9335a9787d326beade3 /.travis
parentd3986a312f5fbcfd0e78e6b147eef419fb4e5f54 (diff)
parent1079962e4c06f88a54e50d997c1b7e84303d30b4 (diff)
Update upstream source from tag 'upstream/2.5_beta1'
Update to upstream version '2.5~beta1' with Debian dir d53f9a482ac24eb491a294b26c24bb1d87afad24
Diffstat (limited to '.travis')
-rwxr-xr-x.travis/build-check.sh32
-rwxr-xr-x.travis/build-deps.sh170
-rwxr-xr-x.travis/coverity.sh17
3 files changed, 219 insertions, 0 deletions
diff --git a/.travis/build-check.sh b/.travis/build-check.sh
new file mode 100755
index 0000000..4e1b724
--- /dev/null
+++ b/.travis/build-check.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+set -eux
+
+if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
+ PATH="/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/":$PATH
+ MSBuild.exe openvpn.sln //p:Platform=x64 && exit 0
+fi
+
+autoreconf -vi
+
+if [ -z ${CHOST+x} ]; then
+ if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
+ export EXTRA_CONFIG="${EXTRA_CONFIG:-} --enable-werror"
+ fi
+ ./configure --with-crypto-library="${SSLLIB}" ${EXTRA_CONFIG:-} || (cat config.log && exit 1)
+ make LDFLAGS="-Wl,-rpath,${PREFIX}/lib" -j$JOBS
+ src/openvpn/openvpn --version || true
+ if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
+ ldd src/openvpn/openvpn;
+ fi
+ if [ "${TRAVIS_OS_NAME}" = "osx" ]; then otool -L src/openvpn/openvpn; fi
+ make check
+ ${EXTRA_SCRIPT:-}
+else
+ export TAP_CFLAGS="-I${PWD}/tap-windows-${TAP_WINDOWS_VERSION}/include"
+ export LZO_CFLAGS="-I${PREFIX}/include"
+ export LZO_LIBS="-L${PREFIX}/lib -llzo2"
+ export PKCS11_HELPER_LIBS="-L${PREFIX}/lib -lpkcs11-helper"
+ export PKCS11_HELPER_CFLAGS="-I${PREFIX}/include"
+ ./configure --with-crypto-library="${SSLLIB}" --host=${CHOST} --build=x86_64-pc-linux-gnu --enable-pkcs11 --disable-plugins || (cat config.log && exit 1)
+ make -j${JOBS}
+fi
diff --git a/.travis/build-deps.sh b/.travis/build-deps.sh
new file mode 100755
index 0000000..08b93e7
--- /dev/null
+++ b/.travis/build-deps.sh
@@ -0,0 +1,170 @@
+#!/bin/sh
+set -eux
+
+if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
+ choco install strawberryperl nasm
+ choco install visualstudio2019buildtools --package-parameters "--includeRecommended --includeOptional"
+ choco install visualstudio2019-workload-vctools
+ cd ..
+ git clone https://github.com/openvpn/openvpn-build.git
+ cd openvpn-build
+ PATH="/c/Strawberry/perl/bin:":$PATH MODE=DEPS msvc/build.bat
+ exit 0
+fi
+
+# Set defaults
+PREFIX="${PREFIX:-${HOME}/opt}"
+
+download_tap_windows () {
+ if [ ! -f "download-cache/tap-windows-${TAP_WINDOWS_VERSION}.zip" ]; then
+ wget -P download-cache/ \
+ "http://build.openvpn.net/downloads/releases/tap-windows-${TAP_WINDOWS_VERSION}.zip"
+ fi
+}
+
+download_lzo () {
+ if [ ! -f "download-cache/lzo-${LZO_VERSION}.tar.gz" ]; then
+ wget -P download-cache/ \
+ "http://www.oberhumer.com/opensource/lzo/download/lzo-${LZO_VERSION}.tar.gz"
+ fi
+}
+
+build_lzo () {
+ if [ "$(cat ${PREFIX}/.lzo-version)" != "${LZO_VERSION}" ]; then
+ tar zxf download-cache/lzo-${LZO_VERSION}.tar.gz
+ (
+ cd "lzo-${LZO_VERSION}"
+
+ ./configure --host=${CHOST} --program-prefix='' \
+ --libdir=${PREFIX}/lib --prefix=${PREFIX} --build=x86_64-pc-linux-gnu
+ make all install
+ )
+ echo "${LZO_VERSION}" > "${PREFIX}/.lzo-version"
+ fi
+}
+
+download_pkcs11_helper () {
+ if [ ! -f "pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz" ]; then
+ wget -P download-cache/ \
+ "https://github.com/OpenSC/pkcs11-helper/archive/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz"
+ fi
+}
+
+build_pkcs11_helper () {
+ if [ "$(cat ${PREFIX}/.pkcs11_helper-version)" != "${PKCS11_HELPER_VERSION}" ]; then
+ tar xf download-cache/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz
+ (
+ cd "pkcs11-helper-pkcs11-helper-${PKCS11_HELPER_VERSION}"
+
+ autoreconf -iv
+
+ ./configure --host=${CHOST} --program-prefix='' --libdir=${PREFIX}/lib \
+ --prefix=${PREFIX} --build=x86_64-pc-linux-gnu \
+ --disable-crypto-engine-gnutls \
+ --disable-crypto-engine-nss \
+ --disable-crypto-engine-polarssl \
+ --disable-crypto-engine-mbedtls
+ make all install
+ )
+ echo "${PKCS11_HELPER_VERSION}" > "${PREFIX}/.pkcs11_helper-version"
+ fi
+}
+
+download_mbedtls () {
+ if [ ! -f "download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz" ]; then
+ wget -P download-cache/ \
+ "https://tls.mbed.org/download/mbedtls-${MBEDTLS_VERSION}-apache.tgz"
+ fi
+}
+
+build_mbedtls () {
+ if [ "$(cat ${PREFIX}/.mbedtls-version)" != "${MBEDTLS_VERSION}" ]; then
+ tar zxf download-cache/mbedtls-${MBEDTLS_VERSION}-apache.tgz
+ (
+ cd "mbedtls-${MBEDTLS_VERSION}"
+ make
+ make install DESTDIR="${PREFIX}"
+ )
+ echo "${MBEDTLS_VERSION}" > "${PREFIX}/.mbedtls-version"
+ fi
+}
+
+download_openssl () {
+ if [ ! -f "download-cache/openssl-${OPENSSL_VERSION}.tar.gz" ]; then
+ MAJOR=`echo $OPENSSL_VERSION | sed -e 's/\([0-9.]*\).*/\1/'`
+ wget -P download-cache/ \
+ "https://www.openssl.org/source/old/${MAJOR}/openssl-${OPENSSL_VERSION}.tar.gz"
+ fi
+}
+
+build_openssl_linux () {
+ (
+ cd "openssl-${OPENSSL_VERSION}/"
+ ./config shared --prefix="${PREFIX}" --openssldir="${PREFIX}" -DPURIFY
+ make all install_sw
+ )
+}
+
+build_openssl_osx () {
+ (
+ cd "openssl-${OPENSSL_VERSION}/"
+ ./Configure darwin64-x86_64-cc shared \
+ --prefix="${PREFIX}" --openssldir="${PREFIX}" -DPURIFY
+ make depend all install_sw
+ )
+}
+
+build_openssl_mingw () {
+ (
+ cd "openssl-${OPENSSL_VERSION}/"
+
+ if [ "${CHOST}" = "i686-w64-mingw32" ]; then
+ export TARGET=mingw
+ elif [ "${CHOST}" = "x86_64-w64-mingw32" ]; then
+ export TARGET=mingw64
+ fi
+
+ ./Configure --cross-compile-prefix=${CHOST}- shared \
+ ${TARGET} no-capieng --prefix="${PREFIX}" --openssldir="${PREFIX}" -static-libgcc
+ make install
+ )
+}
+
+build_openssl () {
+ if [ "$(cat ${PREFIX}/.openssl-version)" != "${OPENSSL_VERSION}" ]; then
+ tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz"
+ if [ ! -z ${CHOST+x} ]; then
+ build_openssl_mingw
+ elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
+ build_openssl_osx
+ elif [ "${TRAVIS_OS_NAME}" = "linux" ]; then
+ build_openssl_linux
+ fi
+ echo "${OPENSSL_VERSION}" > "${PREFIX}/.openssl-version"
+ fi
+}
+
+# Download and build crypto lib
+if [ "${SSLLIB}" = "openssl" ]; then
+ download_openssl
+ build_openssl
+elif [ "${SSLLIB}" = "mbedtls" ]; then
+ download_mbedtls
+ build_mbedtls
+else
+ echo "Invalid crypto lib: ${SSLLIB}"
+ exit 1
+fi
+
+# Download and build dependencies for mingw cross build
+# dependencies are the same as in regular windows installer build
+if [ ! -z ${CHOST+x} ]; then
+ download_tap_windows
+ unzip download-cache/tap-windows-${TAP_WINDOWS_VERSION}.zip
+
+ download_lzo
+ build_lzo
+
+ download_pkcs11_helper
+ build_pkcs11_helper
+fi
diff --git a/.travis/coverity.sh b/.travis/coverity.sh
new file mode 100755
index 0000000..8bb40f4
--- /dev/null
+++ b/.travis/coverity.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -eu
+
+RUN_COVERITY="${RUN_COVERITY:-0}"
+
+export COVERITY_SCAN_PROJECT_NAME="OpenVPN/openvpn"
+export COVERITY_SCAN_BRANCH_PATTERN="release\/2.4"
+export COVERITY_SCAN_NOTIFICATION_EMAIL="scan-reports@openvpn.net"
+export COVERITY_SCAN_BUILD_COMMAND_PREPEND="autoreconf -vi && ./configure --enable-iproute2 && make clean"
+export COVERITY_SCAN_BUILD_COMMAND="make"
+
+if [ "${RUN_COVERITY}" = "1" ]; then
+ # Ignore exit code, script exits with 1 if we're not on the right branch
+ curl -s "https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh" | bash || true
+else
+ echo "Skipping coverity scan because \$RUN_COVERITY != \"1\""
+fi