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

Re: Advice about first package building (from sources)



On Tue, 16 Sep 2008 21:32:19 +0200
Laurent Guignard <lguignard2000@yahoo.fr> wrote:

> I have read the main documentation about pbuilder but i haven't seen if
> it is possible to build a package from upstream sources.
> In all examples, the command is like "pbuilder build ???.dsc"
> 
> What is the correct method to build a package from upstream sources ?

$ make dist
$ sudo pbuilder create
$ sudo pbuilder login

In a separate terminal window:
$ sudo cp foo-1.2.3.tar.gz /path/to/pbuilder/1234/

Back in the original terminal window (inside the chroot)
# tar -xzf foo-1.2.3.tar.gz
# apt-get install bar-dev
etc.
# ./configure
# make

> All this to keep a clean and stable Debian on my laptop ;)

Basically, all you need is to create a static chroot - you could do that with debootstrap instead of pbuilder. Then chroot into that environment and do whatever you need to do to get the source and the dependencies. You can then retain this chroot for later use if you use a simple debootstrap method. You might want to use the common method of putting such chroots in a new /jails/ directory. The entire build tree needs to be duplicated and all dependencies re-installed inside the chroot. It needs quite a large amount of space. The debootstrap itself is usually 180Mb, plus the build tree and all the duplicated build dependencies (including the build tools like autoconf etc.)

> Is there another method and where can i found documentation ?

$ man debootstrap

pbuilder is a convenient wrapper for disposable chroots that is designed for package building. What you want sounds more like a fixed chroot jail and that is best done with debootstrap (in exactly the same way as pbuilder does when you ask it to create a pbuilder .tgz.)

-- 

Neil Williams
========
http://www.linux.codehelp.co.uk

Attachment: pgpDIvDf7v786.pgp
Description: PGP signature


Reply to: