1 | #!/bin/sh -e
|
---|
2 | # @file
|
---|
3 | ## $Id: prerequisites-rpm.sh 72922 2018-07-05 15:50:16Z 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:
|
---|
20 | usage_msg="\
|
---|
21 | Usage: `basename ${0}` [--with-docs]
|
---|
22 |
|
---|
23 | Install the dependencies needed for building VirtualBox on an RPM-based Linux
|
---|
24 | system. Additional distributions will be added as needed. There are no plans
|
---|
25 | to add support for or to accept patches for distributions we do not package.
|
---|
26 | The \`--docs\' parameter is to install the packages needed for building
|
---|
27 | documentation. 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 |
|
---|
32 | unset WITHDOCS
|
---|
33 | egrepignore=\
|
---|
34 | "Setting up Install Process|already installed and latest version|Nothing to do"
|
---|
35 |
|
---|
36 | usage()
|
---|
37 | {
|
---|
38 | echo "${usage_msg}"
|
---|
39 | exit "${1}"
|
---|
40 | }
|
---|
41 |
|
---|
42 | while test -n "${1}"; do
|
---|
43 | case "${1}" in
|
---|
44 | --with-docs)
|
---|
45 | WITHDOCS=1
|
---|
46 | shift ;;
|
---|
47 | -h|--help)
|
---|
48 | usage 0 ;;
|
---|
49 | *)
|
---|
50 | echo "Unknown parameter ${1}" >&2
|
---|
51 | usage 1 ;;
|
---|
52 | esac
|
---|
53 | done
|
---|
54 |
|
---|
55 | export LC_ALL=C
|
---|
56 | PATH=/sbin:/usr/sbin:$PATH
|
---|
57 |
|
---|
58 | # This list is valid for openSUSE 15.0
|
---|
59 | PACKAGES_OPENSUSE="\
|
---|
60 | bzip2 gcc-c++ glibc-devel gzip libcap-devel libcurl-devel libidl-devel \
|
---|
61 | libxslt-devel libvpx-devel libXmu-devel make libopenssl-devel zlib-devel\
|
---|
62 | pam-devel libpulse-devel python-devel rpm-build libSDL_ttf-devel \
|
---|
63 | device-mapper-devel wget kernel-default-devel tar glibc-devel-32bit \
|
---|
64 | libstdc++-devel-32bit libpng16-devel libqt5-qtx11extras-devel \
|
---|
65 | libXcursor-devel libXinerama-devel libXrandr-devel alsa-devel gcc-c++-32bit \
|
---|
66 | libQt5Widgets-devel libQt5OpenGL-devel libQt5PrintSupport-devel \
|
---|
67 | libqt5-linguist"
|
---|
68 |
|
---|
69 | if test -f /etc/SUSE-brand; then
|
---|
70 | zypper install -y ${PACKAGES_OPENSUSE}
|
---|
71 | exit 0
|
---|
72 | fi
|
---|
73 | if test -f /etc/redhat-release; then
|
---|
74 | yum install -y bzip2 gcc-c++ glibc-devel gzip libcap-devel \
|
---|
75 | libIDL-devel libxslt-devel libXmu-devel \
|
---|
76 | make mkisofs openssl-devel pam-devel \
|
---|
77 | python-devel qt-devel rpm-build \
|
---|
78 | wget kernel kernel-devel \
|
---|
79 | tar libpng-devel | egrep -v "${egrepignore}"
|
---|
80 | # Not EL5
|
---|
81 | if ! grep -q "release 5" /etc/redhat-release; then
|
---|
82 | yum install libcurl-devel libstdc++-static libvpx-devel \
|
---|
83 | pulseaudio-libs-devel SDL-static texlive-latex texlive-latex-bin \
|
---|
84 | texlive-ec texlive-collection-fontsrecommended
|
---|
85 | texlive-pdftex-def texlive-fancybox device-mapper-devel \
|
---|
86 | glibc-static zlib-static glibc-devel.i686 libstdc++.i686 \
|
---|
87 | qt5-qttools-devel qt5-qtx11extras-devel | egrep -v "${egrepignore}"
|
---|
88 | if test -n "$WITHDOCS"; then
|
---|
89 | yum install texlive-latex texlive-latex-bin texlive-ec \
|
---|
90 | texlive-pdftex-def texlive-fancybox device-mapper-devel |
|
---|
91 | egrep -v "${egrepignore}"
|
---|
92 | if test ! -f /usr/share/texmf/tex/latex/bera/beramono.sty; then
|
---|
93 | mkdir -p /usr/share/texmf/tex/latex/bera
|
---|
94 | pushd /usr/share/texmf/tex/latex/bera
|
---|
95 | wget http://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/bera/beramono.sty
|
---|
96 | texhash
|
---|
97 | popd
|
---|
98 | fi
|
---|
99 | fi
|
---|
100 | fi
|
---|
101 | # EL5
|
---|
102 | if grep -q "release 5" /etc/redhat-release; then
|
---|
103 | yum install -y curl-devel SDL-devel libstdc++-devel.i386 \
|
---|
104 | openssh-clients which gcc44-c++ | egrep -v "${egrepignore}"
|
---|
105 | ln -sf /usr/bin/gcc44 /usr/local/bin/gcc
|
---|
106 | ln -sf /usr/bin/g++44 /usr/local/bin/g++
|
---|
107 | if ! rpm -q python26 > /dev/null; then
|
---|
108 | pythonpkgs="\
|
---|
109 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/python26-2.6.8-2.el5.x86_64.rpm \
|
---|
110 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/python26-libs-2.6.8-2.el5.x86_64.rpm \
|
---|
111 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/python26-devel-2.6.8-2.el5.x86_64.rpm
|
---|
112 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/libffi-3.0.5-1.el5.x86_64.rpm"
|
---|
113 | tmpdir=`mktemp -d`
|
---|
114 | pushd ${tmpdir}
|
---|
115 | wget ${pythonpkgs}
|
---|
116 | rpm -i *.rpm
|
---|
117 | popd
|
---|
118 | rm -r ${tmpdir}
|
---|
119 | ln -sf /usr/bin/python2.6 /usr/local/bin/python
|
---|
120 | fi
|
---|
121 | if ! rpm -q SDL_ttf-devel > /dev/null; then
|
---|
122 | sdlpkgs="\
|
---|
123 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/SDL_ttf-2.0.8-3.el5.x86_64.rpm \
|
---|
124 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/SDL_ttf-devel-2.0.8-3.el5.x86_64.rpm"
|
---|
125 | tmpdir=`mktemp -d`
|
---|
126 | pushd ${tmpdir}
|
---|
127 | wget ${sdlpkgs}
|
---|
128 | rpm -i *.rpm
|
---|
129 | popd
|
---|
130 | rm -r ${tmpdir}
|
---|
131 | fi
|
---|
132 | if test ! -f /usr/local/include/pulse/pulseaudio.h; then
|
---|
133 | tmpdir=`mktemp -d`
|
---|
134 | pushd ${tmpdir}
|
---|
135 | wget --no-check-certificate https://freedesktop.org/software/pulseaudio/releases/pulseaudio-11.1.tar.gz
|
---|
136 | tar -x -z -f pulseaudio-11.1.tar.gz pulseaudio-11.1/src/pulse
|
---|
137 | mkdir -p /usr/local/include/pulse
|
---|
138 | cp pulseaudio-11.1/src/pulse/*.h /usr/local/include/pulse
|
---|
139 | popd
|
---|
140 | rm -r ${tmpdir}
|
---|
141 | fi
|
---|
142 | fi
|
---|
143 | fi
|
---|