tools: add deb build required packages to debian-build.sh

Change-Id: Icc8d3897dc2ee23d9691a24ba489690b6e39589b
Reviewed-on: https://code.wireshark.org/review/29364
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2018-08-31 11:29:59 +02:00 committed by Anders Broman
parent 8332b718a2
commit 5720ac5fd0
1 changed files with 24 additions and 2 deletions

View File

@ -15,8 +15,9 @@ if [ "$1" = "--help" ]
then
printf "\\nUtility to setup a debian-based system for Wireshark Development.\\n"
printf "The basic usage installs the needed software\\n\\n"
printf "Usage: %s [--install-optional] [...other options...]\\n" "$0"
printf "\\t--install-optional: install optional software as well"
printf "Usage: %s [--install-optional] [--install-deb-deps] [...other options...]\\n" "$0"
printf "\\t--install-optional: install optional software as well\\n"
printf "\\t--install-deb-deps: install packages required to build the .deb file\\n"
printf "\\t[other]: other options are passed as-is to apt\\n"
exit 1
fi
@ -33,6 +34,9 @@ do
if [ "$op" = "--install-optional" ]
then
ADDITIONAL=1
elif [ "$op" = "--install-deb-deps" ]
then
DEBDEPS=1
else
OPTIONS="$OPTIONS $op"
fi
@ -71,6 +75,14 @@ ADDITIONAL_LIST="libnl-3-dev \
doxygen \
xsltproc"
DEBDEPS_LIST="debhelper \
po-debconf \
python-ply \
docbook-xsl \
docbook-xml \
libxml2-utils \
quilt"
# Adds package $2 to list variable $1 if the package is found.
# If $3 is given, then this version requirement must be satisfied.
add_package() {
@ -124,6 +136,11 @@ then
ACTUAL_LIST="$ACTUAL_LIST $ADDITIONAL_LIST"
fi
if [ $DEBDEPS ]
then
ACTUAL_LIST="$ACTUAL_LIST $DEBDEPS_LIST"
fi
# shellcheck disable=SC2086
apt-get update || exit 2
apt-get install $ACTUAL_LIST $OPTIONS || exit 2
@ -132,3 +149,8 @@ if [ ! $ADDITIONAL ]
then
printf "\\n*** Optional packages not installed. Rerun with --install-optional to have them.\\n"
fi
if [ ! $DEBDEPS ]
then
printf "\n*** Debian packages build deps not installed. Rerun with --install-deb-deps to have them.\n"
fi