Mono 3.0.0 build on CentOS 6

Matt Mills picture Matt Mills · Nov 1, 2012 · Viewed 9.3k times · Source

I recently found myself needing to build Mono 3.0 for CentOS 6, with a request from my infrastructure guy to otherwise keep the system as close to CentOS as possible (i.e. no 3rd-party packages if possible).

Because there are currently no Mono 3.0 RPMs that I could find, I went through the exercise of building it from scratch, on a clean Minimal install of CentOS 6.3.

It is possible to build Mono 3.0 with no external packages on CentOS 6.3.

Answer

Matt Mills picture Matt Mills · Nov 1, 2012

Perform a CentOS 6.3 Minimal Install

ifup eth0

yum -y update
yum -y install glib2-devel
yum -y install libpng-devel
yum -y install libjpeg-devel 
yum -y install giflib-devel 
yum -y install libtiff-devel 
yum -y install libexif-devel 
yum -y install libX11-devel 
yum -y install fontconfig-devel 
yum -y install gettext 
yum -y install make 
yum -y install gcc-c++

# amusing hack to fix the mono make file

export echo=echo

# build libgdiplus
curl -O http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
bunzip2 libgdiplus-2.10.9.tar.bz2
tar xvf libgdiplus-2.10.9.tar
cd libgdiplus-2.10.9
./configure --prefix=/usr/local
make
make install

# build mono
curl -O http://download.mono-project.com/sources/mono/mono-3.0.0.tar.bz2
bunzip2 mono-3.0.0.tar.bz2
tar xvf mono-3.0.0.tar
cd mono-3.0.0
./configure --prefix=/usr/local
make
make install

# tell binfmt how to launch CLR executables
echo ':CLR:M::MZ::/usr/local/bin/mono:' > /proc/sys/fs/binfmt_misc/register