|
| 1 | +#!/bin/bash -e |
| 2 | + |
| 3 | +TOPDIR=$(pwd) |
| 4 | +BUILDDIR=$TOPDIR/build |
| 5 | +PREFIX=/opt/mono-3.0 |
| 6 | + |
| 7 | +export PATH=$PREFIX/bin:$PATH |
| 8 | +export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH |
| 9 | +export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH |
| 10 | + |
| 11 | + |
| 12 | +echo "updating existing system" |
| 13 | +sudo apt-get update |
| 14 | +sudo apt-get upgrade -y |
| 15 | + |
| 16 | +echo "installing prerequisites" |
| 17 | +sudo apt-get install -y build-essential libc6-dev g++ gcc libglib2.0-dev pkg-config git-core apache2 apache2-threaded-dev bison gettext autoconf automake libtool libpango1.0-dev libatk1.0-dev libgtk2.0-dev libtiff4-dev libgif-dev libglade2-dev curl |
| 18 | + |
| 19 | +mkdir -p $BUILDDIR |
| 20 | + |
| 21 | +echo |
| 22 | +echo "downloading mono packages" |
| 23 | +echo |
| 24 | + |
| 25 | +cd $BUILDDIR |
| 26 | + |
| 27 | +PACKAGES=("mono-3.0.7" |
| 28 | +"libgdiplus-2.10.9" |
| 29 | +"gtk-sharp-2.12.11" |
| 30 | +"xsp-2.10.2" |
| 31 | +"mod_mono-2.10") |
| 32 | + |
| 33 | +URLS=("http://download.mono-project.com/sources/mono/mono-3.0.7.tar.bz2" |
| 34 | +"http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2" |
| 35 | +"http://download.mono-project.com/sources/gtk-sharp212/gtk-sharp-2.12.11.tar.bz2" |
| 36 | +"http://download.mono-project.com/sources/xsp/xsp-2.10.2.tar.bz2" |
| 37 | +"http://download.mono-project.com/sources/mod_mono/mod_mono-2.10.tar.bz2") |
| 38 | + |
| 39 | + |
| 40 | +echo Downloading |
| 41 | +count=${#PACKAGES[@]} |
| 42 | +index=0 |
| 43 | +while [ "$index" -lt "$count" ] |
| 44 | +do |
| 45 | + #only download it if you don't already have it. |
| 46 | + if [ ! -f "${PACKAGES[$index]}.tar" -a ! -f "${PACKAGES[$index]}.tar.gz" ] |
| 47 | + then |
| 48 | + curl -O "${URLS[@]:$index:1}" |
| 49 | + fi |
| 50 | + |
| 51 | + #extract |
| 52 | + if [ -f "${PACKAGES[$index]}.tar.gz" ] |
| 53 | + then |
| 54 | + tar -zxvf "${PACKAGES[$index]}.tar.gz" |
| 55 | + fi |
| 56 | + if [ -f "${PACKAGES[$index]}.tar.bz2" ] |
| 57 | + then |
| 58 | + bunzip2 -df "${PACKAGES[$index]}.tar.bz2" |
| 59 | + fi |
| 60 | + if [ -f "${PACKAGES[$index]}.tar" ] |
| 61 | + then |
| 62 | + tar -xvf "${PACKAGES[$index]}.tar" |
| 63 | + fi |
| 64 | + |
| 65 | + let "index = $index + 1" |
| 66 | +done |
| 67 | + |
| 68 | + |
| 69 | +echo |
| 70 | +echo "building mono packages" |
| 71 | +echo |
| 72 | + |
| 73 | +for i in "${PACKAGES[@]}" |
| 74 | +do |
| 75 | + cd $BUILDDIR/$i |
| 76 | + ./configure --prefix=$PREFIX |
| 77 | + make |
| 78 | + |
| 79 | + if [ "$i" = ${PACKAGES[0]} ] |
| 80 | + then |
| 81 | + sudo make install |
| 82 | + fi |
| 83 | +done |
| 84 | + |
| 85 | +echo |
| 86 | +echo "installing mono packages" |
| 87 | +echo |
| 88 | + |
| 89 | +for i in "${PACKAGES[@]:1}" |
| 90 | +do |
| 91 | + cd $BUILDDIR/$i |
| 92 | + sudo make install |
| 93 | +done |
| 94 | + |
| 95 | +cd $BUILDDIR |
| 96 | +echo |
| 97 | +echo "done" |
| 98 | + |
| 99 | + |
0 commit comments