I'm currently running owncloud on my laptop. It's open source, written in PHP, uses postgresql or mysql, and provides Web/Cal/Card/DAV access. I can sync contacts and calendar between my Android phone and my Ubuntu laptop. My desktop client is Thunderbird+Lightning+SoGo connector and my Android phone uses CalDAV-Sync and CardDAV sync for sync. iPhones should be able to sync without a third party app. With the proper PPA setup updates happen like regular system updates.
Previously I investigated the use of openCRX as a personal groupware. It's open source, written in Java, and provides ActiveSync server functionality (seen as an exchange server by smartphones). However openCRX is a raw piece of software, it requires configuration, and the docs isn't always clear or sufficient. So only advisable if you are a superuser and like to figure things out. It's also greedy in terms of resources, much more than a PHP solution.
Before that I was using Zimbra appliance + Zimbra Desktop. Also very greedy in resources. However when upgrading to Ubuntu 11.04 Zimbra Desktop kept crashing due some bug that probably will never get fixed.
Also when using ActiveSync on Android there's a bug that result in battery drain when server connection is not reliable (e.g. on the road). It's unclear when it will be fixed, see bugs 9307, 30123, and 34726 for more info. A workaround might be to use Tasker and Syncer to disable sync when not connected to my home wifi.
In terms of encryption I use OpenVPN on my laptop (server) and android phone (client), so I don't need to have SSL, and everything works as if there's a local network between them. Takes some time to setup but once working, it flies.
In any case most self-hosted solutions are somewhat tedious to work out. The price for not going through Google is high indeed.