This documentation will briefly summarize how to build packages. At the time of writing this, we focused on packages for Debian etch and lenny in i386 and amd64 variants.
Setting up pbuilder environment
Install needed packages
To be able to build packages you need to install a few packages from the repositories:
apt-get install pbuilder fakeroot
Additionally, you need to get the
LATEST version of
debootstrap from Debian and install it manually. At the time of writing this, these steps were needed:
- The page showed that the latest version was 1.0.10 (lenny), following that link one got to the package summary page
- On that page there is a link to the download page (table at the bottom), follow it!
- Download from one of the mirrors, e.g. http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.10_all.deb:
wget -q http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.10_all.deb
- Install this package via
dpkg -i debootstrap_1.0.10_all.deb
Prepare build environment
In this example we use
/local/build
as our build location. Our configuration files (attached to this page, see below) already reflect this.
Please run the following commands:
export BUILD_PLACE=/local/build
make -p $BUILD_PLACE
cd $BUILD_PLACE
mkdir aptcache base build config result source
Create build environments
Creating the initial build environments is easy, usually this should only be run once:
cd $BUILD_PLACE; for i in `ls config`; do pbuilder create --configfile config/$i; done
Update build environments
It seems that this is necessary quite often (especially when you first build a package which is then needed by another package).
To do that you need a hook "D70localdebs". Just create a script in your hook directory and chmod it to be executable.
#!/bin/bash
LOCALPATH="where_you_store_your_debs"
echo "HOOK D70 update pckages... $LOCALPATH"
cd $LOCALPATH
/usr/bin/dpkg-scanpackages . /dev/null > $LOCALPATH/Packages
echo "deb file://$LOCALPATH/ ./" >> /etc/apt/sources.list
apt-get update
It is up to you to use local paths or local repository (reprepro).
reprepro
I assume that the repository goes into /srv/repository.
- Install reprepro:
aptitude install reprepro
-
mkdir -p /srv/repository/conf
- create file
/srv/repository/conf/destributions
(maybe the "experimental" branch is not needed)
Codename: etch
Label: etch
Architectures: i386 amd64 source all
Components: contrib
DebIndices: Packages Release .bz2 .gz .
DscIndices: Sources Release . .gz .bz2
Contents: .bz2 .gz .
Description: Special packages (mostly LSC related) for Debian Etch 4.0
Codename: etch-experimental
Label: etch-experimental
Architectures: i386 amd64 source all
Components: contrib
DebIndices: Packages Release .bz2 .gz .
DscIndices: Sources Release . .gz .bz2
Contents: .bz2 .gz .
Description: Special packages (mostly LSC related) for Debian Etch 4.0 which are considered experimental
Codename: lenny
Label: lenny
Architectures: i386 amd64 source all
Components: contrib
DebIndices: Packages Release .bz2 .gz .
DscIndices: Sources Release . .gz .bz2
Contents: .bz2 .gz .
Description: Special packages (mostly LSC related) for Debian Lenny 5.0
Codename: lenny-experimental
Label: lenny-experimental
Architectures: i386 amd64 source all
Components: contrib
DebIndices: Packages Release .bz2 .gz .
DscIndices: Sources Release . .gz .bz2
Contents: .bz2 .gz .
Description: Special packages (mostly LSC related) for Debian Lenny 5.0 which are considered experimental
- To add libmetaio to the repository to "etch" run
reprepro -b /srv/repository/ include etch /tmp/libmetaio*changes
if the build goes wrong
If unfortunately something goes wrong, you may want to enter a shell instead of loging out and cleaning the build directory. For that you need another hook "C10shell".
#!/bin/bash
echo "HOOK C10shell - build fails - execute shell..."
apt-get install -y --force-yes vim less bash
cd /tmp/buildd/*/debian/..
/bin/bash < /dev/tty > /dev/tty 2> /dev/tty
TODO
--
CarstenAulbert - 20 Aug 2008