Weblog entry #2 for debstar

Building a .deb package from source.
Posted by debstar on Fri 11 Aug 2006 at 13:56
Tags:
Dear all, here is my 2c tips.

Firstly, let me tell you the reasons for which I need to build a package from source :
  1. I use Debian Sarge with a quite outdated package version,
  2. I need to install a recent version,
  3. using the apt tools is preferred,
  4. downloading a .deb file and install it doesn't work because of dependencies.

You may also need to build a package in unstable or testing version if for one reason or another, a recent version is required.

The package in question is Squid because in 2.5.x versions, the authentication scheme used for parent proxy is only Basic HTTP. However NEGOTIATE, KERBEROS and NTLM handling exist only in 2.6.x+ versions.
The 2.5.x versions worked for me before because my parent proxy was an MS-Proxy then MS ISA 2000. Now, they changed it into MS ISA 2004 without the Basic HTTP authentication scheme (security policy) so the need to upgrade.

This example is to build the .deb packages for the last stable version of Squid, at this writing 2.6.1-3. You need to download the files advised by http://packages.debian.org. I choosed the testing version in lieu of unstable because the version in testing is now the stable version of Squid. The files are : squid_2.6.1-3.diff.gz, squid_2.6.1.orig.tar.gz and squid_2.6.1-3.dsc

Issue the command :
$ cat squid_2.6.1-3.dsc
and you'll find the developpement libraries required to build the packages. For me I had to install these :
# apt-get install libpam0g-dev libldap2-dev dpatch po-debconf libdb4.3-dev fakeroot


Here is the steps to build the .deb files needed :
$ dpkg-source -x squid_2.6.1-3.dsc
$ cd squid-2.6.1/
$ gunzip -c ../squid_2.6.1-3.diff.gz| patch
$ fakeroot debian/rules binary

All the binary packages are in parent directory, Actually :
$ ls ../*deb
squid_2.6.1-3_i386.deb
squid-cgi_2.6.1-3_i386.deb
squidclient_2.6.1-3_i386.deb
squid-common_2.6.1-3_all.deb


The next step is to put these .deb files somewhere and update the apt database :
Insert this line in your /etc/apt/source.list. For one liners :
# echo "deb file:/home/debstar/mirror ./" >> /etc/apt/sources.list

$ mv *deb /home/debstar/mirror
$ dpkg-scanpackages /home/debstar/mirror /dev/null | gzip -f9 > /home/debstar/mirror/Packages.gz
# apt-get update
# apt-get install squid-common squid


Et voilà, it may complains of a bash script not found : log_daemon_msg but at least you are now using a recent stable release without upgrading to Sid.


$Id: Signature $
Nirina Michel RATOANDROMANANA

Debian is my 80/20 way.

 

Comments on this Entry

Posted by JulienV (86.218.xx.xx) on Fri 11 Aug 2006 at 16:03
[ Send Message | View Weblogs ]

Just to mention useful tools that I use for such cases:

  • dget - Download Debian source and binary packages
  • apt-get build-dep - causes apt-get to install/remove packages in an attempt to satisfy the build dependencies for a source package.
  • pbuilder - personal package builder for Debian packages
Thanks for your entry ;-)

Cheers,
Julien

[ Parent | Reply to this comment ]

Posted by Anonymous (192.115.xx.xx) on Tue 22 Aug 2006 at 10:36
Thanks for the tip.
I use checkinstall if I want to create debs for packages which uses plain compilation processes (./configure; make; make test; make install).

Ofer Shaked.

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search