You have ten Lenny servers all running the x86 arch. It's completely possible to build a single package that installs to any computer running a specific arch. It's good practice to build Debian packages with
pbuilder, to avoid any "works on the dev box" problems.
It's relatively simple to rebuild a package.
apt-get has a
source command that will pull down the source code. If all that's needed is a simple
configure options change then you're nearly set. Edit the
debian/rules file, and version bump the package with something like
~jldugger0, so you override the debian version you derived from, but not anything newer from Debian. Just increment the trailing 0 to keep bumping local versions. Do not bump the Debian version directly, and for god's sake, DO NOT BUMP THE EPOCH--if you want to ensure that newer versions don't override local changes, pin the package. Be aware that you're incurring substantial security risk and need to find some way to subscribe to changes in the package for review.
The two problems with local versions of packages are: effort should be taken to keep pace with new versions. If your change is simple enough you might be able to get by with a script that applies patches. If it's invasive, not pushing changes upstream will cost you greater and greater amounts of time as conflicts accumulate. The other problem is that of dependencies. The kernel, Apache, and PHP are all core components that other packages depend on. Consider whether the changes you want to make to a package will affect other packages depending on it.