%define major 7 %define libname %mklibname %{name} %{major} %define develname %mklibname %{name} -d %define milter 1 %{?_with_milter: %{expand: %%global milter 1}} %{?_without_milter: %{expand: %%global milter 0}} Summary: An anti-virus utility for Unix Name: clamav Version: 0.99.1 Release: %mkrel 1 License: GPL Group: Security URL: http://clamav.sourceforge.net/ #Source1: http://downloads.sourceforge.net/clamav/clamav-%{version}.tar.gz.sig # clamav-0.95+ bundles support for RAR v3 in "libclamav" without permission, # from Eugene Roshal of RARlabs. There is also patent issues involved. # # https://bugzilla.redhat.com/show_bug.cgi?id=334371 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=312552 # # Both Redhat and debian removes this code from the upstream tar ball # and repackages it. Source0: %{name}-%{version}-norar.tar.gz Source1: clamd.service Source2: clamd-tempfiles.conf Source3: clamav-clamd.logrotate Source4: freshclam.service Source5: clamav-freshclam.logrotate Source6: clamav-milter.service Source8: clamav-milter.logrotate Source11: http://database.clamav.net/main.cvd Source12: http://database.clamav.net/daily.cvd Patch0: clamav-mga_conf.patch Patch1: clamav-0.98.3-linkage_fix.patch Patch12: clamav-0.95-cliopts.patch Patch13: clamav-0.95rc1-umask.patch Requires(post): clamav-db Requires(preun): clamav-db Requires(post): %{libname} = %{version} Requires(preun): %{libname} = %{version} Requires(post): systemd >= %{systemd_required_version} Requires(post): rpm-helper Requires(preun): rpm-helper Requires(pre): rpm-helper Requires(postun): rpm-helper BuildRequires: bc BuildRequires: bzip2-devel BuildRequires: curl-devel BuildRequires: ncurses-devel BuildRequires: zlib-devel BuildRequires: libxml2-devel BuildRequires: openssl-devel %if %{milter} BuildRequires: sendmail-devel BuildRequires: tcp_wrappers-devel %endif %description Clam AntiVirus is an anti-virus toolkit for Unix. The main purpose of this software is the integration with mail seversions (attachment scanning). The package provides a flexible and scalable multi-threaded daemon, a commandline scanner, and a tool for automatic updating via Internet. The programs are based on a shared library distributed with the Clam AntiVirus package, which you can use in your own software. You can build %{name} with some conditional build swithes; (ie. use with rpm --rebuild): --with[out] milter Build %{name}-milter (disabled) %package -n clamd Summary: The Clam AntiVirus Daemon Group: Security Requires: %{name} = %{version} # (cg) To ensure the tmpfiles are created for the service Requires(post): %{name} = %{version} Requires(post): clamav-db Requires(preun): clamav-db Requires(post): %{libname} = %{version} Requires(preun): %{libname} = %{version} Requires(post): rpm-helper Requires(preun): rpm-helper Requires(pre): rpm-helper Requires(postun): rpm-helper %description -n clamd The Clam AntiVirus Daemon %if %{milter} %package -n %{name}-milter Summary: The Clam AntiVirus milter Daemon Group: Security Requires: %{name} = %{version} Requires: clamd = %{version} Requires: tcp_wrappers # (cg) To ensure the tmpfiles are created for the service Requires(post): %{name} = %{version} Requires(post): clamav-db Requires(preun): clamav-db Requires(post): %{libname} = %{version} Requires(preun): %{libname} = %{version} Requires(post): rpm-helper Requires(preun): rpm-helper Requires(pre): rpm-helper Requires(postun): rpm-helper %description -n %{name}-milter The Clam AntiVirus milter Daemon %endif %package -n %{name}-db Summary: Virus database for %{name} Group: Security Requires: %{name} = %{version} Requires(post): rpm-helper Requires(preun): rpm-helper Requires(pre): rpm-helper Requires(postun): rpm-helper BuildArch: noarch %description -n %{name}-db The actual virus database for %{name} %package -n %{libname} Summary: Shared libraries for %{name} Group: System/Libraries %description -n %{libname} Shared libraries for %{name} %package -n %{develname} Summary: Development library and header files for the %{name} library Group: Development/C Requires: %{libname} = %{version} Provides: %{name}-devel = %{version}-%{release} Obsoletes: %{name}-devel Obsoletes: %{mklibname clamav 1 -d} Obsoletes: %{mklibname clamav 2 -d} Obsoletes: %{mklibname clamav 3 -d} %description -n %{develname} This package contains the static %{libname} library and its header files. %prep %setup -q # clean up for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*` `find . -type d -name .svn`; do if [ -e "$i" ]; then rm -rf $i; fi >&/dev/null done %patch0 -p1 -b .mgaconf %patch1 -p1 -b .linkage_fix %patch12 -p1 -b .cliopts %patch13 -p1 -b .umask # we can't ship libclamunrar if [ -d libclamunrar ]; then echo "delete the libclamunrar directory and repackage the tar ball" exit 1 fi mkdir -p libclamunrar{,_iface} touch libclamunrar/{Makefile.in,all,install} mkdir -p Mageia cp %{SOURCE3} Mageia/clamav-clamd.logrotate cp %{SOURCE5} Mageia/clamav-freshclam.logrotate cp %{SOURCE8} Mageia/clamav-milter.logrotate %build %serverbuild export CFLAGS="$CFLAGS" # IPv6 check is buggy and does not work when there are no IPv6 interface on build machine export have_cv_ipv6=yes %configure2_5x \ --localstatedir=/var/lib \ --disable-%{name} \ --with-user=%{name} \ --with-group=%{name} \ --with-dbdir=/var/lib/%{name} \ --disable-rpath \ --disable-unrar \ --enable-clamdtop \ --enable-id-check \ --enable-fanotify \ --enable-bigstack \ --with-zlib=%{_prefix} \ --with-libbz2-prefix=%{_prefix} \ %if %{milter} --enable-milter --with-tcpwrappers \ %else --disable-milter --without-tcpwrappers \ %endif # anti rpath hack perl -pi -e "s|^sys_lib_dlsearch_path_spec=.*|sys_lib_dlsearch_path_spec=\"/%{_lib} %{_libdir}\"|g" libtool %make %install %makeinstall_std # install the virus-db files %{__install} -D -m 0644 -p %{SOURCE11} %{buildroot}/var/lib/%{name}/main.cvd %{__install} -D -m 0644 -p %{SOURCE12} %{buildroot}/var/lib/%{name}/daily.cvd %if %{milter} # Install the systemd unit+tempfiles %{__install} -D -p -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}-milter.service %endif # install the logrotate stuff %{__install} -d %{buildroot}%{_sysconfdir}/logrotate.d %{__install} -m644 Mageia/clamav-clamd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/clamd %{__install} -m644 Mageia/clamav-freshclam.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/freshclam %if %{milter} %{__install} -m644 Mageia/clamav-milter.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/clamav-milter %endif %{__install} -d %{buildroot}%{_logdir}/%{name} touch %{buildroot}%{_logdir}/%{name}/freshclam.log touch %{buildroot}%{_logdir}/%{name}/clamd.log %if %{milter} %{__install} -m644 etc/clamav-milter.conf.sample %{buildroot}%{_sysconfdir}/clamav-milter.conf touch %{buildroot}%{_logdir}/%{name}/clamav-milter.log %endif # install config files %{__install} -m644 etc/clamd.conf.sample %{buildroot}%{_sysconfdir}/clamd.conf %{__install} -m644 etc/freshclam.conf.sample %{buildroot}%{_sysconfdir}/freshclam.conf # fix TMPDIR %{__install} -d %{buildroot}/var/lib/%{name}/tmp # Install the systemd unit+tempfiles %{__install} -D -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/clamd.service %{__install} -D -p -m 644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf %{__install} -D -p -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/freshclam.service cat > README.qmail+qmail-scanner <<EOF #!/bin/sh # # The "temporary" qmail+qmail-scanner HOWTO # ----------------------------------------- # # For some unknown and undocumented reason clamdscan stopped working # in the excellent qmail+qmail-scanner setup somewhere after the # 20040103 CVS snapshot. # # To get it working again everything assigned to the clamav user has # to be changed to the qscand user by hand. # # Hint: Change the config and chown the directories like this: # (if you are lazy you could just execute this file) perl -pi -e "s|%{name} %{name}|qscand qscand|g" %{_sysconfdir}/logrotate.d/clamd perl -pi -e "s|%{name} %{name}|qscand qscand|g" %{_sysconfdir}/logrotate.d/freshclam perl -pi -e "s|^User %{name}|User qscand|g" %{_sysconfdir}/clamd.conf perl -pi -e "s|^DatabaseOwner %{name}|DatabaseOwner qscand|g" %{_sysconfdir}/freshclam.conf chown -R qscand:qscand /var/lib/%{name} chown -R qscand:qscand %{_logdir}/%{name} chown -R qscand:qscand %{_var}/run/%{name} if [ -x %{_initrddir}/clamd ]; then %{_initrddir}/clamd restart fi if [ -x %{_initrddir}/freshclam ]; then %{_initrddir}/freshclam restart fi # Regards // Oden Eriksson EOF cat > README.urpmi << EOF clamav-0.95+ bundles support for RAR v3 in "libclamav" without permission, from Eugene Roshal of RARlabs. There is also patent issues involved. Therefore %_vendor has been forced to remove the offending code. EOF %multiarch_binaries %{buildroot}%{_bindir}/clamav-config # cleanup rm -f %{buildroot}%{_sysconfdir}/*.conf.sample %pre %_pre_useradd %{name} /var/lib/%{name} /bin/sh if ! [ -z "`getent group amavis`" ]; then gpasswd -a %{name} amavis fi %post %_tmpfilescreate %{name} %_post_service freshclam %create_ghostfile %{_logdir}/%{name}/freshclam.log %{name} %{name} 0644 %preun %_preun_service freshclam %pre -n clamd %_pre_useradd %{name} /var/lib/%{name} /bin/sh %post -n clamd %_post_service clamd %create_ghostfile %{_logdir}/%{name}/clamd.log %{name} %{name} 0644 %preun -n clamd %_preun_service clamd %postun -n clamd %_postun_userdel %{name}%{_tmpfilesdir}/clamd.conf %if %{milter} %post -n %{name}-milter %_post_service %{name}-milter %create_ghostfile %{_logdir}/%{name}/clamav-milter.log %{name} %{name} 0644 %preun -n %{name}-milter %_preun_service %{name}-milter %endif %pre -n %{name}-db %_pre_useradd %{name} /var/lib/%{name} /bin/sh %post -n %{name}-db # try to keep most uptodate database for i in main daily; do if [ -f %{_var}/lib/clamav/$i.cvd.rpmnew ]; then if [ %{_var}/lib/clamav/$i.cvd.rpmnew -nt %{_var}/lib/%{name}/$i.cvd ]; then mv -f %{_var}/lib/clamav/$i.cvd.rpmnew %{_var}/lib/%{name}/$i.cvd else rm -f %{_var}/lib/clamav/$i.cvd.rpmnew fi fi done # take care of "[LibClamAV] Detected duplicate databases /var/lib/clamav/main.cvd and /var/lib/clamav/main.cld, please manually remove one of them" if [ %{_var}/lib/clamav/main.cld -nt %{_var}/lib/clamav/main.cvd ]; then mv %{_var}/lib/clamav/main.cld %{_var}/lib/clamav/main.cvd else rm -f %{_var}/lib/clamav/main.cld fi %postun -n %{name}-db %_postun_userdel %{name} %files %doc AUTHORS BUGS FAQ NEWS README test UPGRADE README.urpmi %doc docs/*.pdf %doc README.qmail+qmail-scanner COPYING* %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/clamd.conf %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/freshclam.conf %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/freshclam %{_bindir}/clambc %{_bindir}/clamconf %{_bindir}/clamdscan %{_bindir}/clamdtop %{_bindir}/clamscan %{_bindir}/freshclam %{_bindir}/clamsubmit %{_unitdir}/freshclam.service %{_tmpfilesdir}/%{name}.conf %{_bindir}/sigtool %{_mandir}/man1/clambc.* %{_mandir}/man1/clamconf.1.* %{_mandir}/man1/clamdscan.1* %{_mandir}/man1/clamdtop.1* %{_mandir}/man1/clamscan.1* %{_mandir}/man1/freshclam.1* %{_mandir}/man1/sigtool.1* %{_mandir}/man1/clamsubmit.1* %{_mandir}/man5/clamd.conf.5* %{_mandir}/man5/freshclam.conf.5* %if !%{milter} %exclude %{_mandir}/man8/%{name}-milter.8* %endif %dir %attr(0775,%{name},%{name}) /var/lib/%{name} %dir %attr(0740,%{name},%{name}) %{_logdir}/%{name} %ghost %attr(0644,%{name},%{name}) %{_logdir}/%{name}/freshclam.log %files -n clamd %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/clamd %{_unitdir}/clamd.service %{_sbindir}/clamd %{_mandir}/man8/clamd.8* %ghost %attr(0644,%{name},%{name}) %{_logdir}/%{name}/clamd.log %if %{milter} %files -n %{name}-milter %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/clamav-milter.conf %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/clamav-milter %{_sbindir}/%{name}-milter %{_unitdir}/%{name}-milter.service %{_mandir}/man8/%{name}-milter.8* %{_mandir}/man5/%{name}-milter.conf.5* %ghost %attr(0644,%{name},%{name}) %{_logdir}/%{name}/clamav-milter.log %endif %files -n %{name}-db %dir %attr(0775,%{name},%{name}) /var/lib/%{name} %dir %attr(0755,%{name},%{name}) /var/lib/%{name}/tmp %attr(0644,%{name},%{name}) %config(noreplace) /var/lib/%{name}/daily.cvd %attr(0644,%{name},%{name}) %config(noreplace) /var/lib/%{name}/main.cvd %files -n %{libname} %{_libdir}/*.so.%{major}* %files -n %{develname} %multiarch %{multiarch_bindir}/clamav-config %{_bindir}/clamav-config %{_includedir}/* %{_libdir}/*.so %{_libdir}/*.*a %{_libdir}/pkgconfig/libclamav.pc %changelog * Thu Mar 03 2016 spuhler <spuhler> 0.99.1-1.mga5 + Revision: 983997 - upgrade to vers. 0.99.1 * bug fixes - upgrade to vers. 0.99.1 * bug fixes * Wed Apr 29 2015 spuhler <spuhler> 0.98.7-1.mga5 + Revision: 820846 - upgrade to 0.98.7 - replaced daily.cvd with new one * Thu Jan 29 2015 spuhler <spuhler> 0.98.6-1.mga5 + Revision: 812667 - upgrade to version 0.98.6 * Wed Nov 19 2014 oden <oden> 0.98.5-1.mga5 + Revision: 797854 - rediff P12 - 0.98.5 - new database files + spuhler <spuhler> - rebuilt with new sendmail-devel * Wed Nov 12 2014 cjw <cjw> 0.98.4-5.mga5 + Revision: 796537 - rebuild with new sendmail-devel * Wed Oct 15 2014 umeabot <umeabot> 0.98.4-4.mga5 + Revision: 743620 - Second Mageia 5 Mass Rebuild * Thu Sep 18 2014 umeabot <umeabot> 0.98.4-3.mga5 + Revision: 693615 - Rebuild to fix library dependencies * Tue Sep 16 2014 umeabot <umeabot> 0.98.4-2.mga5 + Revision: 678408 - Mageia 5 Mass Rebuild * Fri Jun 20 2014 spuhler <spuhler> 0.98.4-1.mga5 + Revision: 638223 - upgrade to ver. 0.98.4 * Fri May 16 2014 oden <oden> 0.98.3-5.mga5 + Revision: 622985 - fix deps - disable the default "Enable statistical reporting" feature, sneaky! * Wed May 14 2014 colin <colin> 0.98.3-4.mga5 + Revision: 622859 - Fix milter unit file sourcename mixup (got same unit as clamd) mga#13014 - Fix Requires to ensure tmpfiles have been run for clamd+milter - Minor tweak to milter systemd unit for consistency + fix description * Wed May 14 2014 colin <colin> 0.98.3-3.mga5 + Revision: 622747 - Fix broken freshclam.service (ran only once a boot not as deamon + incorrect config) - Update *.service to drop support for (unused) EnvironmentFile options (never passed to Exec*) - Drop all unused sysconfig files. * Thu May 08 2014 spuhler <spuhler> 0.98.3-2.mga5 + Revision: 621238 + rebuild (emptylog) * Thu May 08 2014 spuhler <spuhler> 0.98.3-1.mga5 + Revision: 621237 - added the filesubmit files to the file section - replaced clamav-0.95-linkage_fix.diff with clamav-0.98.3-linkage_fix.patch file - replaced old daily.cvd file - revoved Conflicts: clamd < 0.91 - upgrade to 0.98.3 * Thu Mar 13 2014 spuhler <spuhler> 0.98.1-4.mga5 + Revision: 603127 - need same permission in clamd and clamav-db for the same dir * Thu Mar 13 2014 spuhler <spuhler> 0.98.1-3.mga5 + Revision: 602757 - made dir /var/lib/%%{name} group writable * clamd is recommanded to run as clamav and be added to group amavis * amavis needs write access to use clamd + neoclust <neoclust> - Use %%_vendor instead of hardcoding Mageia name * Thu Jan 16 2014 oden <oden> 0.98.1-1.mga4 + Revision: 566666 - 0.98.1 * Sat Dec 21 2013 spuhler <spuhler> 0.98-8.mga4 + Revision: 559615 - changed %%dir %%attr(0775,%%{name},%%{name}) from 775 to 740 * this fixes the problem preventing logrotate to actually succeed * Wed Dec 18 2013 oden <oden> 0.98-7.mga4 + Revision: 558414 - take care of dupes * Mon Dec 02 2013 spuhler <spuhler> 0.98-6.mga4 + Revision: 554694 - more name fixes in spec file * Sat Nov 30 2013 spuhler <spuhler> 0.98-5.mga4 + Revision: 554124 - added EnvironmentFile= to the service file - renamed teh service files to use the same name as the init version * Fri Nov 22 2013 spuhler <spuhler> 0.98-4.mga4 + Revision: 552359 - more bug fixes - changed it to uses systemd - removed invalid daemon option - added User=clamav option - added the correct config file * Wed Nov 20 2013 spuhler <spuhler> 0.98-3.mga4 + Revision: 552091 -fixes in .service files and spec file - removed the pidfile section of the Exe lines - added the --daemon option to Type=forking line - this file replaces the one nmed clamd.service - removed the pidfile section of the Exe lines * Sun Nov 17 2013 spuhler <spuhler> 0.98-2.mga4 + Revision: 551604 - updated to native systemd + oden <oden> - more backporting fixes * Fri Sep 20 2013 oden <oden> 0.98-1.mga4 + Revision: 481683 - 0.98 (http://blog.clamav.net/2013/09/clamav-098-has-been-released.html) - rediff and drop some patches - adjust deps and options accordingly - make the package backportable * Wed Apr 24 2013 spuhler <spuhler> 0.97.8-1.mga3 + Revision: 411099 - upgrade to version 0.97.8 - security fix * Sun Mar 24 2013 colin <colin> 0.97.7-3.mga3 + Revision: 404859 - Add systemd requires and general post/pre fixes (mga#9302) * Fri Mar 15 2013 oden <oden> 0.97.7-2.mga3 + Revision: 403239 - bump release - 0.97.7 * Sun Jan 13 2013 luigiwalser <luigiwalser> 0.97.6-4.mga3 + Revision: 380001 - add tmpfiles config for /run/clamav * Fri Jan 11 2013 umeabot <umeabot> 0.97.6-3.mga3 + Revision: 347805 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Mon Dec 31 2012 spuhler <spuhler> 0.97.6-2.mga3 + Revision: 336749 - added the main.cvd and daily.cvd file - adding main-54.cvd file - adding daily-16198 file + malo <malo> - update RPM group * Thu Oct 18 2012 spuhler <spuhler> 0.97.6-1.mga3 + Revision: 307972 - removed the database in the spec as they are not privided anymore - upgrade to version 0.97.6 * Mon Jun 18 2012 spuhler <spuhler> 0.97.5-1.mga3 + Revision: 261335 - Update to version 0.97.5 fix security issues CVE-2012-1457, CVE-2012-1458, CVE-2012-1459 * Tue May 08 2012 pterjan <pterjan> 0.97.4-2.mga2 + Revision: 234920 - Fix initscript's LSB header * Sat Mar 24 2012 spuhler <spuhler> 0.97.4-1.mga2 + Revision: 226104 - upgrade to 0.97.4 * Wed Oct 19 2011 dlucio <dlucio> 0.97.3-3.mga2 + Revision: 156581 - 0.97.3 * Fri Sep 02 2011 tv <tv> 0.97.2-3.mga2 + Revision: 137796 - add missing LSB keywords - make the huge db subpackage be noarch + stormi <stormi> - bump release so that it's higher than in mageia 1 + dlucio <dlucio> - 0.97.2 - 0.97.2 * Thu Jun 30 2011 ahmad <ahmad> 0.97.1-1.mga2 + Revision: 116269 - Update to 0.97.1 - Rediff (and rename) patch0 - Update the file list * Wed Jun 15 2011 kharec <kharec> 0.97-2.mga2 + Revision: 107230 - rebuild for sync repos * Sun Feb 27 2011 spuhler <spuhler> 0.97-1.mga2 + Revision: 61079 - upgrade from 0.96.5 to 0.97 replaced all Mandrake and Mandriva names with Mageia changed rel to 1 removed buildroot line from spec file * Mon Jan 24 2011 ennael <ennael> 0.96.5-0.1.mga1 + Revision: 36833 - clean conditions - remove mdkversion + kharec <kharec> - imported package clamav