[Pbuilder-maint] How I make backports
Thomas Petazzoni
thomas.petazzoni at enix.org
Wed Oct 19 17:18:55 UTC 2005
Hi,
In
http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html#id2450011,
you're asking for feedback about how people are doing backports using
pbuilder. I'm not an official Debian developer, but I'm mainting a
couple of official and unofficial packages for sarge, ecth, sid and
hoary. Here's how I do this. It doesn't pretend to be the only solution
nor to be a clean solution. It works for me, it's a bit quick and
dirty, but maybe it'll be useful to others.
First of all, I of course have 4 pbuilder chroots, base-stable.tgz,
base-testing.tgz, base-unstable.tgz and base-hoary.tgz. Associated to
each chroot, I have a ~/.pbuilderrc.$DISTRIBUTION config file. To
simplify the use of pbuilder, I have a simple script, called
'mypbuilder', with which I can do "mypbuilder unstable update" or
"mypbuilder testing login" or "mypbuilder hoary build ...". Here is
that simple script:
==============================
#!/bin/sh
CONFIGFILE=~/.pbuilderrc.$1
CACHEDIR=/home/thomas/debian/pbuilder/cache/$1
if [ ! -f $CONFIGFILE ] ; then
echo "Unknown distribution : $1 (config file doesn't exist)"
exit 1;
fi
if [ ! -d $CACHEDIR ] ; then
echo "Unknown distribution : $1 (cache directory doesn't exist)"
exit 1;
fi
echo "Using $CONFIGFILE as configuration file"
if [ $2 == "login" ] ; then
ARGS=--save-after-login
fi
sudo pbuilder $2 $ARGS --pkgname-logfile --configfile $CONFIGFILE
--aptcache $CACHEDIR --debootstrap debootstrap $3
==============================
Then, I use 'dpatch' to maintain my packages. For each package, I
create dpatches called testing-backport.dpatch, stable-backport.dpatch
or hoary-backport.dpatch, depending on the changes required on the
packages to get them to compile on each distribution. Most of the time,
it's simply a matter of package versions. Sometimes, it's a bit
trickier (change ./configure options, etc.).
Then, I have an ugly 'backport.sh' script that I can call like
"./backport.sh mypackage hoary", which will build the package
'mypackage' for the hoary distribution. (This script is a bit specific
to the fact that I'm using a SVN repository and svn-* tools to maintain
the packages).
It simply:
- copy the 'mypackage' directory to 'mypackage-hoary' and 'cd' into it.
- apply the dpatch 'hoary-backport.dpatch'
- run the compilation inside the correct pbuilder chroot (it's done
with another custom script called svn-pbuild).
=================================
#!/bin/sh -x
if [ $# -lt 2 ] ; then
echo "Usage: backport.sh directory distribution" ;
exit 1 ;
fi
DIRECTORY=$(echo $1 | sed s%/$%%)
DISTRIBUTION=$2
if [ ! -d $DIRECTORY ] ; then
echo "$DIRECTORY is not a directory" ;
exit 1 ;
fi
echo $DIRECTORY/trunk/debian/patches/$DISTRIBUTION-backport.dpatch
if [ ! -f
$DIRECTORY/trunk/debian/patches/$DISTRIBUTION-backport.dpatch ] ; then
echo "No backport patch available for $DISTRIBUTION"; exit 1;
fi
DESTDIR=$DIRECTORY-$DISTRIBUTION
rm -rf $DESTDIR
cp -R $DIRECTORY $DESTDIR
rm $DESTDIR/build-area/*
cd $DESTDIR/trunk/
dpatch apply $2-backport
if [ $? -ne 0 ] ; then exit 1 ; fi
svn-pbuild $DISTRIBUTION
cd ../../
rm -rf $DESTDIR
=================================
Here is the svn-pbuild script:
=================================
#!/bin/sh
if [ ! -d debian ] ; then
echo "Wrong dir" ;
exit 1 ;
fi
if [ ! -f ~/.pbuilderrc.$1 ] ; then
echo "Wrong distro" ;
exit 1;
fi
if [ ! -d ~/debian/pbuilder/results-$1 ] ; then
echo "Wrong distro" ;
exit 1 ;
fi
sudo svn-buildpackage --svn-ignore-new --svn-builder="pdebuild
--buildresult /home/thomas/debian/pbuilder/results-$1 --
--configfile /home/thomas/.pbuilderrc.$1
--aptcache /home/thomas/debian/pbuilder/cache/$1 --debootstrap
debootstrap --pkgname-logfile"
=================================
And here it is. It's a bit messy. Don't hesitate to tell me what's
wrong about it. If needed, I can make a bit cleaner, and put it online
somewhere.
Sincerly,
Thomas
--
PETAZZONI Thomas - thomas.petazzoni at enix.org
http://{thomas,sos,kos}.enix.org - Jabber: thomas.petazzoni at jabber.dk
http://{agenda,livret}dulibre.org
Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E 1624 F653 CB30 98D3 F7A7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pbuilder-maint/attachments/20051019/395b9646/attachment.pgp
More information about the Pbuilder-maint
mailing list