After reading Mike Hommey's idea about buildd network for QA testing, I decided to try to implement the 10.1 policy recommendations check using rebuildd.
Here is how I proceeded.
Install and configure rebuildd
This is done by apt-get install rebuildd. Then, init database (I use sqlite) with rebuildd init.
Then I initialized build system with rebuildd-init-build-system. I had to add nostrip to DEB_BUILD_OPTIONS, so I decided to do quick and dirty and I edited /usr/bin/dpkg-build-package adding the good export info in the first lines.
Configuration file and post build cmd
My configuration file is simple and the one by default: I only changed email addresses and add a post_build_cmd script.
Here's the code for the script:
#!/bin/sh
dist=$1
pkg=$2
version=$3
arch=`dpkg --print-architecture`
RET=0
cd /var/cache/pbuilder/result || exit 1
for file in $(grep '.deb$' ${pkg}_${version}_${arch}.changes |cut -d\ -f6)
do
echo Checking $file for stripped binaries...
echo ---------------------------------------
mkdir /tmp/$file
dpkg -x $file /tmp/$file
find /tmp/$file -type f | (while read line
do
L=$(file $line | egrep 'ELF.*, stripped')
if test ! -z "$L"
then
echo $L
RET=1
fi
done; exit $RET)
RET=$?
rm -rf /tmp/$file
done
echo
echo ...done
echo Removing result files...
for file in $(grep-dctrl -sFiles . ${pkg}_${version}_${arch}.changes | sed '1d' | cut -d\ -f6)
do
rm -f $file
rm -f /var/cache/rebuildd/build/$file
done
rm -f ${pkg}_${version}_${arch}.changes
echo ...done
exit $RET
Fille the db
Then I fill the database with:
grep-dctrl -sPackage,Version . /var/lib/apt/lists/ftp.fr.debian.org_debian_dists_sid_main_source_Sources | cut -d: -f2- | tr '\n' ' ' | sed 's/ /\n/g'| sed 's/ / /' | xargs -L1 -ixxxxxx echo xxxxxx sid | rebuildd-job add
And finally I just have to start rebuildd and let it do the job.
Argh, already 3 build logs received with stripped binaries…
Update: Bug list can be found here