Subscribe to this blog


In this article, I will summarize here what is needed to build Bitlbee 3.0 for 64 bit and how to rebuild a package in general.

For proper building of a package, you should have "dpkg-buildpackage" installed, which you can get using

aptitude install dpkg-dev

Then you should install all the needed dependencies for the package you're planning to build. Either you know them or you look them up in the README of your package. The debian-ic way would be

apt-get build-dep <package>

Having said this you have to make sure that the new version of your package has no additional dependencies. For Bitlbee, just download the source you find in my blog article.

I now assume that you have your new source available. Do an

apt-get source <package>

to fetch the "debian" directory of the package you want to build. The debian directory is a special directory containing information about how to build the package. If you choose to backport a package, copy the debian-directory from the just downloaded source to the source of the new version.

You now have to look into three files which are in the debian directory (not necessary if your just rebuilding Bitlbee for 64 bit):

  • control: are all dependencies met (have a look at this file, it should be self-explanatory)
  • debian/rules: ideally, there are rules like build: install: etc. If you never have looked into a Makefile, you should not make any changes.\ For Bitlbee, I had to modify some of the ./configure arguments in order to includeOTR.
  • changelog: This one tracks the changes as well as the version numbers. You need to add a new entry at the top, looking similar to this:

    accessodf (3.0~b-1) unstable; urgency=low
    
      * backport of the package for Debian Squeeze
      * included OTR support.
    
     -- Sebastian Humenda <nospam@thanks.com>  Mon, 21 Mai 2012 14:21:13 +0200
    

    Please be careful with the spaces, all of them must be entered exactly as shown. (two before the "*", else always one space)\ Some hints on versioning:

    • The Debian version is always the last part of the number and begins with the "-". It's usually a 1.
    • The version is always something like major.minor.minorminor. By adding a "\~b", you make sure that your package is labeled with 3.0, but it has actually a lower priority than 3.0 (like a beta release). With this you make sure, that the Debian version of Bitlbee will be installed, when you upgrade.

When you have done all modifications to the debian directory (or none if not needed), you can build the package as follows (assuming you are in the source directory of your program):

dpkg-buildpackage

In the directory above (".."), you need the orig.tar.gz-file, which you got with the "aptitude source" command. Without this file dpkg will report an error. For Bitlbee it's http://crustulus.de/deb/bitlbee_3.0\~b-1.tar.gz.

If everything went fine, you will have some warnings on the screen and afterwards a Debian package in "..".

Congratulations!



Comments