MONO&MONODEVELOP CENTOS 5.5 & 6 部署手册

mono是linux环境下的.net环境,官方版本为opensuse,ubuntu和fedara下面也有人成功安装。项目上需要在centos 64bit服务器上安装,三天时间搞定,以下就是安装过程。

gtk环境安装

# echo "/opt/gtk/lib" > /etc/ld.so.conf.d/gtk.conf
# export LD_LIBRARY_PATH=/opt/gtk/lib:$LD_LIBRARY_PATH 
# export PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig:$PKG_CONFIG_PATH
# ldconfig
# wget http://ftp.acc.umu.se/pub/gnome/sources/glib/2.19/glib-2.19.10.tar.gz
# tar xvfz glib-2.19.10.tar.gz
# cd glib-2.19.10
# ./configure --prefix=/opt/gtk
# make && make install
# wget http://ftp.acc.umu.se/pub/gnome/sources/atk/1.9/atk-1.9.1.tar.bz2
# tar xvfj atk-1.9.1.tar.bz2 
# cd atk-1.9.1
# ./configure --prefix=/opt/gtk
# make && make install
# wget http://cairographics.org/releases/pixman-0.22.2.tar.gz
# tar xvfz pixman-0.22.2.tar.gz 
# cd pixman-0.22.2  
# ./configure --prefix=/opt/gtk
# make && make install
# wget http://cairographics.org/releases/cairo-1.8.10.tar.gz
# tar xvfz cairo-1.8.10.tar.gz 
# cd cairo-1.8.10
# ./configure --prefix=/opt/gtk
# make && make install
# wget http://ftp.acc.umu.se/pub/gnome/sources/pango/1.27/pango-1.27.1.tar.bz2
# tar xvfj pango-1.27.1.tar.bz2 
# cd pango-1.27.1
# ./configure --prefix=/opt/gtk
# make && make install
# wget http://ftp.acc.umu.se/pub/gnome/sources/gtk+/2.15/gtk+-2.15.5.tar.gz
# cd gtk+-2.15.5
# ./configure --prefix=/opt/gtk --with-x --without-libjasper
# make
# make install

如果操作系统为centos5.5的话,gtk版本为2.10,而monodevelop运行环境必须为2.12。
如果操作系统为centos6的话,gtk版本为2.18,不必编译gtk.

# echo "/opt/gtk/lib64" > /etc/ld.so.conf.d/gtk.conf
# ldconfig

mono环境安装
添加mono官方yum源

# cat << EOF > /etc/yum.repos.d/mono.repo
[mono]
name = novell-mono
baseurl=http://ftp.novell.com/pub/mono/download-stable/RHEL_5
enabled=1
gpgcheck=0
EOF
 
# # yum -y install mono-addon-data mono-addon-web mono-addon-core mono-addon-devel mono-addon-winforms mono-addon-wcf mono-addon-libgdiplus0 mono-addon-debugger
# yum -y install mono-addon-data-sqlite mono-addon-extras mono-addon-nunit mono-addon-locale-extras monodoc-addon-core monotools-addon-server mono-addon-xsp mono-addon-data-oracle

设置环境变量

# export PKG_CONFIG_PATH=/opt/novell/mono/lib64/pkgconfig:/opt/novell/mono/lib/pkgconfig:$PKG_CONFIG_PATH
# export LD_LIBRARY_PATH=/opt/novell/mono/lib64:$LD_LIBRARY_PATH
# export PATH=/opt/novell/mono/bin:$PATH
在以下安装过程中,环境变量必须存在。

测试

# mono -V
Mono JIT compiler version 2.10.2 (tarball Mon Apr 18 19:06:50 UTC 2011)
Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com
TLS:           __thread
SIGSEGV:       altstack
Notifications: epoll
Architecture:  amd64
Disabled:      none
Misc:          debugger softdebug 
LLVM:          supported, not enabled.
GC:            Included Boehm (with typed GC and Parallel Mark)

oracle client安装

# rpm -ihv oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm
# rpm -ihv oracle-instantclient11.2-devel-11.2.0.1.0-1.x86_64.rpm

monodevelop安装
预安装

# yum install -y make automake glibc-devel gcc-c++ gcc glib2-devel pkgconfig subversion bison gettext-libs autoconf httpd httpd-devel libtool wget libtiff-devel libexif-devel libexif libjpeg-devel atk-devel
giflib-devel gettext-devel xulrunner-devel 
# yum -y install libpng-devel libjpeg-devel giflib-devel libtiff-devel libX11-devel freetype-devel fontconfig-devel
# yum -y install pango pango-devel gtk2-devel libglade2-devel
# yum -y install libgnome-devel libgnomecanvas-devel libgnomeui-devel libgnomeprint22-devel libgnomeprintui22-devel gnome-panel-devel gtkhtml3-devel gtkhtml2-devel compat-gtkhtml38-devel librsvg2-devel vte-devel libvte-java-devel

