--- /usr/local/debug/antivirus/clamav/redhat/clamav-0.94.1-1.fc10/specs/clamav.spec 2008-11-05 21:50:09.000000000 +0200 +++ /usr/local/debug/antivirus/clamav/redhat/clamav-0.94.1-1.corvax/specs/clamav.spec 2008-12-12 11:19:51.000000000 +0200 @@ -1,9 +1,11 @@ -#global snapshot rc1 +## $Id: clamav.spec,v 1.72 2008/06/17 20:03:53 ensc Exp $ + +# --with unrar +# --with milter +# --with clamd_wrapper +# --without freshclam_daemon -## Fedora Extras specific customization below... -%bcond_without fedora -%bcond_with unrar -## +#global snapshot rc1 %global username clamav %global homedir %_var/lib/clamav @@ -14,25 +16,27 @@ %global pkgdatadir %_datadir/%name -%{!?release_func:%global release_func() %1%{?dist}} - Summary: End-user tools for the Clam Antivirus scanner Name: clamav Version: 0.94.1 -Release: %release_func 1%{?snapshot:.%snapshot} +%if %{?_with_unrar:1}%{!?_with_unrar:0} +Release: 1%{?snapshot:.%snapshot}%{?dist}.corvax.unrar +%else +Release: 1%{?snapshot:.%snapshot}%{?dist}.corvax +%endif -License: %{?with_unrar:proprietary}%{!?with_unrar:GPLv2} +License: %{?_with_unrar:proprietary}%{!?_with_unrar:GPLv2} Group: Applications/File URL: http://www.clamav.net -%if 0%{?with_unrar:1} -Source0: http://download.sourceforge.net/sourceforge/clamav/%name-%version%{?snapshot}.tar.gz -Source999: http://download.sourceforge.net/sourceforge/clamav/%name-%version%{?snapshot}.tar.gz.sig +%if %{?_with_unrar:1}%{!?_with_unrar:0} +Source0: http://download.sourceforge.net/sourceforge/clamav/%name-%version%{?snapshot:%snapshot}.tar.gz +Source999: http://download.sourceforge.net/sourceforge/clamav/%name-%version%{?snapshot:%snapshot}.tar.gz.sig %else # Unfortunately, clamav includes support for RAR v3, derived from GPL # incompatible unrar from RARlabs. We have to pull this code out. # tarball was created by # make clean-sources [TARBALL=] [VERSION=] -Source0: %name-%version%{?snapshot}-norar.tar.bz2 +Source0: %name-%version%{?snapshot:%snapshot}-norar.tar.bz2 %endif Source1: clamd-wrapper Source2: clamd.sysconfig @@ -46,10 +50,18 @@ Patch24: clamav-0.92-private.patch Patch25: clamav-0.92-open.patch Patch26: clamav-0.93.3-pid.patch +Source1000: clamd.init +Source1001: freshclam.init +Source1002: freshclam.sysconfig-daemon +Source1003: clamd.conf +Source1004: clamav.logrotate +Source1005: freshclam.conf BuildRoot: %_tmppath/%name-%version-%release-root Requires: clamav-lib = %version-%release Requires: data(clamav) -BuildRequires: zlib-devel bzip2-devel gmp-devel curl-devel +#BuildRequires: zlib-devel bzip2-devel gmp-devel curl-devel +BuildRequires: zlib-devel >= 1.2.2 +BuildRequires: bzip2-devel gmp-devel curl-devel BuildRequires: %_includedir/tcpd.h BuildRequires: bc @@ -61,7 +73,9 @@ # Prevent version mix Conflicts: %name < %version-%release Conflicts: %name > %version-%release +%if 0%{?fedora} > 3 BuildRequires: fedora-usermgmt-devel +%endif %{?FE_USERADD_REQ} %package lib @@ -122,6 +136,8 @@ Requires(pre): %_initrddir Requires(postun): %_initrddir +%if %{?_with_milter:1}%{!?_with_milter:0} + %package milter Summary: Milter module for the Clam Antivirus scanner Group: System Environment/Daemons @@ -133,7 +149,9 @@ Group: System Environment/Daemons Requires: init(clamav-milter) BuildRequires: sendmail-devel +%if 0%{?fedora} > 3 BuildRequires: fedora-usermgmt-devel +%endif Provides: user(%milteruser) Provides: group(%milteruser) Requires(post): coreutils @@ -163,6 +181,8 @@ Requires(post): chkconfig Requires(preun): chkconfig initscripts +%endif + %description Clam AntiVirus is an anti-virus toolkit for UNIX. The main purpose of this @@ -235,6 +255,8 @@ SysV initscripts template for the clamav server +%if %{?_with_milter:1}%{!?_with_milter:0} + %description milter This package contains files which are needed to run the clamav-milter. @@ -247,11 +269,13 @@ %description milter-sendmail Sendmail customizations of the clamav-milter. +%endif + ## ------------------------------------------------------------ %prep -%setup -q -n %{name}-%{version}%{?snapshot} +%setup -q -n %{name}-%{version}%{?snapshot:%snapshot} %patch21 -p1 -b .path %patch22 -p1 -b .initoff @@ -259,10 +283,14 @@ %patch25 -p1 -b .open %patch26 -p1 -b .pid +%if %{?_with_milter:1}%{!?_with_milter:0} install -p -m0644 %SOURCE300 clamav-milter/ +%endif mkdir -p libclamunrar{,_iface} -%{!?with_unrar:touch libclamunrar/{Makefile.in,all,install}} +%if %{?_with_unrar:0}%{!?_with_unrar:1} +touch libclamunrar/{Makefile.in,all,install} +%endif perl -pi -e 's!^(#?LogFile ).*!\1/var/log/clamd.!g; s!^#?(LocalSocket ).*!\1/var/run/clamd./clamd.sock!g; @@ -280,11 +308,20 @@ CFLAGS="$RPM_OPT_FLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -std=gnu99" export LDFLAGS='-Wl,--as-needed' # HACK: remove me, when configure uses $LIBS instead of $LDFLAGS for milter check +%if %{?_with_milter:1}%{!?_with_milter:0} export LIBS='-lmilter -lpthread' +%else +export LIBS='-lpthread' +%endif %configure --disable-clamav --with-dbdir=/var/lib/clamav \ - --enable-milter --disable-static \ - --disable-rpath \ - %{!?with_unrar:--disable-unrar} +%if %{?_with_milter:1}%{!?_with_milter:0} + --enable-milter \ +%endif + --disable-static \ ++ --disable-rpath \ +%if %{?_with_unrar:0}%{!?_with_unrar:1} + --disable-unrar +%endif # build with --as-needed and disable rpath sed -i \ @@ -319,18 +356,24 @@ install -d -m755 \ ${RPM_BUILD_ROOT}%_sysconfdir/{clamd.d,cron.d,logrotate.d,sysconfig} \ ${RPM_BUILD_ROOT}%_var/log \ +%if %{?_with_milter:1}%{!?_with_milter:0} ${RPM_BUILD_ROOT}%milterstatedir \ +%endif ${RPM_BUILD_ROOT}%pkgdatadir/template \ ${RPM_BUILD_ROOT}%_initrddir \ ${RPM_BUILD_ROOT}%homedir +%if %{?_with_clamd_wrapper:1}%{!?_with_clamd_wrapper:0} rm -f ${RPM_BUILD_ROOT}%_sysconfdir/clamd.conf \ ${RPM_BUILD_ROOT}%_libdir/*.la - +%else +rm -f ${RPM_BUILD_ROOT}%_libdir/*.la +%endif touch ${RPM_BUILD_ROOT}%homedir/daily.cld touch ${RPM_BUILD_ROOT}%homedir/main.cld +install -m644 -p %SOURCE1004 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/clamav ## prepare the server-files mkdir _doc_server @@ -343,28 +386,44 @@ install -m644 -p %SOURCE1 $RPM_BUILD_ROOT%pkgdatadir install -m755 -p %SOURCE100 $RPM_BUILD_ROOT%pkgdatadir cp -pa _doc_server/* $RPM_BUILD_ROOT%pkgdatadir/template +%if %{?_with_clamd_wrapper:1}%{!?_with_clamd_wrapper:0} ln -s %pkgdatadir/clamd-wrapper $RPM_BUILD_ROOT%_initrddir/clamd-wrapper +%else +install -m755 -p %SOURCE1000 $RPM_BUILD_ROOT%_initrddir/clamd +install -m644 -p %SOURCE1003 $RPM_BUILD_ROOT%_sysconfdir/clamd.conf +install -d -m750 ${RPM_BUILD_ROOT}/var/log/clamav +%endif smartsubst 's!/usr/share/clamav!%pkgdatadir!g' $RPM_BUILD_ROOT%pkgdatadir/clamd-wrapper ## prepare the update-files -install -m644 -p %SOURCE6 ${RPM_BUILD_ROOT}%_sysconfdir/logrotate.d/clamav-update install -m755 -p %SOURCE8 ${RPM_BUILD_ROOT}%_sbindir/clamav-notify-servers touch ${RPM_BUILD_ROOT}%freshclamlog install -p -m0755 %SOURCE200 $RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep +%if %{?_without_freshclam_daemon:0}%{!?_without_freshclam_daemon:1} +install -m755 -p %SOURCE1001 $RPM_BUILD_ROOT%_initrddir/freshclam +install -p -m0644 %SOURCE1002 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/freshclam +install -m644 -p %SOURCE1005 $RPM_BUILD_ROOT%_sysconfdir/freshclam.conf +%else +install -m644 -p %SOURCE6 ${RPM_BUILD_ROOT}%_sysconfdir/logrotate.d/clamav-update install -p -m0644 %SOURCE201 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/freshclam install -p -m0600 %SOURCE202 $RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update +%endif smartsubst 's!webmaster,clamav!webmaster,%username!g; s!/usr/share/clamav!%pkgdatadir!g; s!/usr/bin!%_bindir!g; s!/usr/sbin!%_sbindir!g;' \ +%if %{?_without_freshclam_daemon:1}%{!?_without_freshclam_daemon:0} $RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update \ +%endif $RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep +%if %{?_with_milter:1}%{!?_with_milter:0} + #### The milter stuff function subst() { sed -e 's!!milter!g;s!!%milteruser!g;'"$3" "$1" >"$RPM_BUILD_ROOT$2" @@ -382,6 +441,8 @@ install -p -m755 contrib/init/RedHat/clamav-milter $RPM_BUILD_ROOT%_initrddir/clamav-milter touch $RPM_BUILD_ROOT%milterstatedir/clamav.sock $RPM_BUILD_ROOT%milterlog +%endif + ## ------------------------------------------------------------ @@ -407,6 +468,8 @@ %__chown root:%username %freshclamlog } +%if %{?_with_milter:1}%{!?_with_milter:0} + %pre milter-core %__fe_groupadd 5 -r %milteruser &>/dev/null || : %__fe_useradd 5 -r -s /sbin/nologin -d %milterstatedir -M \ @@ -434,6 +497,8 @@ %postun milter-sysv test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || : +%endif + %post lib -p /sbin/ldconfig %postun lib -p /sbin/ldconfig @@ -486,7 +551,6 @@ %defattr(-,%username,%username,-) %ghost %attr(0664,%username,%username) %homedir/*.cvd - ## ----------------------- %files update @@ -496,8 +560,12 @@ %pkgdatadir/freshclam-sleep %config(noreplace) %verify(not mtime) %_sysconfdir/freshclam.conf %config(noreplace) %verify(not mtime) %_sysconfdir/logrotate.d/* -%config(noreplace) %_sysconfdir/cron.d/* %config(noreplace) %_sysconfdir/sysconfig/freshclam +%if %{?_without_freshclam_daemon:0}%{!?_without_freshclam_daemon:1} +%_initrddir/freshclam +%else +%config(noreplace) %_sysconfdir/cron.d/* +%endif %ghost %attr(0664,root,%username) %verify(not size md5 mtime) %freshclamlog %ghost %attr(0664,%username,%username) %homedir/*.cld @@ -512,18 +580,32 @@ %_sbindir/* %pkgdatadir/clamd-wrapper %dir %_sysconfdir/clamd.d +%if %{?_with_clamd_wrapper:0}%{!?_with_clamd_wrapper:1} +%config(noreplace) %verify(not mtime) %_sysconfdir/clamd.conf +%dir /var/log/clamav +%attr(0750,%username,%username) /var/log/clamav +%endif +%_sysconfdir/logrotate.d/clamav +%if %{?_with_milter:1}%{!?_with_milter:0} %exclude %_sbindir/*milter* %exclude %_mandir/man8/clamav-milter* +%endif %files server-sysv %defattr(-,root,root,-) +%if %{?_with_clamd_wrapper:1}%{!?_with_clamd_wrapper:0} %_initrddir/clamd-wrapper +%else +%_initrddir/clamd +%endif ## ----------------------- +%if %{?_with_milter:1}%{!?_with_milter:0} + %files milter %defattr(-,root,root,-) @@ -546,6 +628,8 @@ %config %_initrddir/clamav-milter %config(noreplace) %verify(not mtime) %_sysconfdir/sysconfig/clamav-milter +%endif + %changelog * Wed Nov 05 2008 Robert Scheck - 0.94.1-1