Hi, my spec file is this:
Name: clamav
Version: 0.92
Release: 1
Epoch: 102
License: GPL
Group: System Environment/Daemons
Source0: http://download.sf.net/clamav/%{name}-%{version}.tar.gz
Source1: clamd.sh
Source2: clamav-milter.sh
Source3: freshclam.sh
Source4: clamav-milter.sysconfig
Source5: clamd.logrotate
Source6: freshclam.logrotate
Source7: RPM-clamav.txt
Source8: RPM-clamav-milter.txt
Source9: clamav-milter.daily
Source10: freshclam.daily
Requires: bzip2-libs gmp zlib >= 1.2.1.2
Requires: curl libidn
BuildRequires: bzip2-devel gmp-devel zlib-devel >= 1.2.1.2
BuildRequires: autoconf automake
BuildRequires: curl-devel libidn-devel
Obsoletes: clamav-lib clamav-update
BuildRoot: %{_tmppath}/%{name}-%{version}-root
..
%if %{!?_without_milter:1}%{?_without_milter:0}
%package milter
Summary: Clamav - milter
Group: System Environment/Daemons
License: GPL
Requires: %{name}-server = %{epoch}:%{version}-%{release}
Requires: sendmail >= 8.12
Requires: sendmail-cf >= 8.12
Requires: tcp_wrappers
BuildRequires: sendmail-devel >= 8.12
BuildRequires: tcp_wrappers
..
%package server
Summary: Clamav - clamd an anti-virus daemon
Group: System Environment/Daemons
Requires: %{name} = %{epoch}:%{version}-%{release}
Obsoletes: clamd
..
%package devel
Summary: Clamav - Development header files and libraries
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}
%description devel
%package db
Summary: Clamav - virus patterns DB
Group: System Environment/Daemons
Requires: %{name} = %{epoch}:%{version}-%{release}
Obsoletes: clamav-data
..
%prep
%setup -q
%build
%configure \
--program-prefix=%{?_program_prefix} \
%{!?_without_milter:--enable-milter} \
--enable-dns \
--with-libcurl \
--disable-clamav \
--enable-id-check \
--with-user=clamav \
--with-group=clamav \
--disable-zlib-vcheck \
--with-dbdir=%{_localstatedir}/lib/clamav
%{__make}
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_initrddir}/
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
install -d $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/
install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/clamav/
install -d $RPM_BUILD_ROOT%{_localstatedir}/log/clamav/
install -d $RPM_BUILD_ROOT%{_localstatedir}/run/clamav/
install -d $RPM_BUILD_ROOT%{_localstatedir}/spool/clamav/
%{__make} DESTDIR=$RPM_BUILD_ROOT install
%{?_without_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
install %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/clamd
install %{SOURCE3} $RPM_BUILD_ROOT%{_initrddir}/freshclam
install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/clamd
install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/freshclam
install etc/clamd.conf $RPM_BUILD_ROOT%{_sysconfdir}/clamd.conf
install etc/freshclam.conf $RPM_BUILD_ROOT%{_sysconfdir}/freshclam.conf
install %{SOURCE7} RPM-clamav.txt
install %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/freshclam
touch $RPM_BUILD_ROOT%{_localstatedir}/log/clamav/clamav.log
touch $RPM_BUILD_ROOT%{_localstatedir}/log/clamav/freshclam.log
..
# Milter
%if %{!?_without_milter:1}%{?_without_milter:0}
install %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/clamav-milter
install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/clamav-milter
install %{SOURCE8} RPM-clamav-milter.txt
install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/clamav-milter
%endif
#
# Customize config files
sed -e 's!^Example!#Example!;
s!^#LogFile .*!LogFile /var/log/clamav/clamd.log!;
s!^#LogFileMaxSize .*!LogFileMaxSize 0!;
s!^#LogTime!LogTime!;
s!^#LogSyslog!LogSyslog!;
s!^#PidFile .*!PidFile /var/run/clamav/clamd.pid!;
s!^#TemporaryDirectory .*!TemporaryDirectory /tmp!;
s!^#DatabaseDirectory .*!DatabaseDirectory /var/lib/clamav!;
s!^LocalSocket .*!#LocalSocket /var/run/clamav/clamd.sock!;
s!^#TCPSocket .*!TCPSocket 3310!;
s!^#MaxConnectionQueueLength .*!MaxConnectionQueueLength 30!;
s!^#MaxThreads .*!MaxThreads 50!;
s!^#ReadTimeout .*!ReadTimeout 300!;
s!^#User .*!User clamav!;
s!^#AllowSupplementaryGroups!AllowSupplementaryGroups!;
s!^#DetectBrokenExecutables!DetectBrokenExecutables!;
s!^#ScanMail!ScanMail!;
s!^#ArchiveMaxCompressionRatio .*!ArchiveMaxCompressionRatio 300!;
s!^#ArchiveBlockEncrypted!ArchiveBlockEncrypted!;
s!^#ArchiveBlockMax!ArchiveBlockMax!;' \
etc/clamd.conf > $RPM_BUILD_ROOT%{_sysconfdir}/clamd.conf
sed -e 's!^Example!#Example!;
s!^#DatabaseDirectory .*!DatabaseDirectory /var/lib/clamav!;
s!^#UpdateLogFile .*!UpdateLogFile /var/log/clamav/freshclam.log!;
s!^#PidFile .*!PidFile /var/run/clamav/freshclam.pid!;
s!^#DatabaseOwner .*!DatabaseOwner clamav!;
s!^#AllowSupplementaryGroups!AllowSupplementaryGroups!;
s!^#DNSDatabaseInfo .*!DNSDatabaseInfo current.cvd.clamav.net!;
s!^#Checks .*!Checks 24!;
s!^#NotifyClamd .*!NotifyClamd /etc/clamd.conf!;' \
etc/freshclam.conf > $RPM_BUILD_ROOT%{_sysconfdir}/freshclam.conf
#
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
..
%pre
# Add clamav user
if [ -z "`/usr/bin/id -g clamav 2>/dev/null`" ]; then
/usr/sbin/groupadd -g 46 -r -f clamav 2>&1 || :
fi
if [ -z "`/usr/bin/id -u clamav 2>/dev/null`" ]; then
/usr/sbin/useradd -u 46 -r -M -d /tmp -s /sbin/nologin -c "Clam
AntiVirus" -g clamav clamav 2>&1 || :
fi
#
%post
/sbin/ldconfig
/sbin/chkconfig --add freshclam
ZONES="/usr/share/zoneinfo/zone.tab"
CONFIG="/etc/sysconfig/clock"
FRESHCFG=`/bin/mktemp /tmp/freshclam.XXXXXX`
if [ -r "$CONFIG" -a -r "$ZONES" ]; then
source "$CONFIG"
export CODE="$(grep -E "\b$ZONE\b" "$ZONES" | head -1 | cut -f1 | tr
[A-Z] [a-z])"
fi
if [ -z "$CODE" ]; then
export CODE="local"
fi
sed -e "s%^#DatabaseMirror .*%DatabaseMirror db.$CODE.clamav.net%" \
%{_sysconfdir}/freshclam.conf > $FRESHCFG
mv $FRESHCFG %{_sysconfdir}/freshclam.conf
if [ -f %{_sysconfdir}/freshclam.conf.rpmnew ]; then
sed -e "s%^#DatabaseMirror .*%DatabaseMirror db.$CODE.clamav.net%" \
%{_sysconfdir}/freshclam.conf.rpmnew > $FRESHCFG
mv $FRESHCFG %{_sysconfdir}/freshclam.conf.rpmnew
fi
chmod 0640 %{_sysconfdir}/freshclam.conf*
if [ $1 -eq 1 ]; then
freshclam --verbose 2>/dev/null
exit 0
fi
%preun
if [ $1 -eq 0 ]; then
/sbin/service freshclam stop > /dev/null 2>&1 || :
/sbin/chkconfig --del freshclam
fi
%postun
/sbin/ldconfig
if [ $1 -eq 0 ]; then
rm -rf %{_localstatedir}/run/clamav/
rm -rf %{_localstatedir}/log/clamav/
rm -rf %{_localstatedir}/lib/clamav/
/usr/sbin/userdel -r clamav > /dev/null 2>&1 || :
else
/sbin/service freshclam condrestart > /dev/null 2>&1 || :
fi
%post server
/sbin/chkconfig --add clamd
CLAMUSER=`grep ^User /etc/clamd.conf | cut -d ' ' -f2`
if [ -z $CLAMUSER ] ; then
CLAMUSER="clamav"
fi
if [ $CLAMUSER != "clamav" -a `/usr/bin/id $CLAMUSER > /dev/null 2>&1 ; echo
$?` = 0 ] ; then
echo "WARNING!!!"
echo "This function will be removed on next version."
echo " More details on [EMAIL PROTECTED]"
chown root:$CLAMUSER %{_sysconfdir}/clamd.conf
chown root:$CLAMUSER %{_sysconfdir}/freshclam.conf
chown -R $CLAMUSER:$CLAMUSER %{_localstatedir}/lib/clamav/
chown -R $CLAMUSER:$CLAMUSER %{_localstatedir}/log/clamav/
chown -R $CLAMUSER:$CLAMUSER %{_localstatedir}/run/clamav/
fi
#
%preun server
if [ $1 -eq 0 ]; then
/sbin/service clamd stop > /dev/null 2>&1 || :
/sbin/chkconfig --del clamd
fi
%postun server
if [ $1 -ge 1 ]; then
/sbin/service clamd condrestart > /dev/null 2>&1 || :
fi
# Milter
%if %{!?_without_milter:1}%{?_without_milter:0}
%post milter
/sbin/chkconfig --add clamav-milter
%preun milter
if [ $1 -eq 0 ]; then
/sbin/service clamav-milter stop > /dev/null 2>&1 || :
/sbin/chkconfig --del clamav-milter
fi
%postun milter
if [ $1 -ge 1 ]; then
/sbin/service clamav-milter condrestart > /dev/null 2>&1 || :
fi
%endif
#
%files
%defattr(0644,root,root,0755)
%doc AUTHORS BUGS COPYING ChangeLog FAQ INSTALL NEWS README
%doc docs/*.pdf docs/html/ test/ RPM-clamav.txt
#%lang(de) %doc docs/German
%attr(0640,root,clamav) %config(noreplace) %{_sysconfdir}/freshclam.conf
%attr(0755,root,root) %{_sysconfdir}/cron.daily/freshclam
%attr(0644,root,root) %config(noreplace)
%{_sysconfdir}/logrotate.d/freshclam
%attr(0755,root,root) %{_initrddir}/freshclam
%attr(0755,root,root) %{_bindir}/*
%attr(0755,root,root) %{_libdir}/libclamav.so.*
%attr(0755,clamav,clamav) %dir %{_localstatedir}/lib/clamav/
%attr(0755,clamav,clamav) %dir %{_localstatedir}/log/clamav/
%attr(0755,clamav,clamav) %dir %{_localstatedir}/run/clamav/
%attr(0640,clamav,clamav) %ghost %{_localstatedir}/log/clamav/freshclam.log
%{_mandir}/man1/*
%{_mandir}/man5/*
%files server
%attr(0644,root,clamav) %config(noreplace) %{_sysconfdir}/clamd.conf
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/clamd
%attr(0755,root,root) %{_initrddir}/clamd
%attr(0755,root,root) %{_sbindir}/clamd
%attr(0640,clamav,clamav) %ghost %{_localstatedir}/log/clamav/clamav.log
%{_mandir}/man8/clamd.8*
# Milter
%if %{!?_without_milter:1}%{?_without_milter:0}
%files milter
%defattr(0644,root,root,0755)
%doc RPM-clamav-milter.txt
%attr(0644,root,root) %config(noreplace)
%{_sysconfdir}/sysconfig/clamav-milter
%attr(0755,root,root) %{_initrddir}/clamav-milter
%attr(0755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
%attr(0755,root,root) %{_sbindir}/clamav-milter
%{_mandir}/man8/clamav-milter.8*
%attr(0700,clamav,clamav) %{_localstatedir}/spool/clamav/
%endif
#
%files devel
%defattr(0644,root,root,0755)
%attr(0755,root,root) %{_libdir}/libclamav.so
%attr(0755,root,root) %{_libdir}/*.a
%attr(0755,root,root) %{_libdir}/*.la
%attr(0644,root,root) %{_includedir}/*.h
%attr(0644,root,root) %{_libdir}/pkgconfig/libclamav.pc
%files db
%defattr(0644,root,root,0755)
%attr(0644,clamav,clamav) %config(noreplace) %verify(user group mode)
%{_localstatedir}/lib/clamav/main.cvd
%attr(0644,clamav,clamav) %config(noreplace) %verify(user group mode)
%{_localstatedir}/lib/clamav/daily.cvd
..this spec file is incorrect ??
Thanks.
------
Salvatore.
----- Original Message -----
From: "Andre Huebner" <[EMAIL PROTECTED]>
To: "ClamAV users ML" <[email protected]>
Sent: Tuesday, December 18, 2007 9:10 PM
Subject: Re: [Clamav-users] rpm failed on 0.92
you have to check your spec-file which is used to build your clam 0.92
this file seems to be new to your spec and is installed into your libdir
add it to %files-section
André
----- Original Message -----
From: "Sasa" <[EMAIL PROTECTED]>
To: "ClamAV users ML" <[email protected]>
Sent: Tuesday, December 18, 2007 8:10 PM
Subject: [Clamav-users] rpm failed on 0.92
> Hi, on Fedora core 3 I have a problem with rpm construction for to use
> clamav-0.92, when I execute:
>
> #rpmbuild --target i386 -ba SPECS/clamav.spec
>
> I have this error:
>
> Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
> rpmlib(PayloadFilesHavePrefix) <= 4.0-1
> Checking for unpackaged file(s): /usr/lib/rpm/check-files
> /var/tmp/clamav-0.92-root
> error: Installed (but unpackaged) file(s) found:
> /usr/lib/libclamunrar.so.3.0.3
> /usr/lib/libclamunrar_iface.so.3.0.3
> RPM build errors:
> Installed (but unpackaged) file(s) found:
> /usr/lib/libclamunrar.so.3.0.3
> /usr/lib/libclamunrar_iface.so.3.0.3
>
> ..now I have:
>
> [EMAIL PROTECTED] ~]# rpm -qa|grep unrar
> unrar-3.6.8-1.fc3.rf
> [EMAIL PROTECTED] ~]# rpm -qa|grep clam
> clamav-0.91.2-1
>
> ..what's the rpm file that I must upgrade ?
> Thanks.
>
> ------
>
> Salvatore.
>
> _______________________________________________
> Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
> http://lurker.clamav.net/list/clamav-users.html
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.17.4/1188 - Release Date:
> 17.12.2007 14:13
>
>
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html