More licenses converted to SPDX.
[metze/wireshark/wip.git] / tools / install_rpms_for_devel.sh
1 #!/bin/bash
2
3 # A little shell script to install all the packages necesary to do Wireshark
4 # development.  Both the development and runtime packages are installed
5 # although the latter aren't strictly necessary.
6 #
7 # Ideally this could automatically pull the packages out of
8 # packaging/rpm/SPECS/wireshark.spec.in but given the variance in package names
9 # between distributions, this seems painful...
10 #
11 # Copyright 2013 Jeff Morriss <jeff.morriss.ws [AT] gmail.com>
12 #
13 # Wireshark - Network traffic analyzer
14 # By Gerald Combs <gerald@wireshark.org>
15 # Copyright 1998 Gerald Combs
16 #
17 # SPDX-License-Identifier: GPL-2.0-or-later
18
19 if [ -r /etc/SuSE-release ]
20 then
21         INSTALL_CMD=zypper
22         GTK2="gtk2-devel libgtk-2_0-0"
23         GTK3="gtk3-devel libgtk-3-0"
24         QT="libqt4-devel gcc-c++"
25         GLIB2="glib2-devel libglib-2_0-0"
26         PCAP="libpcap-devel libpcap1"
27         ZLIB="zlib-devel libz1"
28         SNAPPY="snappy-devel libsnappy1"
29         # The runtime package name changes with the version.  Just pull it
30         # in through the -devel package.
31         LZ4="liblz4-devel"
32         CARES="libcares-devel libcares2"
33         NGHTTP2="nghttp2"
34         # SUSE doesn't split the pod2* commands into a separate package like RH
35         PERLPODS=""
36         GNUTLS="libgnutls-devel"
37         GETTEXT="gettext-tools"
38         QT5="libqt5-linguist-devel libqt5-qtsvg-devel libqt5-qtmultimedia-devel
39                 libQt5PrintSupport-devel"
40         CAP_PROGS="libcap-progs"
41 else
42         if [ ! -r /etc/redhat-release ]
43         then
44                 echo "* * Unknown distro! Assuming Redhat-like. * *"
45                 echo
46         fi
47
48         if type -p dnf > /dev/null
49         then
50                 INSTALL_CMD=dnf
51                 POD2HTML="perl-Pod-Html"
52         else
53                 INSTALL_CMD=yum
54         fi
55         GTK2="gtk2-devel gtk2"
56         GTK3="gtk3-devel gtk3"
57         QT="qt-devel gcc-c++ qt5-qtbase-devel qt5-qtmultimedia-devel"
58         GLIB2="glib2-devel glib2"
59         PCAP="libpcap-devel libpcap"
60         ZLIB="zlib-devel zlib"
61         SNAPPY="snappy-devel snappy"
62         LZ4="lz4 lz4-devel" # May need to enable EPEL
63         CARES="c-ares-devel c-ares"
64         NGHTTP2="libnghttp2"
65         PERLPODS="perl-podlators"
66         GNUTLS="gnutls-devel"
67         GETTEXT="gettext-devel"
68         QT5="qt5-linguist qt5-qtsvg-devel"
69         # mmdbresolve
70         MAXMINDDB="libmaxminddb-devel"
71 fi
72
73 PKGS="autoconf automake libtool gcc flex bison python perl $GLIB2
74 $PCAP $ZLIB lua-devel lua $CARES $GTK3 $GTK2 desktop-file-utils $QT fop
75 asciidoc git git-review $PERLPODS"
76
77 PKGS_OPT="libnl3-devel libnghttp2-devel $NGHTTP2 $SNAPPY $LZ4 libcap $CAP_PROGS
78 libcap-devel $MAXMINDDB libgcrypt-devel $GNUTLS $GETTEXT libssh-devel
79 krb5-devel perl-Parse-Yapp sbc-devel libsmi-devel $POD2HTML $QT5 asciidoctor"
80
81 echo "Run this command (as root):"
82 echo
83 echo $INSTALL_CMD install $PKGS
84 echo
85 echo "To install optional packages:"
86 echo
87 echo $INSTALL_CMD install $PKGS_OPT
88 echo
89 echo "This tool has been obsoleted by tools/rpm-setup.sh"