From 1be79dd3a841fd89db1e2b43cedfc5330c56f23d Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 9 Nov 2016 01:55:30 +0100 Subject: [PATCH] debian-setup: allow libssh-dev to be installed for trusty Ubuntu 14.04 Trusty has libssh-dev 0.6.1 (using OpenSSL) which should be usable. The debian/control file is not updated due to OpenSSL licensing concerns, if you need to build on trusty, you need dpkg-buildpackage -d (--no-check-builddeps). Remove distro-detection in favor of feature detection. Note that the minimum Ubuntu versions could be lower, but unsupported versions are not listed on packages.ubuntu.com so I did not bother. Change-Id: Ia04d960f3d4957918c925bf9cd351537e233fd3e Reviewed-on: https://code.wireshark.org/review/18725 Reviewed-by: Dario Lombardo Reviewed-by: Balint Reczey --- tools/debian-setup.sh | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/tools/debian-setup.sh b/tools/debian-setup.sh index 8dc16d6c66..b6020a7151 100755 --- a/tools/debian-setup.sh +++ b/tools/debian-setup.sh @@ -43,25 +43,37 @@ ADDITIONAL_LIST="libnl-3-dev qttools5-dev qttools5-dev-tools libgtk-3-dev \ libparse-yapp-perl qt5-default cmake libcap-dev \ liblz4-dev libsnappy-dev" +# Adds package $2 to list variable $1 if the package is found +add_package() { + local list="$1" pkgname="$2" + + # fail if the package is not known + [ -n "$(apt-cache show "$pkgname" 2>/dev/null)" ] || return 1 + + # package is found, append it to list + eval "${list}=\"\${${list}} \${pkgname}\"" +} + # Check for lsb_release command in $PATH if ! which lsb_release > /dev/null; then echo "ERROR: lsb_release not found in \$PATH" >&2 exit 1; fi -rel=$(lsb_release --codename --short) +# only needed for newer distro versions where "libtool" binary is separated. +# Debian >= jessie, Ubuntu >= 16.04 +add_package BASIC_LIST libtool-bin + +# Debian >= wheezy-backports, Ubuntu >= 16.04 +add_package ADDITIONAL_LIST libnghttp2-dev || +echo "libnghttp2-dev is unavailable" >&2 + +# libssh-gcrypt-dev: Debian >= jessie, Ubuntu >= 16.04 +# libssh-dev (>= 0.6): Debian >= jessie, Ubuntu >= 14.04 +add_package ADDITIONAL_LIST libssh-gcrypt-dev || +add_package ADDITIONAL_LIST libssh-dev || +echo "libssh-gcrypt-dev and libssh-dev are unavailable" >&2 -case $rel in -trusty) - # Add trusty specific steps - # i.e. there is no libtool-bin package in trusty and other distros. - # Avoid install it on those platforms. - ;; -*) - BASIC_LIST="$BASIC_LIST libtool-bin" - ADDITIONAL_LIST="$ADDITIONAL_LIST libnghttp2-dev libssh-gcrypt-dev" - ;; -esac # Install basic packages apt-get install $BASIC_LIST $OPTIONS