[vox-tech] Debian Package Tools

Ken Bloom kabloom at ucdavis.edu
Tue Jan 11 09:54:16 PST 2005


On Tue, 11 Jan 2005 00:24:41 -0800
Richard Harke <rharke at earthlink.net> wrote:

> On Monday 10 January 2005 22:42, Ken Bloom wrote:
> > On Mon, 10 Jan 2005 20:19:17 -0800
> >
> > Richard Harke <rharke at earthlink.net> wrote:
> > > On Monday 10 January 2005 08:57, Ken Bloom wrote:
> > > > On Sun, Jan 09, 2005 at 10:44:10PM -0800, Richard Harke wrote:
> > > > > I have downloaded a source package and I'm trying to get it
> > > > > set up to look at. I used apt-get source package-name
> > > > > Now I have a directory with a diff.gz, a .dsc and a
> > > > > orig.tar.gz There is also a sub-directory with 3 .bz2 files, a
> > > > > shell script called prep.sh and a version file. Also a
> > > > > sub-directory called debian. At this point everything is very
> > > > > old, June 2003. Clearly patches have not been applied.
> > > > >
> > > > > Isn't there a debian tool for extracting the entire source
> > > > > archive into its usual tree and applying the patches? I've
> > > > > tried dpkg-source -x name.dsc but what I described is what I
> > > > > get. Running prep.sh does unpack a couple of the bz2 files but
> > > > > does not apply the patches.
> > > > >
> > > > > Along with wanting to look at this source, I am trying to
> > > > > learn to use the debian tools better.
> > > >
> > > > The diff.gz, the .dsc, and the .orig.tar.gz are the files that
> > > > Debian's packaging tools know about. Together, they are used by
> > > > the tool dpkg-source to create the directory you recieved.
> > > >
> > > > There are two common ways a build directory is laid out. One is
> > > > to have the .orig.tar.gz be the upstream sources, and the
> > > > diff.gz contains the debian/ directory and it may contain
> > > > modifications made to the upstream source code. (Or these
> > > > modifications may be stored in patch files in the
> > > > debian/directory, in which case the diff.gz contains them as a
> > > > diff within a diff)
> > > >
> > > > The other common way that a build directory is laid out is
> > > > "tarball within a tarball" form. This is what you've got here.
> > > > This is created and managed with the "dbs" build system (apt-get
> > > > install dbs) and small example of a dbs-packaged package is
> > > > hello-dbs. (I'm not sure, but there might also be other systems
> > > > that do this). There should be a rule in debian/rules (or in a
> > > > makefile included by debian/rules) whose job is to unpack the
> > > > interior tarball and apply the patches. In the case of dbs, this
> > > > rule is named "setup", and to get the expanded build tree you
> > > > need to run the following from inside the directory.
> > > >
> > > > $ debian/rules setup
> > >
> > > I tried this but I get the "no rule for target" error
> > > There are some comments in the rules file about unpacking and
> > > building. I guess the steps are to be carried out manually. The
> > > prep.sh script appears to unpack but does not apply patches.
> > > Interestingly, prep.sh does contain a "subroutine" for patching
> > > but it is not called.
> >
> > What package are you trying to do this to?
> This is glibc for ia64

I'm working with this from the maintainers' svn repository at
http://svn.debian.org/wsvn/pkg-glibc/glibc-package/trunk/debian/?rev=0&sc=0

1. I checked the build dependancies in debian/control. There's nothing
in there that looks like a build system. (e.g. dbs or cdbs) This means
that everything is self-contained in the debian/directory

2. There is a file debian/rules.d/tarball.mk (debian/rules will include
this file)

3. In that file, there is a rule 

unpack: $(stamp)unpack
$(stamp)unpack: $(DEB_TARBALL) $(patsubst %,$(stamp)%,$(GLIBC_OVERLAYS))
        touch $(stamp)unpack

so you want to run 
$ debian/rules unpack

4. Now for the patches, there's another file debian/rules.d/dpatch.mk
(debian/rules will include this file)

It has 2 rules: patch and unpatch
so you want to run also
$ debian/rules patch

(If you're doing lots of things with patches, you may find the unpatch
target useful)

-- 
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ns1.livepenguin.com/pipermail/vox-tech/attachments/20050111/43cc5ea3/attachment.bin


More information about the vox-tech mailing list