Compiling Evolution EWS for Ubuntu 12.04

As my employer uses Exchange mail server, I need a way to access my mail from my Ubuntu box. The current Evolution exchange connector is quite outdated, so I prefer to use the emerging Evolution EWS connector. It can access the addressbook, the calendar and even the MAIL! 😀 Since it’s emerging it requires frequent recompilation. After installing the required tools and libs, it still doesn’t compile on the Ubuntu 12.04, for the several deprecated API calls it makes. So I came up with the following script to compile it and prepare a nice little package from it.

sudo rm -r evolution-ews ; git clone -b gnome-3-2
sed '/-Wall/ a 
t-Wno-missing-field-initializers' evolution-ews/ |
AC_CHECK_LIB(gthread-2.0, g_thread_init)' >evolution-ews/
mv evolution-ews/ evolution-ews/
cd evolution-ews

./ --prefix=/usr --disable-maintainer-mode
sudo checkinstall --pkgname=evolution-ews --pkgversion=3.2 --pkgrelease=git -requires `evolution (>= 3.2), evolution (<<3.3)` && sudo mv *.deb ..
cd ..