1 | #!/bin/sh -e
|
---|
2 |
|
---|
3 | #
|
---|
4 | # Copyright (C) 2018 Oracle Corporation
|
---|
5 | #
|
---|
6 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
7 | # available from http://www.virtualbox.org. This file is free software;
|
---|
8 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
9 | # General Public License (GPL) as published by the Free Software
|
---|
10 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
11 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
12 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
13 | #
|
---|
14 |
|
---|
15 | # What this script does:
|
---|
16 | usage_msg="\
|
---|
17 | Usage: `basename ${0}` [--no-docs]
|
---|
18 |
|
---|
19 | Install the dependencies needed for building VirtualBox on a Linux
|
---|
20 | system. Initial support for Enterprise Linux derivatives, additional
|
---|
21 | distributions will be added as needed. There are no plans to add
|
---|
22 | support for or to accept patches for distributions we do not package.
|
---|
23 | The \`--no-docs\' parameter is used to prevent installation of TeX
|
---|
24 | packages. Installing TeX is not supported on EL5, so the flag is
|
---|
25 | ignored there."
|
---|
26 |
|
---|
27 | # To repeat: there are no plans to add support for or to accept patches
|
---|
28 | # for distributions we do bot package.
|
---|
29 |
|
---|
30 | unset NODOCS
|
---|
31 | egrepignore=\
|
---|
32 | "Setting up Install Process|already installed and latest version|Nothing to do"
|
---|
33 |
|
---|
34 | usage()
|
---|
35 | {
|
---|
36 | echo "${usage_msg}"
|
---|
37 | exit "${1}"
|
---|
38 | }
|
---|
39 |
|
---|
40 | while test -n "${1}"; do
|
---|
41 | case "${1}" in
|
---|
42 | --no-docs)
|
---|
43 | NODOCS=1
|
---|
44 | shift ;;
|
---|
45 | -h|--help)
|
---|
46 | usage 0 ;;
|
---|
47 | *)
|
---|
48 | echo "Unknown parameter ${1}" >&2
|
---|
49 | usage 1 ;;
|
---|
50 | esac
|
---|
51 | done
|
---|
52 |
|
---|
53 | LC_ALL=C
|
---|
54 | export LC_ALL
|
---|
55 | PATH=/sbin:/usr/sbin:$PATH
|
---|
56 |
|
---|
57 | if test -f /etc/redhat-release; then
|
---|
58 | yum install -y bzip2 gcc-c++ glibc-devel gzip libcap-devel \
|
---|
59 | libIDL-devel libxslt-devel libXmu-devel \
|
---|
60 | make mkisofs openssl-devel pam-devel \
|
---|
61 | python-devel qt-devel rpm-build \
|
---|
62 | wget kernel kernel-devel \
|
---|
63 | tar libpng-devel | egrep -v "${egrepignore}"
|
---|
64 | # Not EL5
|
---|
65 | if ! grep -q "release 5" /etc/redhat-release; then
|
---|
66 | yum install libcurl-devel libstdc++-static libvpx-devel \
|
---|
67 | pulseaudio-libs-devel SDL-static texlive-latex texlive-latex-bin \
|
---|
68 | texlive-ec texlive-collection-fontsrecommended
|
---|
69 | texlive-pdftex-def texlive-fancybox device-mapper-devel \
|
---|
70 | glibc-static zlib-static glibc-devel.i686 libstdc++.i686 \
|
---|
71 | qt5-qttools-devel qt5-qtx11extras-devel | egrep -v "${egrepignore}"
|
---|
72 | if test -z "$NODOCS"; then
|
---|
73 | yum install texlive-latex texlive-latex-bin texlive-ec \
|
---|
74 | texlive-pdftex-def texlive-fancybox device-mapper-devel |
|
---|
75 | egrep -v "${egrepignore}"
|
---|
76 | if test ! -f /usr/share/texmf/tex/latex/bera/beramono.sty; then
|
---|
77 | mkdir -p /usr/share/texmf/tex/latex/bera
|
---|
78 | pushd /usr/share/texmf/tex/latex/bera
|
---|
79 | wget http://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/bera/beramono.sty
|
---|
80 | texhash
|
---|
81 | popd
|
---|
82 | fi
|
---|
83 | fi
|
---|
84 | fi
|
---|
85 | # EL5
|
---|
86 | if grep -q "release 5" /etc/redhat-release; then
|
---|
87 | yum install -y curl-devel SDL-devel libstdc++-devel.i386 \
|
---|
88 | openssh-clients which gcc44-c++ | egrep -v "${egrepignore}"
|
---|
89 | ln -sf /usr/bin/gcc44 /usr/local/bin/gcc
|
---|
90 | ln -sf /usr/bin/g++44 /usr/local/bin/g++
|
---|
91 | if ! rpm -q python26 > /dev/null; then
|
---|
92 | pythonpkgs="\
|
---|
93 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/python26-2.6.8-2.el5.x86_64.rpm \
|
---|
94 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/python26-libs-2.6.8-2.el5.x86_64.rpm \
|
---|
95 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/python26-devel-2.6.8-2.el5.x86_64.rpm
|
---|
96 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/libffi-3.0.5-1.el5.x86_64.rpm"
|
---|
97 | tmpdir=`mktemp -d`
|
---|
98 | pushd ${tmpdir}
|
---|
99 | wget ${pythonpkgs}
|
---|
100 | rpm -i *.rpm
|
---|
101 | popd
|
---|
102 | rm -r ${tmpdir}
|
---|
103 | ln -sf /usr/bin/python2.6 /usr/local/bin/python
|
---|
104 | fi
|
---|
105 | if ! rpm -q SDL_ttf-devel > /dev/null; then
|
---|
106 | sdlpkgs="\
|
---|
107 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/SDL_ttf-2.0.8-3.el5.x86_64.rpm \
|
---|
108 | http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/SDL_ttf-devel-2.0.8-3.el5.x86_64.rpm"
|
---|
109 | tmpdir=`mktemp -d`
|
---|
110 | pushd ${tmpdir}
|
---|
111 | wget ${sdlpkgs}
|
---|
112 | rpm -i *.rpm
|
---|
113 | popd
|
---|
114 | rm -r ${tmpdir}
|
---|
115 | fi
|
---|
116 | if test ! -f /usr/local/include/pulse/pulseaudio.h; then
|
---|
117 | tmpdir=`mktemp -d`
|
---|
118 | pushd ${tmpdir}
|
---|
119 | wget --no-check-certificate https://freedesktop.org/software/pulseaudio/releases/pulseaudio-11.1.tar.gz
|
---|
120 | tar -x -z -f pulseaudio-11.1.tar.gz pulseaudio-11.1/src/pulse
|
---|
121 | mkdir -p /usr/local/include/pulse
|
---|
122 | cp pulseaudio-11.1/src/pulse/*.h /usr/local/include/pulse
|
---|
123 | popd
|
---|
124 | rm -r ${tmpdir}
|
---|
125 | fi
|
---|
126 | fi
|
---|
127 | fi
|
---|