我最近发现自己需要为 CentOS 6 构建 Mono 3.0,我的基础架构人员要求我尽可能让系统尽可能接近 CentOS(即,如果可能,不要使用第 3 方软件包)。
因为目前我找不到 Mono 3.0 RPM,所以我在 CentOS 6.3 的干净最小安装上完成了从头开始构建它的练习。
可以在 CentOS 6.3 上构建没有外部软件包的 Mono 3.0。
执行 CentOS 6.3 最小安装
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
将tpokorra 存储库与mono 3.2.5 一起用于 Centos 6.x(和其他发行版)
将文件mono.repo放在包含内容的目录/etc/yum.repos.d/
中:
[home_tpokorra_mono]
name=mono and monodevelop (CentOS_CentOS-6)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/tpokorra:/mono/CentOS_CentOS-6/
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/tpokorra:/mono/CentOS_CentOS-6/repodata/repomd.xml.key
enabled=1
yum install mono-opt
http://software.opensuse.org/download/package?project=home:tpokorra:mono&package=mono-opt