clamav for f14/f15 with systemd

Kim Bisgaard <[email protected]>
Newsgroups gmane.linux.redhat.rpm.atrpms.devel
Message-ID <[email protected]>
Hi,

I have messed around a bit with the f14 clamav spec-file, as to get it 
to work on f15 - basically adding tmpfiles.d config.

I have attached the spec-file and tmpfiles config.

Regards,
Kim
clamav.spec (text/plain, 10.6 KB)
%bcond_without llvm
%bcond_without milter
%bcond_without systemd

Summary: A GPL virus scanner
Name: clamav
Version: 0.97
Release: 58%{?dist}
Epoch: 1
License: GPL
Group: System Environment/Daemons
URL: http://www.clamav.net/
Source0: http://prdownloads.sourceforge.net/clamav/clamav-%{version}.tar.gz
Source1: http://prdownloads.sourceforge.net/clamav/clamav-%{version}.tar.gz.sig
Source2: clamav.logrotate
Source3: clamav.init
Source4: clamav.sysconfig
Source5: clamav.tmpfiles
Patch0: clamav-0.96-config.patch
Patch1: clamav-0.94-freshclamexample.patch
#Patch2: clamav-0.95.3-sysconf.patch
#Patch3: clamav-0.96.2-selinux.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
#BuildRequires: autoconf, automake, libtool, file
BuildRequires: gcc-c++
BuildRequires: zlib-devel
BuildRequires: bzip2-devel, gmp-devel >= 3
BuildRequires: sendmail-devel
%{?with_milter:BuildRequires: sendmail-milter}
BuildRequires: curl-devel >= 7.10.0
BuildRequires: tcp_wrappers
BuildRequires: check-devel
BuildRequires: ncurses-devel
Requires(pre): /sbin/chkconfig, /sbin/service
# Crisis on infinite subpackages
Provides: clamav-update = %{evr}, clamav-server-sysv = %{evr}
Provides: clamav-server = %{evr}, clamav-milter-sysv = %{evr}
Provides: clamav-milter-upstart = %{evr}
Provides: clamav-milter = %{evr}, clamav-lib = %{evr}
Provides: clamav-filesystem = %{evr}, clamav-data-empty = %{evr},
Provides: clamav-data = %{evr}, clamav-data-empty = %{evr}
Provides: clamav-db = %{evr}, clamd = %{evr}
Provides: clamav-scanner = %{evr}, clamav-scanner-sysvinit = %{evr}
Provides: clamav-scanner-sysvinit = %{evr}
Obsoletes: clamav-update < %{evr}, clamav-server-sysv < %{evr}
Obsoletes: clamav-server < %{evr}, clamav-milter-sysv < %{evr}
Obsoletes: clamav-milter-upstart < %{evr}
Obsoletes: clamav-milter < %{evr}, clamav-lib < %{evr}
Obsoletes: clamav-filesystem < %{evr}, clamav-data-empty < %{evr},
Obsoletes: clamav-data < %{evr}, clamav-data-empty < %{evr}
Obsoletes: clamav-db < %{evr}, clamd < %{evr}
Obsoletes: clamav-scanner < %{evr}, clamav-scanner-sysvinit < %{evr}
Obsoletes: clamav-scanner-sysvinit < %{evr}

%description
Clam AntiVirus is a GPL anti-virus toolkit for UNIX. The main purpose
of this software is the integration with mail servers (attachment
scanning). The package provides a flexible and scalable multi-threaded
daemon, a command line 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 with your own software.

Most importantly, the virus database is kept up to date .

%package devel
Summary: Development package for %{name}
Group: Development/Libraries
Requires: %{name} = %{evr}

%description devel
Use this package for building/developing applications against %{name}.

%prep
%setup -q
%patch0 -p1 -b .config
%patch1 -p1 -b .noexample
#patch2 -p1 -b .sysconf
#patch3 -p1 -b .selinux

%build
%configure \
        --disable-dependency-tracking \
        --disable-static \
        --disable-zlib-vcheck \
        --with-dbdir=/var/lib/clamav \
        --enable-milter \
        --disable-clamav \
        --enable-readdir_r \
        --with-libcurl \
        --with-tcpwrappers \
        %{?with_llvm:--enable-llvm} %{!?with_llvm:--disable-llvm} \
        --enable-check \
        --enable-clamdtop
make
# check fails on F12
make check || :

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}

install -d %{buildroot}%{_sysconfdir}/logrotate.d \
   %{buildroot}%{_initdir} \
   %{buildroot}%{_sysconfdir}/sysconfig
install -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/clamav
install -p -m 0755 %{SOURCE3} %{buildroot}%{_initdir}/clamav
install -p -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/clamav
%if %{with systemd}
install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/tmpfiles.d/clamav.conf
%endif

install -d %{buildroot}/var/lib/clamav
install -d %{buildroot}/var/run/clamav

