rpm-setup, WSDG: add a --install-rpm-deps option to install rpm-build.

This matches what deb-setup does - it has an --install-deb-deps optionto
install tools necessary to build a .deb.

Document it in the WSDG while we're at it.
This commit is contained in:
Guy Harris 2021-02-15 00:34:12 -08:00
parent 11e919898c
commit 812c9f5b81
2 changed files with 34 additions and 14 deletions

View File

@ -43,9 +43,13 @@ for Wireshark;
For RPM-based Linux distributions such as Red Hat, Centos, Fedora, and For RPM-based Linux distributions such as Red Hat, Centos, Fedora, and
openSUSE, the script `tools/rpm-setup.sh` will install the packages and openSUSE, the script `tools/rpm-setup.sh` will install the packages and
libraries required to build Wireshark. It supports the libraries required to build Wireshark. It supports the command-line
`--install-optional` command-line option to install additional tools and options:
to install libraries required for all Wireshark features.
* `--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 For Alpine Linux, the script `tools/alpine-setup.sh` will install the
packages and libraries required to build Wireshark. It supports the packages and libraries required to build Wireshark. It supports the

View File

@ -17,6 +17,7 @@ then
echo "The basic usage installs the needed software\n\n" echo "The basic usage installs the needed software\n\n"
echo "Usage: $0 [--install-optional] [...other options...]\n" echo "Usage: $0 [--install-optional] [...other options...]\n"
echo "\t--install-optional: install optional software as well" 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" echo "\t[other]: other options are passed as-is to the packet manager\n"
exit 1 exit 1
fi fi
@ -29,14 +30,19 @@ then
fi fi
ADDITIONAL=0 ADDITIONAL=0
for op RPMDEPS=0
do for arg; do
if [ "$op" = "--install-optional" ] case $arg in
then --install-optional)
ADDITIONAL=1 ADDITIONAL=1
else ;;
OPTIONS="$OPTIONS $op" --install-rpm-deps)
fi RPMDEPS=1
;;
*)
OPTIONS="$OPTIONS $arg"
;;
esac
done done
BASIC_LIST="cmake \ BASIC_LIST="cmake \
@ -61,8 +67,9 @@ ADDITIONAL_LIST="libcap-devel \
lz4 \ lz4 \
libxml2-devel \ libxml2-devel \
spandsp-devel \ spandsp-devel \
systemd-devel \ systemd-devel"
rpm-build"
RPMDEPS_LIST="rpm-build"
# Guess which package manager we will use # Guess which package manager we will use
for PM in zypper dnf yum ''; do for PM in zypper dnf yum ''; do
@ -243,10 +250,19 @@ then
ACTUAL_LIST="$ACTUAL_LIST $ADDITIONAL_LIST" ACTUAL_LIST="$ACTUAL_LIST $ADDITIONAL_LIST"
fi fi
if [ $RPMDEPS -ne 0 ]
then
ACTUAL_LIST="$ACTUAL_LIST $RPMDEPS_LIST"
fi
$PM $PM_OPT install $ACTUAL_LIST $OPTIONS $PM $PM_OPT install $ACTUAL_LIST $OPTIONS
# Now arrange for optional support libraries
if [ $ADDITIONAL -eq 0 ] if [ $ADDITIONAL -eq 0 ]
then then
echo -e "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n" echo -e "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n"
fi fi
if [ $RPMDEPS -eq 0 ]
then
printf "\n*** RPM packages build deps not installed. Rerun with --install-deb-deps to have them.\n"
fi