Maybe something like this?
#!/bin/bash
# This gets a list of all available packages
for i in $(dpkg -l \* | awk '/^[a-z]/ {print $2}')
do
# This downloads and unpacks the source.
# Any src packages already properly unpacked in the cwd won't be downloaded a second time.
apt-get source $i
apt-get build-dep -y $i
done
# This finds all buildable directories
for i in $(find . -name debian -type d | sed s/debian.*//g)
do
cd $i
debian/rules binary
cd -
done
I know you said that you have the packages already, but I'm not sure what format they are in. If you already have all the packages properly unpacked in your cwd
then apt will skip that package and move onto the next one. You can also pass -s
to apt-get to test the commands.
Almost all packages should build in one shot like this, if you're using the same release that you're trying to build.
You will need lots of storage, and lots of time.