# workaround for https://wwws.clamav.net/bugzilla/show_bug.cgi?id=1476
test -f %{buildroot}%{_libdir}/libclamunrar_iface.so || \
  ln -s libclamunrar_iface.so.6 %{buildroot}%{_libdir}/libclamunrar_iface.so

%clean
rm -rf %{buildroot}

%pre
/usr/sbin/useradd -c "Clam AntiVirus" \
        -s /sbin/nologin -r -d /var/lib/clamav clamav 2> /dev/null || :

%post
/sbin/ldconfig
if [ $1 -eq 1 ]; then
%if %{with systemd}
  /bin/systemctl daemon-reload >/dev/null 2>&1 || :
%else
  /sbin/chkconfig --add clamav
%endif
fi

%preun
if [ $1 = 0 ]; then
%if %{with systemd}
  /bin/systemctl disable clamav.service >/dev/null 2>&1 || :
  /bin/systemctl stop clamav.service >/dev/null 2>&1 || :  
%else
  /sbin/service clamav stop > /dev/null 2>&1
  /sbin/chkconfig --del clamav
%endif
fi

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS BUGS ChangeLog COPYING FAQ NEWS README
%doc docs/*.pdf
%config(noreplace) %{_sysconfdir}/sysconfig/clamav
%config(noreplace) %{_sysconfdir}/clamd.conf
%config(noreplace) %{_sysconfdir}/freshclam.conf
%{_bindir}/clamdscan
%{_bindir}/clamscan
%{_bindir}/clamconf
%{_bindir}/clamdtop
%{_bindir}/clambc
%{_bindir}/freshclam
%{_bindir}/sigtool
%{_sbindir}/clamav-milter
%{_sbindir}/clamd
%{_mandir}/man1/clamdscan.1*
%{_mandir}/man1/clamscan.1*
%{_mandir}/man1/clamconf.1*
%{_mandir}/man1/freshclam.1*
%{_mandir}/man1/sigtool.1*
%{_mandir}/man5/clamd.conf.5*
%{_mandir}/man5/freshclam.conf.5*
%{_mandir}/man5/clamav-milter.conf.5*
%{_mandir}/man8/clamav-milter.8*
%{_mandir}/man8/clamd.8*
%{_mandir}/man1/clamdtop.1*
%{_libdir}/libclamav.so.*
%{_libdir}/libclamunrar.so.*
%{_libdir}/libclamunrar_iface.so.*
%config(noreplace) %{_sysconfdir}/logrotate.d/clamav
%config(noreplace) %{_sysconfdir}/clamav-milter.conf
%if %{with systemd}
%config(noreplace) %{_sysconfdir}/tmpfiles.d/clamav.conf
%endif
%{_initdir}/clamav
%attr(0755,clamav,clamav) /var/run/clamav
%dir %attr(0755,clamav,clamav) /var/lib/clamav
%attr(0644,clamav,clamav) %verify(not mtime size md5) /var/lib/clamav/main.cvd
%attr(0644,clamav,clamav) %verify(not mtime size md5) /var/lib/clamav/daily.cvd

%files devel
%defattr(-,root,root,-)
%{_bindir}/clamav-config
%{_includedir}/clamav.h
%{_libdir}/libclamav.la
%{_libdir}/libclamav.so
%{_libdir}/libclamunrar.la
%{_libdir}/libclamunrar.so
%{_libdir}/libclamunrar_iface.la
%{_libdir}/libclamunrar_iface.so
%{_libdir}/pkgconfig/libclamav.pc


%changelog
* Sun Jun  5 2011 Kim Bisgaard <[email protected]> - 1:0.97-58
- Add systemd config

* Sun Feb 13 2011 Axel Thimm <[email protected]> - 1:0.97-57
- Update to 0.97.

* Fri Dec  3 2010 Axel Thimm <[email protected]> - 1:0.96.5-56
- Update to 0.96.5.

* Sun Nov 21 2010 Axel Thimm <[email protected]> - 1:0.96.4-55
- Update to 0.96.4.

* Sun Sep 26 2010 Axel Thimm <[email protected]> - 1:0.96.3-54
- Update to 0.96.3.

* Wed Aug 18 2010 Kim Bisgaard <[email protected]> - 1:0.96.2-52
- Add patch for selinux supporton RHEL5/CentOS5/SL5.
- Add BR sendmail-milter.

* Fri Aug 13 2010 Axel Thimm <[email protected]> - 1:0.96.2-51
- Update to 0.96.2.

* Fri May 21 2010 Axel Thimm <[email protected]> - 1:0.96.1-50
- Update to 0.96.1.

* Mon Apr  5 2010 Kim Bisgaard <[email protected]> - 1:0.96-48
- Update to 0.96

* Mon Dec 28 2009 Axel Thimm <[email protected]> - 1:0.95.3-47
- It's official, he's mad.

* Mon Oct 29 2009 Axel Thimm <[email protected]> - 0.95.3-46
- Update to 0.95.3.

* Mon Jun 22 2009 Axel Thimm <[email protected]> - 0.95.2-45
- Update to 0.95.2.

* Thu Apr  9 2009 Kim Bisgaard <[email protected]> - 0.95.1-44
- Update to 0.95.1 and include clamdtop executable

* Tue Mar 24 2009 Axel Thimm <[email protected]> - 0.95-42
- Update to 0.95.

* Thu Nov 27 2008 Axel Thimm <[email protected]> - 0.94.2-41
- Update to 0.94.2.

* Mon Nov  3 2008 Axel Thimm <[email protected]> - 0.94.1-40
- Update to 0.94.1.

* Fri Sep  5 2008 Kim Bisgaard <[email protected]> - 0.94-38
- Update to 0.94

* Tue Jul  8 2008 Axel Thimm <[email protected]> - 0.93.3-37
- Update to 0.93.3.

* Wed Jun 11 2008 Axel Thimm <[email protected]> - 0.93.1-36
- Update to 0.93.1.

* Mon Apr 14 2008 Axel Thimm <[email protected]> - 0.93-35
- Update to 0.93.

* Sat Feb 16 2008 Axel Thimm <[email protected]> - 0.92.1-34
- Update to 0.92.1.

* Thu Dec 27 2007 Axel Thimm <[email protected]> - 0.92-33
- Update to 0.92.

* Tue Aug 21 2007 Axel Thimm <[email protected]> - 0.91.2-31
- Update to 0.91.2.

* Fri Jul 20 2007 Axel Thimm <[email protected]> - 0.91.1-30
- Update to 0.91.1.

* Wed Jul 11 2007 Axel Thimm <[email protected]> - 0.91-29
- Update to 0.91.

* Thu May 31 2007 Axel Thimm <[email protected]> - 0.90.3-28
- Update to 0.90.3.

* Fri Apr 13 2007 Axel Thimm <[email protected]> - 0.90.2-27
- Update to 0.90.2.

* Fri Mar  2 2007 Axel Thimm <[email protected]> - 0.90.1-26
- Update to 0.90.1.

* Wed Feb 14 2007 Axel Thimm <[email protected]> - 0.90-25
- Update to 0.90.

* Tue Dec 12 2006 Axel Thimm <[email protected]> - 0.88.7-24
- Update to 0.88.7.

* Mon Nov  6 2006 Axel Thimm <[email protected]> - 0.88.6-23
- Update to 0.88.6.

* Tue Oct 17 2006 Axel Thimm <[email protected]> - 0.88.5-22
- Update to 0.88.5.

* Fri Aug 11 2006 Axel Thimm <[email protected]> - 0.88.4-21
- fix broken release tag.

* Wed Aug  9 2006 Axel Thimm <[email protected]> - 0.88.4-20
- Update to 0.88.4.

* Sun Jul  2 2006 Axel Thimm <[email protected]>
- Update to 0.88.3.

* Sun Apr 30 2006 Axel Thimm <[email protected]>
- Update to 0.88.2.

* Tue Apr  4 2006 Axel Thimm <[email protected]>
- Update to 0.88.1

* Wed Jan 11 2006 Axel Thimm <[email protected]>
- Update to 0.88.

* Fri Nov  4 2005 Axel Thimm <[email protected]>
- Update to 0.87.1.

* Sat Sep 17 2005 Axel Thimm <[email protected]>
- Update to 0.87.

* Mon Jul 25 2005 Axel Thimm <[email protected]>
- Update to 0.86.2.

* Mon Jun 27 2005 Axel Thimm <[email protected]>
- Update to 0.86.1.

* Fri May 20 2005 Axel Thimm <[email protected]>
- Update to 0.85.1.

* Thu May 12 2005 Axel Thimm <[email protected]>
- Update to 0.85.

* Mon May  2 2005 Axel Thimm <[email protected]>
- Update to 0.84.
- lowercase default values in /etc/sysconfig/clamav.
- move milter socket into /var/run/clamav,

* Thu Mar 17 2005 Axel Thimm <[email protected]>
- Add support for clamav-milter to the init file (Mark Wormgoor
  <[email protected]>).

* Sat Feb 26 2005 Axel Thimm <[email protected]>
- Fix /etc/init.d/clamav status (Nick Urbanik <[email protected]>).

* Mon Feb  7 2005 Axel Thimm <[email protected]>
- Update to 0.82.

* Thu Jan 27 2005 Axel Thimm <[email protected]>
- Update to 0.81.

* Tue Dec 14 2004 Axel Thimm <[email protected]>
- Initial build.
clamav.tmpfiles (text/plain, 39 B)
d /var/run/clamav 0755 clamav amavis -
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.