diff --git a/docbook/wsdg_src/WSDG_chapter_quick_setup.adoc b/docbook/wsdg_src/WSDG_chapter_quick_setup.adoc index 7be9ef3bc2..1fb9e5f135 100644 --- a/docbook/wsdg_src/WSDG_chapter_quick_setup.adoc +++ b/docbook/wsdg_src/WSDG_chapter_quick_setup.adoc @@ -43,9 +43,13 @@ for Wireshark; For RPM-based Linux distributions such as Red Hat, Centos, Fedora, and openSUSE, the script `tools/rpm-setup.sh` will install the packages and -libraries required to build Wireshark. It supports the -`--install-optional` command-line option to install additional tools and -to install libraries required for all Wireshark features. +libraries required to build Wireshark. It supports the command-line +options: + +* `--install-optional` to install additional tools and to install +libraries required for all Wireshark features; +* `--install-rpm-deps` to install packages required to build a .rpm file +for Wireshark. For Alpine Linux, the script `tools/alpine-setup.sh` will install the packages and libraries required to build Wireshark. It supports the diff --git a/tools/rpm-setup.sh b/tools/rpm-setup.sh index e1762b24f0..a1aac94f86 100755 --- a/tools/rpm-setup.sh +++ b/tools/rpm-setup.sh @@ -17,6 +17,7 @@ then echo "The basic usage installs the needed software\n\n" echo "Usage: $0 [--install-optional] [...other options...]\n" echo "\t--install-optional: install optional software as well" + echo "\t--install-rpm-deps: install packages required to build the .rpm file\\n" echo "\t[other]: other options are passed as-is to the packet manager\n" exit 1 fi @@ -29,14 +30,19 @@ then fi ADDITIONAL=0 -for op -do - if [ "$op" = "--install-optional" ] - then - ADDITIONAL=1 - else - OPTIONS="$OPTIONS $op" - fi +RPMDEPS=0 +for arg; do + case $arg in + --install-optional) + ADDITIONAL=1 + ;; + --install-rpm-deps) + RPMDEPS=1 + ;; + *) + OPTIONS="$OPTIONS $arg" + ;; + esac done BASIC_LIST="cmake \ @@ -61,8 +67,9 @@ ADDITIONAL_LIST="libcap-devel \ lz4 \ libxml2-devel \ spandsp-devel \ - systemd-devel \ - rpm-build" + systemd-devel" + +RPMDEPS_LIST="rpm-build" # Guess which package manager we will use for PM in zypper dnf yum ''; do @@ -243,10 +250,19 @@ then ACTUAL_LIST="$ACTUAL_LIST $ADDITIONAL_LIST" fi +if [ $RPMDEPS -ne 0 ] +then + ACTUAL_LIST="$ACTUAL_LIST $RPMDEPS_LIST" +fi + $PM $PM_OPT install $ACTUAL_LIST $OPTIONS -# Now arrange for optional support libraries if [ $ADDITIONAL -eq 0 ] then echo -e "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n" fi + +if [ $RPMDEPS -eq 0 ] +then + printf "\n*** RPM packages build deps not installed. Rerun with --install-deb-deps to have them.\n" +fi