Merge pull request #672 from nirmoy/opensuse_installation

RFC: add installation support for SUSE based distros
This commit is contained in:
lantz
2017-01-06 14:55:11 -08:00
committed by GitHub
+21 -1
View File
@@ -56,6 +56,16 @@ if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
$install redhat-lsb-core $install redhat-lsb-core
fi fi
fi fi
test -e /etc/SuSE-release && DIST="SUSE Linux"
if [ "$DIST" = "SUSE Linux" ]; then
install='sudo zypper --non-interactive install '
remove='sudo zypper --non-interactive remove '
pkginst='sudo rpm -ivh'
# Prereqs for this script
if ! which lsb_release &> /dev/null; then
$install openSUSE-release
fi
fi
if which lsb_release &> /dev/null; then if which lsb_release &> /dev/null; then
DIST=`lsb_release -is` DIST=`lsb_release -is`
RELEASE=`lsb_release -rs` RELEASE=`lsb_release -rs`
@@ -68,7 +78,7 @@ echo "Detected Linux distribution: $DIST $RELEASE $CODENAME $ARCH"
KERNEL_NAME=`uname -r` KERNEL_NAME=`uname -r`
KERNEL_HEADERS=kernel-headers-${KERNEL_NAME} KERNEL_HEADERS=kernel-headers-${KERNEL_NAME}
if ! echo $DIST | egrep 'Ubuntu|Debian|Fedora|RedHatEnterpriseServer'; then if ! echo $DIST | egrep 'Ubuntu|Debian|Fedora|RedHatEnterpriseServer|SUSE LINUX'; then
echo "Install.sh currently only supports Ubuntu, Debian, RedHat and Fedora." echo "Install.sh currently only supports Ubuntu, Debian, RedHat and Fedora."
exit 1 exit 1
fi fi
@@ -129,6 +139,10 @@ function mn_deps {
$install gcc make socat psmisc xterm openssh-clients iperf \ $install gcc make socat psmisc xterm openssh-clients iperf \
iproute telnet python-setuptools libcgroup-tools \ iproute telnet python-setuptools libcgroup-tools \
ethtool help2man pyflakes pylint python-pep8 python-pexpect ethtool help2man pyflakes pylint python-pep8 python-pexpect
elif [ "$DIST" = "SUSE LINUX" ]; then
$install gcc make socat psmisc xterm openssh iperf \
iproute telnet python-setuptools libcgroup-tools \
ethtool help2man python-pyflakes python3-pylint python-pep8 python-pexpect
else else
$install gcc make socat psmisc xterm ssh iperf iproute telnet \ $install gcc make socat psmisc xterm ssh iperf iproute telnet \
python-setuptools cgroup-bin ethtool help2man \ python-setuptools cgroup-bin ethtool help2man \
@@ -160,6 +174,8 @@ function of {
$install autoconf automake libtool make gcc $install autoconf automake libtool make gcc
if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
$install git pkgconfig glibc-devel $install git pkgconfig glibc-devel
elif [ "$DIST" = "SUSE LINUX" ]; then
$install git pkgconfig glibc-devel
else else
$install git-core autotools-dev pkg-config libc6-dev $install git-core autotools-dev pkg-config libc6-dev
fi fi
@@ -230,6 +246,8 @@ function install_wireshark {
echo "Installing Wireshark" echo "Installing Wireshark"
if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
$install wireshark wireshark-gnome $install wireshark wireshark-gnome
elif [ "$DIST" = "SUSE LINUX" ]; then
$install wireshark
else else
$install wireshark tshark $install wireshark tshark
fi fi
@@ -568,6 +586,8 @@ function cbench {
if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
$install net-snmp-devel libpcap-devel libconfig-devel $install net-snmp-devel libpcap-devel libconfig-devel
elif [ "$DIST" = "SUSE LINUX" ]; then
$install net-snmp-devel libpcap-devel libconfig-devel
else else
$install libsnmp-dev libpcap-dev libconfig-dev $install libsnmp-dev libpcap-dev libconfig-dev
fi fi