Recipe: How to compile your own Deb package.. a Pidgin example

Posted: June 5th, 2012 | Author: | Filed under: Debian, Linux Mint, Ubuntu | Tags: , , , , , , | No Comments »

Recently I switched my communication machine from XP to Linux Mint. However I find Pidgin 2.10.2 which comes with Linux Mint Debian a tad unreliable. I thought I would make my own deb package, based on the latest distribution source.

Objective: Create Debian packages or .deb for private consumption from any source code.

Assumptions: You have superuser (su/sudo) privileges on the machine you want to make the Debian package.

Preparations (Getting the tools you need):"Make sure source is selected"

  1. Make sure you have “Source code” option checked in your Update Manager (Linux Mint specific)
  2. Check in /etc/apt/sources.list there is a deb-src testing main contrib non-free entry.
  3. Run apt-get update and apt-get upgrade to make sure you have the latest OS
  4. Get the build tools
    • sudo apt-get install autotools-dev
    • sudo apt-get install build-essential
  5. Get the Debian specific build tools
    • sudo apt-get install dh-make
    • sudo apt-get install devscripts

Get the source code and dependencies

  1. Grab the source code from:
  2. Uncompress the source code tar -xvf pidgin-2.10.4.tar.bz2
  3. Get the required dependencies sudo apt-get build-dep pidgin, this grabs the dependencies for the version that is in the repository, most of the time it should be enough for . releases. If you need anything extra, remember if you will need extra libraries via apt-get, remember to get the ones that have the -dev suffix

Configure the source code

  1. Run ./configure –help in the source directory to familiarize yourself with what options there are. In my case I found I want to add –enable-cyrus-sasl to enable the SASL feature.
  2. Run the Debian specific tools (this will create a few files that are needed to create the .deb package and they will be stored in the debian subdirectory in the source directory)
    1. dh_make -e -f ../pidgin-2.10.4.tar.bz2
    2. dpkg-depcheck -d ./configure –enable-cyrus-sasl Pay attention to the output of the required packages (Select them and Copy them)
    3. Modify control file in debian subdirectory. Append the required packages listed to the end of line 5 which starts with: Build-Depends:. Separate each package name with a comma. You can also fill in the URL of the package, licensing etc etc. These attributes will show up when you install the package via the software installation program eg GDebi, Synatpic etc

Compiling and Packaging

  • Run dpkg-buildpackage -rfakeroot to start the package compile

There is a good chance you will run into errors like below

If some of these files are left out on purpose then please add them to
POTFILES.skip instead of A file 'missing' containing this list of left out files has been written in the current directory.
Please report to
if [ -r missing -o -r notexist ]; then \
exit 1; \
make[2]: *** [check] Error 1
make[2]: Leaving directory `/home/username/pidgin-2.10.4/po'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/username/pidgin-2.10.4'

dh_auto_test: make -j1 check returned exit code 2
make: *** [build] Error 29
dpkg-buildpackage: error: debian/rules build gave error exit status 2

In cases like this you will need to add the missing files to the file POTFILES.skip in the /po subdirectory. Since POTFILES.skip has been edited, you will need to run dpkg-source –commit to make the commit the change in file. It will create a patch and ask for a filename, just put in any filename that strikes your fancy. Rerun dpkg-buildpackage -rfakeroot afterwards.

References: How to create a .deb package

Leave a Reply

You must be logged in to post a comment.