I'm running Debian Buster where I build some packages with the devscripts package. I want to build these packages for the current stable Debian release (bullseye) without upgrading my system. I'm not sure where to start. Update my build packages? Set some flag in the build scripts?
You can use
pbuilder for this; install it, then run
sudo pbuilder create --basetgz /var/cache/pbuilder/bullseye.tgz --distribution bullseye
to initialise the Debian 11 build tarball. Then use
pdebuild to build your package:
pdebuild -- --basetgz /var/cache/pbuilder/bullseye.tgz
pbuilder tricks page on the Debian wiki for a more general solution; you’ll have to adjust it to match the current stable and oldstable.