I'm using ZB Block. It's GNU GPL licensed and easy to set up. I just put a
in the top of /index.php.
When a spammer hits that he gets a warning page or a 503. It also blocks hack attempts, spambots, robot probes, and a long list of black hat types. The log it generates will probably surprise you.
However, it is not the most elegant code. :)