This page documents how to use git buildpackage to build packages local and on the server.
Quick recipe (only builds on the server)
- install git-buildpackage first
-
export PACKAGE=package
- you have the dsc files on your local machine? Do:
-
mkdir $PACKAGE
-
cd $PACKAGE
- copy the dsc file and all referenced files here
-
git-import-dsc ${PACKAGE}*dsc
- ask the administrator to put your public ssh key on bob the build server
- ssh builder@130.75.116.103 "cd /srv/packaging/git;./make-git $PACKAGE"
- git remote add origin git+ssh://builder@130.75.116.103/srv/packaging/git/$PACKAGE
- git push origin master
- git push origin upstream
On Bob the building process runs in a screen with the name package.
- screen -ls
- screen -r package
The results can be found in /srv/packaging/=dist=_=arch=/result/.
Additionally, STDOUT goes into /srv/packaging/git/log/package/out. Each time you think you could build a new package on BOB, do a
git commit -a
and a "git push". A post-receive hook starts the installation.
The etch packages get an additional "~bp" on the versions number attach to enable backporting.
Use git-buildpackage also on your local machine
Using dpkg-buildpackage
This is not recommended since some hidden dependencies might be resolved by you local system but not on other system. E.g., your package might be installed on a minimal system but will not work.
Using pbuilder
- edit the
~/.pbuilderrc
on your local machine and fill it with live
- do
pbuilder --create
- without a config you can pass proper arguments to pbuilder, e.g.,
pbuilder --create --distribution $dist --debootstrapopts "--arch=$arch" \
--basetgz "$home/$dist_arch/$base" --mirror "http://10.20.10.30/$dist"
- do a
pbuilder build package.dsc
The
~/.pbuilderrc
:
LOCALPATH="set_the_pbuilder_path_here"
BASETGZ=$LOCALPATH/base_tgz_of_your_chroot.tgzBUILDPLACE=$LOCALPATH/build/
MIRRORSITE=http://ftp.de.debian.org/debian/
OTHERMIRROR="deb file://$LOCALPATH/result/ ./"
USEPROC=yes
USEDEVPTS=yes
USEDEVFS=no
BUILDRESULT=$LOCALPATH/result/
DISTRIBUTION=your_dist
APTCACHE="$LOCALPATH/cache/"
APTCACHEHARDLINK="yes"
REMOVEPACKAGES="lilo"
HOOKDIR="$LOCALPATH/hooks/"
export DEBIAN_FRONTEND="noninteractive"
DEBEMAIL=""
BUILDSOURCEROOTCMD="fakeroot"
PBUILDERROOTCMD="sudo"
PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends"
DEBBUILDOPTS=""
APTCONFDIR=""
BUILDUSERID=builders_uid
BUILDUSERNAME=builders_nmae
BINDMOUNTS="$LOCALPATH/result/"
unset DEBOOTSTRAPOPTS
export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
export SHELL=/bin/bash
DEBOOTSTRAP="cdebootstrap"
PKGNAME_LOGFILE_EXTENTION="_$(dpkg --print-architecture).build"
Do not forget to set the right LOCALPAHT
git-buildpackage
see
*git-buildpackage* --git-ignore-new
and
*git-buildpackage* --git-tag
git-buildpackage + pbuilder
This is done on BOB.
- Write a script outside of your maintenance directory.
export $PATH_TO=some_path
cat <<EOF >$PATH_TO/git-pbuilder
#!/bin/sh
# pass commandline arguments to dpkg-buildpackage
pdebuild --debbuildopts "-i\.git -I.git $*"
EOF
chmod a+x $PATH_TO/git-pbuilder
- start the build process with
git-buildpackage --git-builder=$PATH_TO/git-pbuilder --git-cleaner="fakeroot debian/rules clean"
links