aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-02-15 00:34:12 -0800
committerGuy Harris <gharris@sonic.net>2021-02-15 09:48:51 +0000
commit812c9f5b8185e4c002e952e9b1dcd39e11d06400 (patch)
tree01988db90cd6704c51faab683b87872b01a09df7 /tools
parent11e919898cd21c129f363d2f47dd52c48e32b167 (diff)
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.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/rpm-setup.sh38
1 files changed, 27 insertions, 11 deletions
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