1 | #!/bin/sh -e
|
---|
2 | # @file
|
---|
3 | ## $Id: prerequisites-rpm.sh 96407 2022-08-22 17:43:14Z vboxsync $
|
---|
4 | # Fetches prerequisites for RPM based GNU/Linux systems.
|
---|
5 | #
|
---|
6 |
|
---|
7 | #
|
---|
8 | # Copyright (C) 2018-2022 Oracle and/or its affiliates.
|
---|
9 | #
|
---|
10 | # This file is part of VirtualBox base platform packages, as
|
---|
11 | # available from https://www.virtualbox.org.
|
---|
12 | #
|
---|
13 | # This program is free software; you can redistribute it and/or
|
---|
14 | # modify it under the terms of the GNU General Public License
|
---|
15 | # as published by the Free Software Foundation, in version 3 of the
|
---|
16 | # License.
|
---|
17 | #
|
---|
18 | # This program is distributed in the hope that it will be useful, but
|
---|
19 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
21 | # General Public License for more details.
|
---|
22 | #
|
---|
23 | # You should have received a copy of the GNU General Public License
|
---|
24 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
25 | #
|
---|
26 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
27 | #
|
---|
28 |
|
---|
29 | # What this script does:
|
---|
30 | usage_msg="\
|
---|
31 | Usage: `basename ${0}` [--with-docs]
|
---|
32 |
|
---|
33 | Install the dependencies needed for building VirtualBox on an RPM-based Linux
|
---|
34 | system. Additional distributions will be added as needed. There are no plans
|
---|
35 | to add support for or to accept patches for distributions we do not package.
|
---|
36 | The \`--with-docs\' parameter is to install the packages needed for building
|
---|
37 | documentation. It will also be implemented per distribution as needed."
|
---|
38 |
|
---|
39 | # To repeat: there are no plans to add support for or to accept patches
|
---|
40 | # for distributions we do not package.
|
---|
41 |
|
---|
42 | usage()
|
---|
43 | {
|
---|
44 | echo "${usage_msg}"
|
---|
45 | exit "${1}"
|
---|
46 | }
|
---|
47 |
|
---|
48 | unset WITHDOCS
|
---|
49 |
|
---|
50 | while test -n "${1}"; do
|
---|
51 | case "${1}" in
|
---|
52 | --with-docs)
|
---|
53 | WITHDOCS=1
|
---|
54 | shift ;;
|
---|
55 | -h|--help)
|
---|
56 | usage 0 ;;
|
---|
57 | *)
|
---|
58 | echo "Unknown parameter ${1}" >&2
|
---|
59 | usage 1 ;;
|
---|
60 | esac
|
---|
61 | done
|
---|
62 |
|
---|
63 | export LC_ALL=C
|
---|
64 | PATH=/sbin:/usr/sbin:$PATH
|
---|
65 |
|
---|
66 | # This list is valid for openSUSE 15.0
|
---|
67 | PACKAGES_OPENSUSE="\
|
---|
68 | bzip2 gcc-c++ glibc-devel gzip libcap-devel libcurl-devel libidl-devel \
|
---|
69 | libxslt-devel libvpx-devel libXmu-devel make libopenssl-devel zlib-devel \
|
---|
70 | pam-devel libpulse-devel python-devel rpm-build libSDL_ttf-devel \
|
---|
71 | device-mapper-devel wget kernel-default-devel tar glibc-devel-32bit \
|
---|
72 | libstdc++-devel-32bit libpng16-devel libqt5-qtx11extras-devel \
|
---|
73 | libXcursor-devel libXinerama-devel libXrandr-devel alsa-devel gcc-c++-32bit \
|
---|
74 | libQt5Widgets-devel libQt5OpenGL-devel libQt5PrintSupport-devel \
|
---|
75 | libqt5-linguist libopus-devel"
|
---|
76 |
|
---|
77 | if test -f /etc/SUSE-brand; then
|
---|
78 | zypper install -y ${PACKAGES_OPENSUSE}
|
---|
79 | exit 0
|
---|
80 | fi
|
---|
81 |
|
---|
82 | PACKAGES_EL="bzip2 gcc-c++ glibc-devel gzip libcap-devel libIDL-devel \
|
---|
83 | libxslt-devel libXmu-devel make openssl-devel pam-devel python-devel \
|
---|
84 | rpm-build wget kernel kernel-devel tar libpng-devel libXcursor-devel \
|
---|
85 | libXinerama-devel libXrandr-devel which"
|
---|
86 | PACKAGES_EL5="curl-devel SDL-devel libstdc++-devel.i386 openssh-clients \
|
---|
87 | which gcc44-c++"
|
---|
88 | PACKAGES_EPEL5_ARCH="/usr/bin/python2.6:python26-2.6.8-2.el5 \
|
---|
89 | /usr/bin/python2.6:python26-libs-2.6.8-2.el5 \
|
---|
90 | /usr/bin/python2.6:python26-devel-2.6.8-2.el5 \
|
---|
91 | /usr/bin/python2.6:libffi-3.0.5-1.el5 \
|
---|
92 | /usr/share/doc/SDL_ttf-2.0.8/README:SDL_ttf-2.0.8-3.el5 \
|
---|
93 | /usr/share/doc/SDL_ttf-2.0.8/README:SDL_ttf-devel-2.0.8-3.el5"
|
---|
94 | LOCAL_EL5="\
|
---|
95 | /usr/local/include/pulse:\
|
---|
96 | https://freedesktop.org/software/pulseaudio/releases/pulseaudio-11.1.tar.gz"
|
---|
97 | PACKAGES_EL6_PLUS="libcurl-devel libstdc++-static libvpx-devel \
|
---|
98 | pulseaudio-libs-devel SDL-static device-mapper-devel glibc-static \
|
---|
99 | zlib-static glibc-devel.i686 libstdc++.i686 qt5-qttools-devel \
|
---|
100 | qt5-qtx11extras-devel"
|
---|
101 | PACKAGES_EL7_PLUS="opus-devel"
|
---|
102 | PACKAGE_LIBNSL_X86="libnsl.i686"
|
---|
103 | DOCS_EL="texlive-latex texlive-latex-bin texlive-ec texlive-pdftex-def \
|
---|
104 | texlive-fancybox"
|
---|
105 |
|
---|
106 | if test -f /etc/redhat-release; then
|
---|
107 | read elrelease < /etc/redhat-release
|
---|
108 | case "${elrelease}" in
|
---|
109 | *"release 5."*|*"release 6."*|*"release 7."*)
|
---|
110 | INSTALL="yum install -y" ;;
|
---|
111 | *)
|
---|
112 | INSTALL="dnf install -y" ;;
|
---|
113 | esac
|
---|
114 | case "`uname -m`" in
|
---|
115 | x86_64) ARCH=x86_64 ;;
|
---|
116 | *) ARCH=i386 ;;
|
---|
117 | esac
|
---|
118 | egrepignore=\
|
---|
119 | "Setting up Install Process|already installed and latest version\
|
---|
120 | |Nothing to do"
|
---|
121 | ${INSTALL} ${PACKAGES_EL} | egrep -v "${egrepignore}"
|
---|
122 | case "${elrelease}" in
|
---|
123 | *"release 5."*)
|
---|
124 | # Packages missing in EL5
|
---|
125 | ${INSTALL} ${PACKAGES_EL5} | egrep -v "${egrepignore}"
|
---|
126 | for i in ${PACKAGES_EPEL5_ARCH}; do
|
---|
127 | if test ! -r "${i%%:*}"; then
|
---|
128 | wget "http://archives.fedoraproject.org/pub/archive/epel/5/\
|
---|
129 | ${ARCH}/${i#*:}.${ARCH}.rpm" -P /tmp
|
---|
130 | rpm -i "/tmp/${i#*:}.${ARCH}.rpm"
|
---|
131 | rm "/tmp/${i#*:}.${ARCH}.rpm"
|
---|
132 | fi
|
---|
133 | done
|
---|
134 | for i in ${LOCAL_EL5}; do
|
---|
135 | if test ! -r "${i%%:*}"; then
|
---|
136 | {
|
---|
137 | ARCHIVE="${i#*:}"
|
---|
138 | TMPNAME=`/tmp/date +'%s'`
|
---|
139 | mkdir -p "${TMPNAME}"
|
---|
140 | cd "${TMPNAME}"
|
---|
141 | wget "${ARCHIVE}"
|
---|
142 | case "${ARCHIVE}" in
|
---|
143 | *.tar.gz)
|
---|
144 | tar xzf "${ARCHIVE}" --strip-components 1 ;;
|
---|
145 | *)
|
---|
146 | echo Error: unknown archive type "${ARCHIVE}"
|
---|
147 | exit 1
|
---|
148 | esac
|
---|
149 | ./configure
|
---|
150 | make
|
---|
151 | make install
|
---|
152 | cd /tmp
|
---|
153 | rm -r "${TMPNAME}"
|
---|
154 | }
|
---|
155 | fi
|
---|
156 | done ;;
|
---|
157 | *)
|
---|
158 | ${INSTALL} ${PACKAGES_EL6_PLUS} | egrep -v "${egrepignore}"
|
---|
159 | case "${elrelease}" in
|
---|
160 | *"release 6."*) ;;
|
---|
161 | *)
|
---|
162 | ${INSTALL} ${PACKAGES_EL7_PLUS} | egrep -v "${egrepignore}"
|
---|
163 | test -n "${WITHDOCS}" &&
|
---|
164 | ${INSTALL} ${DOCS_EL} | egrep -v "${egrepignore}"
|
---|
165 | esac
|
---|
166 | esac
|
---|
167 | test -e /usr/lib/libnsl.so.1 ||
|
---|
168 | ${INSTALL} ${PACKAGE_LIBNSL_X86} | egrep -v "${egrepignore}" || true
|
---|
169 | fi
|
---|