Summary: Clam Anti-Virus Name: clamav Version: 0.95 Release: 1 License: GPL Group: System/Base Source: %{name}-%{version}.tar.gz Packager: Jonathan Norman %description ClamAV is an open source anti-virus toolkit of UNIX. %prep %setup -q %build ./configure --prefix=/usr --sysconfdir=/etc \ --with-zlib=/usr --with-dbdir=/var/lib/clamav \ --disable-clamav make %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install mkdir -pv $RPM_BUILD_ROOT/etc/rc.d/{rc{0,1,2,3,4,5,6},init}.d #bootscripts cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav << "EOF" #!/bin/sh # Begin $rc_base/init.d/clamav . /etc/sysconfig/rc . ${rc_functions} case "${1}" in start) boot_mesg "Starting ClamAV Daemon..." loadproc /usr/sbin/clamd ;; stop) boot_mesg "Stopping ClamAV Daemon..." killproc /usr/sbin/clamd ;; restart) ${0} stop sleep 1 ${0} start ;; status) statusproc /usr/sbin/clamd ;; *) echo "Usage: ${0} {start|stop|restart|status}" exit 1 ;; esac # End $rc_base/init.d/clamav EOF chmod -v 754 /etc/rc.d/init.d/clamav for link in /etc/rc.d/rc{0,1,6}.d/K32clamav; do ln -sfv ../init.d/clamav $link; done for link in /etc/rc.d/rc{2,3,4,5}.d/S18clamav; do ln -sfv ../init.d/clamav $link; done %post groupadd -g 36 clamav useradd -c "ClamAV Daemon" -d /dev/null -u 36 -g clamav -s /bin/false clamav mkdir -v /usr/share/clamav wget -P /usr/share/clamav -c http://db.local.clamav.net/daily.cvd wget -P /usr/share/clamav -c http://db.local.clamav.net/main.cvd chown -vR clamav:clamav /usr/share/clamav chmod -vR 600 /usr/share/clamav/main.cvd chmod -vR 600 /usr/share/clamav/daily.cvd touch /var/log/freshclam.log && chmod 600 /var/log/freshclam.log && chown clamav /var/log/freshclam.log %postun userdel clamav groupdel clamav rm -v /etc/rc.d/init.d/clamav for link in /etc/rc.d/rc{{0,1,6}.d/K32,{2,3,4,5}.d/S18}clamav; do rm -fv ../init.d/clamav $link; done rm -vR /usr/share/clamav /var/log/freshclam.log %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) / %changelog * Wed Mar 25 2009 Jonathan Norman 0.95-1 - Created user and group - Bootscript for daemon - Creates logs - Downloads anti-virus database - Moved bootscripts to %install - Removed list of commands from %post to fix /bin/sh to zsh problem