Ubuntu: Compile source files to deb files in 2 easy ways

There are many complaining that the software for ubuntu is not enough. However, indeed, there are various kinds of software, but in open-source only. For such ubuntu beginners, they are not able or don’t know how to install source files from different programmers. What a pity that a ubuntu user can’t install source files. Therefore, I would like to introduce 2 easy ways for programmers or even ubuntu beginners to compile software for different people and publicise them further-where, and encourage more people to play with ubuntu. Okay, let’s begin.

The first method, I don’t know whether using this way can really compile deb files for different ubuntu version, but at least it’s the quickest way and it compiles files for you to install back in the future.

First, ./configure

Second, make

Third, checkinstall

Then, that’s it.

The second method, the most common and formal way for compilation of ubuntu source codes.

First off, let’s install the necessary tools:
# apt-get install autotools-dev fakeroot dh-make build-essential

Then copy your source tree into a directory in /tmp:
# cp -r <name of the source folder> /tmp
# cd /tmp/
<name of the source folder>

Now let’s make the debian control files:
# dh_make
and pick Single for single binary, or whatever is appropriate for your project.

Edit the debian/control file and at least change the Maintainer and Description fields. There are a few other files you will probably want to edit.

Then run the following: (this has to be done as root)
# dpkg-buildpackage -rfakeroot

Looking at the debian/<name of the package>/DEBIAN/control file we can see that all the dependencies are proper thanks to the autoconf system. If we look in /tmp (one directory up) we see <name of the package>.deb which is ready to go!



WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )


您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s