How to Package Mono Applications for Debian/Ubuntu

Installing Mono 3.x in Ubuntu/Debian

Mono 3.x is too bleeding edge for Ubuntu 12.10. Grab preview packages from directhex's PPA this way (this will install 3.2.1):

sudo add-apt-repository ppa:directhex/monoxide

(If you use Ubuntu saucy 13.10, after adding the repository you need to edit the file /etc/apt/sources.list.d/directhex-monoxide-saucy.list and replace the word saucy with raring)

Then, after that:

sudo apt-get update && sudo apt-get dist-upgrade

This will also get you MonoDevelop 4.x if you had monodevelop installed before.

NOTE: directhex is not some random guy that created a PPA, he's part of the Debian/Ubuntu maintainer team of all the Mono and Mono-based packages. So using this is the most official way to upgrade your infrastructure.


And for the debian users out there: mono 3.0.6 and MonoDevelop 4.0.x is already available in debian testing. So what I recommend to get this is:

  1. Install debian testing (currently named debian jessie).
  2. Uninstall mono by doing sudo apt-get purge mono-runtime (after doing this, resist the temptation to do an sudo apt-get autoremove or you will break your system, something which I reported as a bug here).
  3. Modify /etc/apt/sources.list, locate the first line that mentions the main source, and rename the word jessie to sid.
  4. Do sudo apt-get update.
  5. Install monodevelop via sudo apt-get install monodevelop, which will pull mono as a dependency too.
  6. Revert what you did in step 3.
  7. Do step 4 again.

This way you have a more or less modern distro (as opposed to debian stable), plus very very modern mono packages (the bleeding edge versions for Mono are normally pretty stable).

F# users: Mono 3.0.6 has a bug that prevents this language to work in this version, please use Mono 3.2.x instead.

How do I package my linux application using MonoDevelop?

Debian packages are like tar files - they contain a copy of the file system. To create a Debian package...

  1. Install the tarball in a build directory.
  2. Add a DEBIAN directory with the control files. I found this article helpful.
  3. Create the package with dpkg --build.

I would start by learning GNU's autotools: autoconf and automake. They make it very easy to install the program in a build directory. You mentioned ./configure. So I assume ythis project already has some of the structure. From the description, it sounds like the project might need...

  • Entries in configure.in for files in "book" and "glade".
  • Makefile.am files in "book" and "glade".

Putting it all together, the following commands result in a package file named project.deb.


# ./configure --prefix build/usr
# make && make install
# dpkg --build build project.deb

Building a debian package for Mono GTK# app that doesn't rely on xamarin assemblies?

You can make your package dependent upon one (or more) of the libmono-xxxx packages that are available from Xamarin/Mono:

i.e.

libmono-corlib4.5-cil_4.0.5.1-0xamarin1_all.deb

That would require that you have the Mono-Project repos added to one of your /etc/apt/sources.list.d/ files....

Ref: http://download.mono-project.com/repo/debian/pool/main/m/mono/

Other than that, you would need to build, if possible, and package your project to ref. the Mono that is available in the std. Debian repo; i.e. 3.2.8

How to install mono 3 on Debian testing?

I have used packages from stable Debian release to build UE.

In order to install libmono-corlib4.0-cil from stable:

  1. Add stable package repository into your /etc/apt/sources.list
  2. Run sudo apt-get update
  3. Install aptitude if you don't have it
  4. Run sudo aptitude -t stable install libmono-corlib4.0-cil

If you have some packages newer then libmono-corlib4.0-cil requires, aptitude will report an error and ask you what to do. In one of the solutions it will suggest to downgrade those packages to appropriate version. Use that solution and you will get libmono-corlib4.0-cil installed.

You may also edit file Engine/Build/BatchFiles/Linux/Setup.sh inside your directory with UE sources and replace line (should be 78th)

sudo apt-get install -y $DEP

with

sudo aptitude -t stable install $DEP

And then rerun Setup.sh script. This may help you avoiding similar problems with other packages required by UE.

There may be a way to do everything with apt-get, but I don't know it.

And I'm afraid this way won't allow you to have both versions of mono-runtime



Related Topics



Leave a reply



Submit