Darwin Calendar Server

From The Network People, Inc. - Wiki
Jump to navigation Jump to search

How to install Darwin Calendar Server on FreeBSD

by Matt Simerson
2007.07.08 - initial publication.

Credits

Apple, for authoring and liberating their Darwin Calendar Server
FreeBSD, and the excellent ports tree
Roy Hooper and his article that spurred me to write this

Installation

Roy did us a favor and documented the install procedure on his site. I took his work, cracked open a cool refreshing can of script ass on it, and added additional documentation.

Installation consists of downloading and installing a shell script. The script was written and tested on FreeBSD 6.2. If you update your FreeBSD ports tree (man portsnap) before running this script, it should work without any issues, but it will take a while. If you are running FreeBSD 6.2-stable, or FreeBSD 7, edit the PKG_ADD variable so that the script installs packages. It will install much, much faster. :-)

Finally, the krb5 port builds against Tetex, which has it's own list of dependencies, many of which can optionally build against X11 libraries. I highly recommend adding "WITHOUT_X11=true" to /etc/make.conf before starting.

fetch -o install_cal.sh http://www.tnpi.net/computing/install_cal.sh.txt
sh install_cal.sh

The script installs the following items from ports:

  1. python
  2. zope
  3. py-xml
  4. py-openssl
  5. py-sqlite
  6. py-twisted
  7. py-vobject
  8. bash
  9. curl
  10. perl
  11. ghostscript-gpl-nox11
  12. krb5 (kerberos 5)
  13. subversion
  14. py-setuptools (with hacks)

And installs the following items from source:

  1. xattr
  2. pyKerberos
  3. CalendarServer

After installing all the needed software, it installs a test config file and starts up the calendar server.

Older FreeBSD versions: I would not be the least bit surprised if installs on older versions of FreeBSD have problems. This is mostly because the script uses packages for installing a number of components. The package that get installed may be quite a bit older and have problems working. You can force installation from ports by setting PKG_ADD to /dev/null.

Configuration

The application is installed in /usr/local/src/CalendarServer by default. You can move it to wherever you like after installation.

Within the CalendarServer directory is conf, which contains the configuration files for the server. As configured in the subversion repository where we got the sources, the default configuration file is caldavd-dev.plist and is defined in the top level run file. So my script has already copied the caldavd-test.plist file into place to get started.

The conf/caldavd.plist file is fairly self explanatory. You can configure the root web directory, ip/port to listen on, authentication mechanism, and more. That file and accounts.xml will be where you customize the server for your site. Go visit the Calendar Server page on Apple's Mac OS Forge site and read all the docs there. There aren't that many so it won't take long.


Notes

py-setuptools

A hack is necessary because we need version 0.6c6 and the ports tree has 0.6c5. So I grep the Makefile and if it still has 0.6c5 listed, I use sed to replace the version with 0.6c6 and then append the MD5, SHA256, and SIZE values to the distinfo file. Then the port install the 0.6c6 version quite happily.

sed -i .bak -e 's/0.6c5/0.6c6/' Makefile
echo "MD5 (python/setuptools-0.6c6.tar.gz) = e3d56d4d19776042607cbbecae823c8b
SHA256 (python/setuptools-0.6c6.tar.gz) = 075172b39f0933d3fbd1d4e90f29742c1402a29da26db04357eb18fd46ffd6b1
SIZE (python/setuptools-0.6c6.tar.gz) = 248601" >> distinfo

PyKerberos

Instead of Roy's approach where you must manually edit the setup.py file, I just rewrite it. I also use sed (instead of the munged perl invocation on his site) to clean up the python includes in src.

sed -i .bak -e 's/<Python\//</;' src/*