diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-11-09 01:55:30 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2016-11-09 22:05:08 +0000 |
commit | 1be79dd3a841fd89db1e2b43cedfc5330c56f23d (patch) | |
tree | fcd45144c0725f324b94edce70ac4ad99da87489 /tools | |
parent | cbccf05f8be8b3c5dc2f03f31974512c84be5a0c (diff) |
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 <lomato@gmail.com>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/debian-setup.sh | 36 |
1 files 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 |