Little T in the Cog apple

Archive for September 2013

Upgrade ClamAV on OS X 10.5 Leopard Server


As part of the modernising of my Leopard install I thought I'd upgrade to the latest ClamAV (the antivirus software that comes with Leopard Server). This isn't strictly necessary as the updates will still work with older versions of ClamAV but it is still good to have the latest version running. Thankfully this is a really easy upgrade and still works perfectly with Server Admin (so will start when starting email etc).

Firstly stop email while you install the new version (stopping email isn't strictly needed but it's a good way of unloading the running ClamAV) then grab the latest ClamAV stable release from (0.97.8 at the time of writing) and unpack it somewhere. Thanks to the "clamconf" tool that comes with ClamAV I was able to see the configure options used by Apple to build the software, so we simply run this to set it up for our system, then make, then make install:

$ tar -zxvf clamav-0.97.8.tar.gz
$ cd clamav-0.97.8
$ ./configure '--prefix=/' \
	'--exec-prefix=/usr' \
	'--bindir=/usr/bin' \
	'--sbindir=/usr/sbin' \
	'--libexecdir=/usr/libexec' \
	'--datadir=/usr/share/clamav' \
	'--sysconfdir=/private/etc' \
	'--sharedstatedir=/private/var/clamav/share' \
	'--localstatedir=/private/var/clamav/state' \
	'--disable-dependency-tracking' \
	'--libdir=/usr/lib/clamav' \
	'--includedir=/usr/share/clamav/include' \
	'--oldincludedir=/usr/share/clamav/include' \
	'--infodir=/usr/share/clamav/info' \
	'--mandir=/usr/share/man' \
	'--with-dbdir=/private/var/clamav' \
	'--disable-shared' \
	'--with-user=_clamav' \
	'--with-group=_clamav' \
	'--with-gnu-ld' \
	'--enable-static' \
$ make
$ sudo make install
That's it! You should now have the latest ClamAV installed. To start using it simply start email, or load it from the shell:
$ sudo launchctl load /System/Library/LaunchDaemons/org.clamav.clamd.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/org.clamav.freshclam.plist
Check the freshclam log (/var/log/freshclam.log) and you should see the new version being loaded.