VirtualBox

source: vbox/trunk/tools/bin/prerequisites-rpm.sh@ 74942

Last change on this file since 74942 was 73121, checked in by vboxsync, 6 years ago

prerequisites.rpm: minor documentation fix.

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

© 2023 Oracle
ContactPrivacy policyTerms of Use