|
Memorandum
Memorandum to build ClamAV 0.97.x on Mac OS X
I've tested ClamAV 0.96.x and ClamAV 0.97.x for building on Mac OS X, and now I'm running the latest stable release: ClamAV 0.97.3. 1. Memorandum 1: Building ClamAV on Mac OS X 10.4 (Intel)2. Memorandum 2: Building ClamAV on Mac OS X 10.4 (PPC) 3. Memorandum 3: Building ClamAV on Mac OS X 10.6 & 10.7… 4. Memorandum 4: Running clamd and freshclam as daemon 5. Memorandum 5: Running ClamXav Sentry as launchd agent on Mac OS X 10.6 & 10.7 6. Links…
To compile ClamAV 0.96.3 or later, bzip2 (Version 1.0.6) that fixes CVE-2010-0405 is required.
Mac OS X has bzip2 (Version 1.0.5) built-in and it is outdated, so you get WARNING as follows while running configuration command. ****** bzip2 libraries are affected by the CVE-2010-0405 bug ****** We strongly suggest you to update bzip2 ****** WARNING: ****** You are cross compiling to a different host or you are ****** linking to bugged system libraries or you have manually ****** disabled important configure checks. ****** Please be aware that this build may be badly broken. ****** DO NOT REPORT BUGS BASED ON THIS BUILD !!! Apple has patched the CVE-2010-0405 bug on Mac OS X 10.6.7 but not on Mac OS X 10.4.11. Building ClamAV on Mac OS X 10.4 (Intel)
In last update, Clam AntiVirus developer team introduced JIT compiler to ClamAV® 0.96. Install LLVM (Low Level Virtual Machine) and LLVM-GCC 4.2 Front End
cd ~ curl -O http://llvm.org/releases/2.3/llvm-gcc4.2-2.3-x86-darwin8.tar.gz cd /usr/local sudo tar zxf ~/llvm-gcc4.2-2.3-x86-darwin8.tar.gz export PATH=/usr/local/llvm-gcc4.2-2.3-x86-darwin8/bin:$PATH curl -O http://llvm.org/releases/2.3/llvm-2.3.tar.gz tar zxf llvm-2.3.tar.gz cd llvm-2.3 ./configure make sudo make install Install MacPorts and the packages
sudo port selfupdate sudo port sync sudo port install bzip2 check sudo port -d selfupdate sudo port -d sync sudo port upgrade installed Compile ClamAV 0.97.x and Install
cd clamav-0.97.x export CFLAGS="-O3 -march=i686" export CXXFLAGS="-O3 -march=i686" export LDFLAGS="-O3 -march=i686 -L/opt/local/lib" export CC=/usr/local/llvm-gcc4.2-2.3-x86-darwin8/bin/i686-apple-darwin8-gcc-4.2.1 ./configure --prefix=/usr/local/clamXav --build=i686-apple-darwin`uname -r` --enable-llvm --enable-check make && make check sudo make install Building ClamAV on Mac OS X 10.4 (PPC)
PPC users have to install LLVM-GCC 4.2 Front End Binaries for PPC and configure ClamAV 0.96.x and 0.97.x with different configuration. Install LLVM (Low Level Virtual Machine) and LLVM-GCC 4.2 Front End
cd ~ curl -O http://llvm.org/releases/2.3/llvm-gcc4.2-2.3-ppc-darwin8.11.0.tar.gz cd /usr/local sudo tar zxf ~/llvm-gcc4.2-2.3-ppc-darwin8.11.0.tar.gz export PATH=/usr/local/llvm-gcc4.2-2.3-ppc-darwin8.11.0/bin:$PATH curl -O http://llvm.org/releases/2.3/llvm-2.3.tar.gz tar zxf llvm-2.3.tar.gz cd llvm-2.3 ./configure make sudo make install Install MacPorts and the packages
sudo port selfupdate sudo port sync sudo port install bzip2 check sudo port -d selfupdate sudo port -d sync sudo port upgrade installed Compile ClamAV 0.97.x and Install
cd clamav-0.97.x export CFLAGS="-O3" export CXXFLAGS="-O3" export LDFLAGS="-O3 -L/opt/local/lib" export CC=/usr/local/llvm-gcc4.2-2.3-ppc-darwin8.11.0/bin/powerpc-apple-darwin8-gcc-4.2.1 ./configure --prefix=/usr/local/clamXav --enable-llvm --enable-check make && make check sudo make install Building ClamAV on Mac OS X 10.6 & 10.7…
Mac OS X 10.6 & 10.7 has its built-in LLVM (Low Level Virtual Machine), so you can simply build ClamAV 0.96.x and 0.97.x with JIT compiled in and use new features included in anti-virus toolkit. Install MacPorts and the packages
sudo port selfupdate sudo port sync sudo port install bzip2 check sudo port -d selfupdate sudo port -d sync sudo port upgrade installed Compile ClamAV 0.97.x and Install
cd clamav-0.97.x export CFLAGS="-O3 -march=nocona" export CXXFLAGS="-O3 -march=nocona" export LDFLAGS="-O3 -march=nocona -L/opt/local/lib" ./configure --prefix=/usr/local/clamXav --build=i686-apple-darwin`uname -r` --enable-llvm --enable-check make && make check sudo make install Running clamd and freshclam as daemon
sudo chown root:wheel /Library/LaunchDaemons/org.clamav.clamd.plist sudo chmod 0644 /Library/LaunchDaemons/org.clamav.clamd.plist sudo chown root:wheel /Library/StartupItems/ sudo chmod 0755 /Library/StartupItems/ sudo chown -R root:wheel /Library/StartupItems/FreshClamDaemon/ sudo chmod 0755 /Library/StartupItems/FreshClamDaemon/FreshClamDaemon sudo chmod 0644 /Library/StartupItems/FreshClamDaemon/StartupParameters.plist FreshClamDaemon is originally developped by Yuji Okamura. sudo bash chown -R root:admin /usr/local/clamXav chown -R root:admin /usr/local/clamXav/etc chmod 0775 /usr/local/clamXav/etc chmod 0644 /usr/local/clamXav/etc/* chown -R root:admin /usr/local/clamXav/bin chmod 0755 /usr/local/clamXav/bin chmod 0755 /usr/local/clamXav/bin/* chown -R clamav:clamav /usr/local/clamXav/share/clamav chmod -R g+w /usr/local/clamXav/share/clamav chmod -R u+w /usr/local/clamXav/share/clamav chmod 0755 /usr/local/clamXav/share/clamav chmod 0644 /usr/local/clamXav/share/clamav/* chmod 0644 /usr/local/clamXav/share/clamav/freshclam.log chown clamav:admin /var/log/clamd.log chmod 0664 /var/log/clamd.log Running ClamXav Sentry as launchd agent on Mac OS X 10.6 & 10.7
sudo chown root:wheel /Library/LaunchAgents/org.clamXavSentry.plist sudo chmod 0644 /Library/LaunchAgents/org.clamXavSentry.plist
|