Re: [ATrpms-devel] clamav for f14/f15 with systemd

2011-06-10 Thread Axel Thimm
On Sun, 2011-06-05 at 12:00 +0200, Kim Bisgaard wrote:
> 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.

Thanks, all in the repo by now!
-- 
http://thimm.gr/ - http://ATrpms.net/


signature.asc
Description: This is a digitally signed message part
___
atrpms-devel mailing list
atrpms-devel@atrpms.net
http://lists.atrpms.net/mailman/listinfo/atrpms-devel

[ATrpms-devel] clamav for f14/f15 with systemd

2011-06-05 Thread Kim Bisgaard

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

%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,