I have an increasing number of servers running Debian or Ubuntu with customized versions of Apache, PHP, etc.
I thought I might be able to save time by creating my own APT source and putting already-compiled copies of these packages that all my servers can use. This way, I can also upgrade them all at once.
I have been able to find several sets of instructions for creating deb repositories (1, 2, 3 for example), but I have not yet found the best way to actually compile and package the software.
Any tutorials or suggestions for how to compile and package Apache HTTPD, PHP (and software in general) for a custom DEB repository?
If you want to just get something built quickly for internal use only on your own systems, then you might want to take a pretty good look at FPM – Effing Package Management (wiki). Creating a package with this is pretty easy.
The binary package HOWTO also works and is pretty easy to follow. Just put the files in a directory, build your control file, and put in the right directory and run a command to build the archive.
If you ever plan on sharing your packages, or becoming a Debian/Ubuntu developer though you should take a strong look at the Debian Policy Manual. Everything you need to know is there with a lot of detail.