How to debuild (Debian) Apache without it performing a clean

Add the -nc option to your debuild command line. This may expose problems in the build system or the packaging though, so be prepared. But for small fixes it usually works fine.

However, as the apache2 source package uses debhelper (like many other packages), this alone is not enough, because debhelper also keeps its own journal of completed steps in separate log files for each binary package. These can be removed entirely by dh_clean. But to get debhelper redo no more than the necessary work, truncate only the relevant one by

sed -i '/^dh_auto_build$/Q' debian/apache2-bin.debhelper.log

before running debuild -nc.


Inside the debian directory there's a rules file. It's a essentially a make file. If you remove all the directives about cleaning and then add

override_dh_clean:

And put nothing in it no cleaning will happen (at all). Be careful though this might cause build problems, not likely but might. Another alternative is to not change anything and use the -j option to do a parallel build. Not sure the advantage that'd give on a raspberry pi.

Rules file should look like this.