diff options
author | Dario Lombardo <lomato@gmail.com> | 2019-05-20 10:08:00 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2019-05-21 11:01:11 +0000 |
commit | aab172fbdaa5057b3c33fcf69c008abe169f4302 (patch) | |
tree | 3c67b03ca6efbd5de6b416790d62036657e4565f /tools | |
parent | 1a540a6295493853148a51adda3a16980a4f427e (diff) |
tools: add alpine-setup script.
As for debian/rpm/bsd add a script that helps the user to setup
a development environment for alpine.
Tested on s390x alpine.
Change-Id: Ib4e002385ce748b764ae7ff51f39a9cfce61590c
Reviewed-on: https://code.wireshark.org/review/33268
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/alpine-setup.sh | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/tools/alpine-setup.sh b/tools/alpine-setup.sh new file mode 100755 index 0000000000..482568668f --- /dev/null +++ b/tools/alpine-setup.sh @@ -0,0 +1,106 @@ +#!/bin/bash +# Setup development environment on alpine systems +# +# Wireshark - Network traffic analyzer +# By Gerald Combs <gerald@wireshark.org> +# Copyright 1998 Gerald Combs +# +# SPDX-License-Identifier: GPL-2.0-or-later +# +# We drag in tools that might not be needed by all users; it's easier +# that way. +# + +if [ "$1" = "--help" ] +then + printf "\\nUtility to setup a alpine system for Wireshark Development.\\n" + printf "The basic usage installs the needed software\\n\\n" + printf "Usage: %s [--install-optional] [--install-deb-deps] [...other options...]\\n" "$0" + printf "\\t--install-optional: install optional software as well\\n" + printf "\\t[other]: other options are passed as-is to apt\\n" + exit 1 +fi + +# Check if the user is root +if [ "$(id -u)" -ne 0 ] +then + echo "You must be root." + exit 1 +fi + +ADDITIONAL=0 +for arg; do + case $arg in + --install-optional) + ADDITIONAL=1 + ;; + *) + OPTIONS="$OPTIONS $arg" + ;; + esac +done + +BASIC_LIST="cmake \ + ninja \ + gcc \ + g++ \ + glib-dev \ + libgcrypt-dev \ + flex \ + bison \ + perl \ + tiff-dev \ + qt5-qtbase-dev \ + qt5-qttools-dev \ + qt5-qtmultimedia-dev \ + qt5-qtsvg-dev" + +ADDITIONAL_LIST=" + git \ + doxygen \ + asciidoctor \ + libssh-dev \ + spandsp-dev \ + libcap-dev \ + libpcap-dev \ + libxml2-dev \ + libmaxminddb-dev \ + krb5-dev \ + c-ares-dev \ + lz4-dev \ + gnutls-dev \ + snappy-dev \ + nghttp2-dev \ + lua5.2-dev \ + libnl3-dev \ + sbc-dev \ + speexdsp-dev \ + " + +# 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() { + local list="$1" pkgname="$2" + + # fail if the package is not known + apk list $pkgname &> /dev/null || return 1 + + # package is found, append it to list + eval "${list}=\"\${${list}} \${pkgname}\"" +} + +ACTUAL_LIST=$BASIC_LIST + +# Now arrange for optional support libraries +if [ $ADDITIONAL != 0 ] +then + ACTUAL_LIST="$ACTUAL_LIST $ADDITIONAL_LIST" +fi + +apk update || exit 2 +apk add $ACTUAL_LIST $OPTIONS || exit 2 + +if [ $ADDITIONAL == 0 ] +then + printf "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n" +fi |