Home > Uncategorized > Creating a Mono 3 RPM on CentOS

Creating a Mono 3 RPM on CentOS

Creating a Mono 3 RPM on CentOS

A quick guide to creating an rpm of mono 3 from source, starting with a CentOS 6.4 minimal using fpm to create the package.

  1. Install prerequisites for building mono 3

    yum -y update
    yum -y install glib2-devel libpng-devel libjpeg-devel giflib-devel libtiff-devel libexif-devel libX11-devel fontconfig-devel gettext make gcc-c++
  2. Download and extract libgdiplus and mono sources

    curl -O http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
    curl -O http://download.mono-project.com/sources/mono/mono-3.1.2.tar.bz2
    tar -jxf libgdiplus-2.10.9.tar.bz2
    tar -jxf mono-3.1.2.tar.bz2
  3. Configure, make, and make install

    cd libgdiplus-2.10.9
    ./configure --prefix=/opt/libgdiplus
    # overwrite incompatible libtool script in pixman
    cp libtool pixman/libtool 
    su -c "make install"
    cd mono-3.1.2
    ./configure --prefix=/opt/mono-3.1.2
    su -c "make install"
  4. Install ruby prerequisites for fpm, then fpm itself

    yum -y install ruby ruby-devel rubygems
    gem install fpm
  5. Make sure /etc/hosts contains your host name since it will be used in some fpm defaults.

    vi /etc/hosts
  6. Install rpm tools and generate the RPM

    yum -y install rpm-build
    fpm -s dir -t rpm -n "mono" -v 3.1.2 /opt/mono-3.1.2 /opt/libdgiplus

You probably will want to explore some other fpm options to customize your rpm further, like setting the maintainer, dependencies, or running pre/post install scripts.

Categories: Uncategorized Tags: , , ,
  1. David
    October 30, 2013 at 7:17 am

    Followed your procedure… Where are the RPMs?

    • loosexaml
      October 30, 2013 at 9:34 pm

      They should be created in the directory where you ran the fpm command. If you followed those steps, you should have a file named mono-3.1.2-1.x86_64.rpm.

  1. No trackbacks yet.

Leave a Reply

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 /  Change )

Google+ photo

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

Twitter picture

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

Facebook photo

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


Connecting to %s

%d bloggers like this: