HOWTO: Compile deb package from any source. eg. pidgin

Archived topics about LMDE 1 and LMDE 2
Locked
Godwin
Level 1
Level 1
Posts: 12
Joined: Tue Apr 24, 2012 6:07 pm

HOWTO: Compile deb package from any source. eg. pidgin

Post by Godwin »

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 you have "Source code" option checked in your Update Manager (Linux Mint specific)
Check in /etc/apt/sources.list there is a deb-src http://debian.linuxmint.com/incoming testing main contrib non-free entry.
Run apt-get update and apt-get upgrade to make sure you have the latest OS
Get the build tools
sudo apt-get install autotools-dev
sudo apt-get install build-essential

Get the Debian specific build tools
sudo apt-get install dh-make
sudo apt-get install devscripts


Get the source code and dependencies
Grab the source code from: Pidgin.im
Uncompress the source code tar -xvf pidgin-2.10.4.tar.bz2
Get the required dependencies sudo apt-get build-up 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
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.
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)
dh_make -e youremail@here.com -f ../pidgin-2.10.4.tar.bz2
dpkg-depcheck -d ./configure --enable-cyrus-sasl Pay attention to the output of the required packages (Select them and Copy them)
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

Code: Select all

If some of these files are left out on purpose then please add them to
POTFILES.skip instead of POTFILES.in. A file 'missing' containing this list of left out files has been written in the current directory.
Please report to devel@pidgin.im
if [ -r missing -o -r notexist ]; then \
exit 1; \
fi
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 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.

This is a repost from a post on my own blog (which I will keep updated).
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
craigevil

Re: HOWTO: Compile deb package from any source. eg. pidgin

Post by craigevil »

HowTo Build a Package from Source the Smart Way - http://forums.debian.net/viewtopic.php?f=16&t=38976
Locked

Return to “LMDE Archive”