How can I avoid that my iBook/PowerBook/MacBook wakes up from sleep when opening the lid?

Mac OS X has a utility called pmset which controls the power management of a Macintosh. Interestingly, there is an option lidwake which controls the behaviour of a ??Book when opening the lid. By default, lidwake is set to 1, meaning that the ??Book wakes up from sleep when opening the lid (or clamshell). In order to avoid this, issue the command

sudo pmset lidwake 0

After setting this option, you will have to press a key in order to wake up your ??Book.

If you want to know which features the power manager of your Macintosh supports, the command

pmset -g cap

will help you out.