建立安装目录

# mkdir /root/monodevelop

安装gtk-sharp

# wget http://ftp.novell.com/pub/mono/sources/gtk-sharp212/gtk-sharp-2.12.10.tar.bz2
# tar xvfj gtk-sharp-2.12.10.tar.bz2
# cd /root/monodevelop/gtk-sharp-2.12.10
# ./configure --prefix=/opt/novell/mono
# make && make install

安装mono-addins

# wge thttp://ftp.novell.com/pub/mono/sources/mono-addins/mono-addins-0.5.tar.bz2
# tar xvfj mono-addins-0.5.tar.bz2
# cd /root/monodevelop/mono-addins-0.5
# ./configure --prefix=/opt/novell/mono
# make && make install

安装gnome-sharp

# wget http://ftp.novell.com/pub/mono/sources/gnome-sharp2/gnome-sharp-2.24.1.tar.bz2
# tar xvfj gnome-sharp-2.24.1.tar.bz2
# cd /root/monodevelop/gnome-sharp-2.24.1
# ./configure --prefix=/opt/novell/mono

编译gnome-sharp-2.24.1有个bug,报错"error CS0006: Metadata file
`Mono.GetOptions.dll' could not be found",官网有解释
http://go-mono.com/forums/#nabble-td2969455
注释/root/monodevelop/gnome-sharp-2.24.1/sample/gnomevfs/Makefile,第221,449,450行

# sed -i '211s/^/#/' /root/monodevelop/gnome-sharp-2.24.1/sample/gnomevfs/Makefile
# sed -i '449s/^/#/' /root/monodevelop/gnome-sharp-2.24.1/sample/gnomevfs/Makefile
# sed -i '450s/^/#/' /root/monodevelop/gnome-sharp-2.24.1/sample/gnomevfs/Makefile

# make && make install

安装monodevelop-database

# wget http://ftp.novell.com/pub/mono/sources/monodevelop-database/monodevelop-database-2.4.tar.bz2
# tar xvfj monodevelop-database-2.4.tar.bz2
# cd monodevelop-database-2.4
# ./configure --prefix=/opt/novell/mono
# make && make install

安装monodevelop-debugger-gdb

# wget http://ftp.novell.com/pub/mono/sources/monodevelop-debugger-gdb/monodevelop-debugger-gdb-2.4.tar.bz2
# tar xvfj monodevelop-debugger-gdb-2.4.tar.bz2
# cd monodevelop-debugger-gdb-2.4
# ./configure --prefix=/opt/novell/mono
# make && make install

安装monodevelop-debugger-mdb

# wget http://ftp.novell.com/pub/mono/sources/monodevelop-debugger-mdb/monodevelop-debugger-mdb-2.4.tar.bz2
# tar xvfj monodevelop-debugger-mdb-2.4.tar.bz2
# cd monodevelop-debugger-mdb
# ./configure --prefix=/opt/novell/mono
# make && make install

安装monodevelop

# wget http://ftp.novell.com/pub/mono/sources/monodevelop/monodevelop-2.4.2.tar.bz2
# tar xvfj monodevelop-2.4.2.tar.bz2
# cd monodevelop-2.4.2
# ./configure --prefix=/opt/novell/mono
# make && make install

建立执行脚本runMonodevelop.sh

# cat << EOF > /opt/novell/mono/bin/runMonodevelop.sh
MONO_PREFIX=/opt/novell/mono
GNOME_PREFIX=/usr
export DYLD_LIBRARY_FALLBACK_PATH=\$MONO_PREFIX/lib:\$MONO_PREFIX/lib64:\$DYLD_LIBRARY_FALLBACK_PATH
export LD_LIBRARY_PATH=\$MONO_PREFIX/lib:\$MONO_PREFIX/lib64:/usr/lib/oracle/11.2/client64/lib:\$LD_LIBRARY_PATH
export C_INCLUDE_PATH=\$MONO_PREFIX/include:\$GNOME_PREFIX/include
export ACLOCAL_PATH=\$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=\$MONO_PREFIX/lib/pkgconfig:\$GNOME_PREFIX/lib/pkgconfig:\$MONO_PREFIX/lib64/pkgconfig:\$GNOME_PREFIX/lib64/pkgconfig
export PATH=\$MONO_PREFIX/bin:\$PATH
export NLS_LANG=AMERICAN_AMERICA.UTF8
export XDG_DATA_HOME=\$MONO_PREFIX/share:\$XDG_DATA_HOME
export XDG_DATA_DIRS=\$MONO_PREFIX/share:\$XDG_DATA_DIRS
monodevelop
EOF
# chmod 755 /opt/novell/mono/bin/runMonodevelop.sh
This entry was posted in OS. Bookmark the permalink.

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s