[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: source packages


How to adjust a source package to build using specific additional
configure flags:

On Tue, Jan 25, 2005 at 11:01:32AM +0100, Predrag Gavrilovic wrote:
> Suppose there is binary package that is built without some option (i.e
> --without-ldap) and I would like to have it with that option
> (--with-ldap).

OK, first make sure the package maintainer doesn't provide an
alternate package version. If (s)he does and it supports what you seek
all is well, if (s)he doesn't proceed here.

If you think that particular option really really needs to be set then
file a wishlist bug against the package explaining your reasons and
hope for the maintainer to cooperate quickly.

> Is there a way to apt-source package, change configure options and then
> build regular deb package. I have found examples of dpkg-buldpackage,
> but those examples do not change anything, so at best I would end up
> with deb package same as already available on CD.

Lines starting with '#' need to be executed as root, or via sudo,
lines starting with '$' should be executed as a normal user.

Install the packages essential for building Debian packages:
# apt-get install build-essential

Add a 'source' URI in your /etc/apt/sources.list, e.g.
# echo deb-src http://ftp.de.debian.org/debian/ stable main contrib >> /etc/apt/sources.list
for stable / Woody from a mirror in Germany, adjust as necessary
matching your existing setup.

Retrieve new lists of packages
# apt-get update

Find what package produces the .deb you want to replace:
$ apt-cache showsrc <packagename> | grep ^Package

Install the specific build-dependencies for the package:
# apt-get build-dep <sourcepackagename>

Fetch the debianized sources:
$ apt-get source <sourcepackagename>

Change into the newly created directory, e.g.
$ cd <sourcepackagename>-<ver>

> Should I run ./configure in source directory and then build package with

That'd be too simple :)

> dpkg? I have noticed /debian/rules file, is that the place to change
> options?

Exactly, edit this file:
$ $EDITOR debian/rules
and add your configure options at the appropriate spot. Some packages
use a specific build system like yada or cdbs, in that case you'd need
to read their documentation.

Additionally edit the package changelog
$ $EDITOR debian/changelog
copy the last entry and edit it to reflect your changes, you might
want to specifically name your version.

> I would probably have to satisfy dependencies manualy, but it's Ok, it's
> one-time-only install.

You'd also need to manually install the build-dependencies which are
mising, i.e. if you want to add support for a specific option you'll
need to find and install the corresponding development headers.

Once all this is done, start:
$ dpkg-buildpackage -rfakeroot -uc -b
the resulting .deb will be placed in the parent directory.

If anything goes wrong when compiling you probably missed an
additional build-dependency. There are several goodies to simplify
this task, and some parts might need to be varied, but basically
that's the way to go.
Corrections / improvements are welcome.

> And another question, I am 99% shure that heimdal package is actually
> built with no support for LDAP (reading changelog, checking
> dependecies), but is there some more explicit way to find what options
> is some deb package built with?

Some maintainers document the compilation options when necessary, see
Otherwise it's often sufficient to look at the build log at
<http://buildd.debian.org>, if not you'll need to download the
debianized sources and look there.


Attachment: signature.asc
Description: Digital signature

Reply to: