NOTE These notes were taken from Matt Taggart's page called building_debian_packages on this wiki. Those notes were left intact and changes were made here.
These notes are specific to the setup we have on our build/package machine cranky. Cranky is in the external FO ring. On cranky there is a user called build. That account should be used when executing the package process described below. On cranky there is an area created for doing package work. The area has the following directories: packaging pbuilder svn tmp. The notes below will be making references to these directories. There is a link to this area in the build account. The build account has a lot of aliases set up in the shell. These aliases will also be referenced in the steps below.
This is what the fossology team does to create our debian packages we use for testing and local release.
! Use debchange to edit the change log. Create or update the top entry in debian/changelog to match that version, with a -1 debian version, with a single bullet saying “unofficial svn testing”. There should only ever be one entry of this type and it should be at the top and will not remain in the file for any releases. (example?)Here is what is being done for internal rc's at the moment.
tar zxvf <pathtosvn>/../fossology-1.0.0~20081106.tar.gz /srv/build/packaging for example mv fossology-1.0.0~20081106 fossology-1.0.0~20081106.orig
tar zxvf fossology-1.0.0~20081106.tar.gz
svn export <pathtosvn>/debian fossology-1.0.0~20081106/debian
At this point you could just cd into the directory and do “debuild -rfakeroot” however for our official process we use pbuilder http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html#introduction for building packages in clean chroots. (This document assumes you already have pbuilder setup)
For each arch/release target you want to generate debs for(currently we do 4. lenny and etch/i386 and lenny etch/amd64) Using lenny and rc5 as an example:
pbuilder-lenny-i386-update;pbuilder-lenny-amd64-update
pdebuild-lenny-i386
pbuilder-lenny-amd64-only ../*.dsc
So far there have been few. For release 1.2 the tarballs needed to be updated. This is done using the –extrapackages option to pbuilder. The tarballs needed the following added to them for 1.2:
For example:
sudo pbuilder --update --basetgz /srv/build/pbuilder/tarballs/lenny-amd64.tar.gz --extrapackages python python-pyrex
cd /var/www/fossology.org/debian; sudo mkdir 1.1.0~rc5;sudo chown me:me 1.1.0~rc5
mkdir 1.1.0~rc5/etch 1.1.0~rc5/lenny
cd lenny
scp cranky:~build/build/pbuilder/result/lenny-i386/* . scp cranky:~build/build/pbuilder/result/lenny-amd64/*amd64* .
NOTE: that there are duplicate files between architectures. So the second copy must only grab the architecture specific files.
../mkpackages
On the system you want to use the packages, add something like this to sources.list
deb http://fossology.org/debian/{lenny|etch} ./
Same as above but:
environment). Also, pbuilder enables you to build for target releases and architectures other than the that of your build system.
sudo pbuilder --create --distribution etch --debootstrapopts --arch=i386 \ --mirror http://debian.osuosl.org/debian/ --basetgz /srv/build/tarballs/etch-i386
sudo pbuilder --update --basetgz /srv/build/tarballs/etch-i386.tar.gz
Below is an example using the pbuilder –build option using the file package to build from a source package.
sudo pbuilder --build --basetgz /srv/build/pbuilder/tarballs/etch-i386.tar.gz file_4.17-5etch3.dsc
Results go to /var/cache/pbuilder/result/ (or you can specify alternate destination with –buildresult)
svn co https://fossology.svn.sourceforge.net/svnroot/fossology/trunk/fossology/
tar zxvf <pathtosvn>/../fossology-1.0.0~20081106.tar.gz mv fossology-1.0.0~20081106 fossology-1.0.0~20081106.orig
tar zxvf fossology-1.0.0~20081106.tar.gz
svn export <pathtosvn>/debian fossology-1.0.0~20081106/debian
For each arch/release target you want to generate debs for(currently we do etch/i386 and etch/amd64)
sudo pbuilder update
pdebuild
sudo pbuilder --binary-arch --build *.dsc
debsign *.changes
apt-ftparchive packages . > Packages cat Packages | gzip -9 >Packages.gz
deb http://fossology.org/~taggart/debian/ ./