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

Re: Need some tips on building Debian packages



Le Fri, May 30, 2008 at 03:07:57PM -0500, Paul Johnson a écrit :
> 
> I keep wondering, "If the goal is to re-distribute 'pristine' source
> code and patches, why doesn't Debian discourage users from untarring
> the sourced code?"    Why can't you make it so the debian directory is
> not inside the source tree?  One response I've received is that "we
> are not RedHat, try to get over it."

Dear Paul,

There are ways to build a package without untarring the source code;
they usually work by indicating a path to the .dsc file to programs that
will build the binary packages in a chroot, such as pbuilder (or its
faster cousin cowbuilder), sbuild, ...

But because of the way the .dsc file contains md5sums of the other
components of the source package, I do not know an easy procedure to
edit the diff.gz patch, or the format '2.0' / '3.0 (quilt)' tar archives
that contain the debian directory, and re-generate the .dsc file. (Any
hint from other readers of the list?)

One possible way to go is simply to work in a clean unpacked source
package, regenerate the source package in the parent directory using the
-S option of dpkg-buildpackage, and use cowbuilder or sbuild. It is
quite fast actually.

For long-term work, as you read in many answers, we often use a version
control system. For packages one does not maintain, it is increasingly
possible to benefit from this approach by using the `debcheckout'
command, if the maintainer have published the URL of their repository.

If you make a package from scratch, then you will definitely have to
work out the clean rule of the debian/rules makefile so that after
building the binary packages and running 'fakeroot debian/rules clean',
the directory tree is identical to its starting state. This is not the
most funny part of the packaging, but workarounds such as the use of
chroot building systems or version control systems will allow you to
procrastinate it if you want.

Lastly, to answer your original question, the possibility to build the
source and binary packages from the untarred sources in which the debian
dir has been transferred is quite useful when the compilation is time
consuming and the bug in the packaging is downstream of it.

Have a nice day, and welcome in Debian !

-- 
Charles Plessy
http://charles.plessy.org
Wakō, Saitama, Japan


Reply to: