It depends on the type of cloaking you are doing.
If you want to detect geoip and send visitors from a specific area (country, zip code, etc) to one page and everyone else to another then using maxmind along with a cloaking script works.
If you want to detect search engine spiders by IP or by user-agent then a traditional cloaking script like Fantomas Shadowmaker, wpCloaker, and the like fits.
There are other variations - like detecting referrer, country code, custom cloaking by URL pattern, etc.
I am of course biased but the bottom line is that it depends on "how" you want to detect and differentiate one thing from another.