While setting up a new FreeBSD 7.0 server I found that psycopg 2.0.7 doesn't easy_install on FreeBSD. It's because of a configuration problem in config.h at the bottom.
#if defined(__FreeBSD__) || (defined(_WIN32) && !defined(__GNUC__)) || defined(__sun__) /* what's this, we have no round function either? */ static double round(double num) { return (num >= 0) ? floor(num + 0.5) : ceil(num - 0.5); } #endif
However 'round' is defined in FreeBSD and has been since FreeBSD 5.3 (according to the manual page). The fix is simple, just remove the 'defined(__FreeBSD__) ||' part of the '#if' and you should be fine. Now you can 'easy_install .' psycopg2.
PS: I'd tried to raise a ticket but http://www.initd.org/ trac seems to have been down for ages.

Out of interest, do you script your server installs? If so, do you use python, a shell script, or something else entirely?
@RobC: For NMA I don’t have a scripted install but in the past I have used simple bash scripts. Since most of the installs are installing ports and easy_installing python modules it was quite simple. For a more complex install I have used Make files but I found them difficult to maintain.
Hope that helps.
One honest question, is there a reason for not using the version in the ports? It looks like your fix has been included by the maintainers in Jan. 2007. I understand that the py* ports may not always be up-to-date, but the beauty of the ports is that smarter-than-me people usually save me hours of “why the hell doesn’t that stuff compile?!?!” debugging with these kind of patches.
Regards,
G.
@Geraud: There is, to be honest no reason. But if you want to do it…. then this blog may help someone so that’s what it’s for
I had to downgrade my psycopg to 2.0.7 and I didn’t know that it was such a simple solution. Thanks a lot.