As for your changes being lost by an update from the official repositories I'm not sure. You could always just send your patch back upstream to the compiz-gnome packagemaintainers or create your own repository for the updated package.

One way to avoid getting your private package clobbered is to add an entry to the top of debian/changelog with a higher version number, then build your package.
–
Chris Jester-YoungAug 18 '09 at 14:06

The patch will in all likelyhood not be accepted upstream, since it has been available for quite some time now. Creating my own repo seems overkill for the 20-lines change. Maybe I'll just try and see what happens. Thanks for your answer.
–
KimAug 18 '09 at 14:08

run debchange --nmu and type in a description of the change you made. This will auto-incremement the version number so that the system will not try to "upgrade" your custom package back to the standard one.

The answer to #3 and #4 is that you should put the package in hold status once you've installed your version. This tells the Debian package management system to "hold" any future changes to this package, in effect lets you manage the package manually.

7.11 What is meant by unknown, install, remove, purge and hold in the package status?

These "want" flags tell what the user wanted to do with a package (as indicated either by the user's actions in the "Select" section of dselect, or by the user's direct invocations of dpkg).

Their meanings are:

unknown - the user has never indicated whether he wants the package>

install - the user wants the package installed or upgraded

remove - the user wants the package removed, but does not want to remove any existing configuration files.

purge - the user wants the package to be removed completely, including its >configuration files.

hold - the user wants this package not to be processed, i.e., he wants to keep the >current version with the current status whatever that is.

7.12 How do I put a package on hold?

There are three ways of holding back packages, with dpkg, aptitude or with dselect.

With dpkg, you have to export the list of package selections, with:

dpkg --get-selections * > selections.txt

Then edit the resulting file selections.txt, change the line containing the package you wish to hold, e.g. libc6, from this:

libc6 install

to this:

libc6 hold

Save the file, and reload it into dpkg database with:

dpkg --set-selections < selections.txt

With aptitude, you can hold a package using

aptitude hold package_name

and remove the hold with

aptitude unhold package_name

With dselect, you have to enter the [S]elect screen, find the package you wish to hold in >its present state, and press the =' key (or H'). The changes will go live immediately >after you exit the [S]elect screen.

Note: People have found issues with the aptitude hold command, so imho you should prefer the dpkg command to hold the package. Alternatively, you could hold the package via the Synaptic package manager GUI interface (Package > Lock Version). My preference is to use dpkg because it has worked well for me.

You already have a good answer for the rest so I'll not venture my opinion on those.

Well, it comes down to recompilation. If you don't want a full debian approved package creation environment (the right way)I've tended to use checkinstall for quick and dirty package creation (the easy way) - its not the debian recommended way, but its a lot simpler than the other way. configure then make, and substitute makeinstall with checkinstall. Then install your new package with sudo dpkg -i