]> git.pld-linux.org Git - packages/clamav.git/blame_incremental - clamav.spec
- rebuild to fix broken filedigests
[packages/clamav.git] / clamav.spec
... / ...
CommitLineData
1# TODO:
2# - Make freshclam package (script and daemon)
3# - restart amavis in triggers if group membership was modified?
4#
5# Conditional build:
6%bcond_without milter # build without milter subpackage
7%if "%{pld_release}" == "ac"
8%bcond_with llvm # build without llvm support
9%else
10%bcond_without llvm # build without llvm support
11%endif
12
13Summary: An anti-virus utility for Unix
14Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów
15Name: clamav
16Version: 0.97.6
17Release: 4
18License: GPL v2+
19Group: Daemons
20Source0: http://downloads.sourceforge.net/clamav/%{name}-%{version}.tar.gz
21# Source0-md5: 1dbdd803b37c0d9d222e4316049f46a2
22Source1: %{name}.init
23Source2: %{name}.sysconfig
24Source3: %{name}-milter.init
25Source4: %{name}-cron-updatedb
26Source5: %{name}.logrotate
27Source8: %{name}-post-updatedb
28Source9: %{name}-milter.sysconfig
29Source10: %{name}.tmpfiles
30Patch0: %{name}-pld_config.patch
31Patch1: %{name}-nolibs.patch
32Patch2: am-nosilentrules.patch
33Patch3: ac2.68.patch
34URL: http://www.clamav.net/
35BuildRequires: autoconf
36BuildRequires: automake
37BuildRequires: bzip2-devel
38BuildRequires: gmp-devel
39BuildRequires: libltdl-devel
40%{?with_milter:BuildRequires: libmilter-devel}
41BuildRequires: libstdc++-devel
42BuildRequires: libtool
43%{?with_milter:BuildRequires: libwrap-devel}
44%{?with_llvm:BuildRequires: llvm-devel}
45BuildRequires: ncurses-devel
46BuildRequires: rpm >= 4.4.9-56
47BuildRequires: rpmbuild(macros) >= 1.514
48BuildRequires: zlib-devel
49Requires(post,preun): /sbin/chkconfig
50Requires(postun): /usr/sbin/groupdel
51Requires(postun): /usr/sbin/userdel
52Requires(postun,pre): /usr/sbin/usermod
53Requires(pre): /bin/id
54Requires(pre): /usr/bin/getgid
55Requires(pre): /usr/sbin/groupadd
56Requires(pre): /usr/sbin/useradd
57Requires(triggerpostun): sed >= 4.0
58Requires: %{name}-libs = %{epoch}:%{version}-%{release}
59Requires: /usr/sbin/usermod
60Requires: rc-scripts >= 0.4.1.23
61Suggests: clamav-database
62Provides: group(clamav)
63Provides: user(clamav)
64Conflicts: logrotate < 3.7-4
65BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67%description
68Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
69especially for e-mail scanning on mail gateways. It provides a number
70of utilities including a flexible and scalable multi-threaded daemon,
71a command line scanner and advanced tool for automatic database
72updates. The core of the package is an anti-virus engine available in
73a form of shared library.
74
75Here is a list of the main features:
76- command-line scanner
77- fast, multi-threaded daemon with support for on-access scanning
78- milter interface for sendmail
79- advanced database updater with support for scripted updates and
80 digital signatures
81- virus scanner C library
82- on-access scanning (Linux® and FreeBSD®)
83- virus database updated multiple times per day (see home page for
84 total number of signatures)
85- built-in support for various archive formats, including Zip, RAR,
86 Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
87- built-in support for almost all mail file formats
88- built-in support for ELF executables and Portable Executable files
89 compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
90 obfuscated with SUE, Y0da Cryptor and others
91- built-in support for popular document formats including MS Office
92 and MacOffice files, HTML, RTF and PDF
93
94%description -l pl.UTF-8
95Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
96uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
97"on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
98Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
99napisany w C i zgodny z POSIXem.
100
101%package libs
102Summary: Shared libraries for clamav
103Summary(pl.UTF-8): Biblioteki dzielone clamav
104Group: Libraries
105
106%description libs
107Shared libraries for clamav.
108
109%description libs -l pl.UTF-8
110Biblioteki dzielone clamav.
111
112%package milter
113Summary: ClamAV filter using milter interface
114Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter
115Group: Daemons
116Requires: %{name} = %{epoch}:%{version}-%{release}
117Requires: postfix
118#Requires: sendmail >= 8.11
119Requires: tcp_wrappers
120
121%description milter
122ClamAV sendmail filter using MILTER interface.
123
124%description milter -l pl.UTF-8
125Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
126
127%package devel
128Summary: clamav - Development header files and libraries
129Summary(pl.UTF-8): clamav - Pliki nagłówkowe i biblioteki dla programistów
130Group: Development/Libraries
131Requires: %{name}-libs = %{epoch}:%{version}-%{release}
132Requires: bzip2-devel
133Requires: gmp-devel
134Requires: zlib-devel
135
136%description devel
137This package contains the development header files and libraries
138necessary to develop clamav client applications.
139
140%description devel -l pl.UTF-8
141Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
142klienckich clamav.
143
144%package static
145Summary: clamav static libraries
146Summary(pl.UTF-8): Biblioteki statyczne clamav
147Group: Development/Libraries
148Requires: %{name}-devel = %{epoch}:%{version}-%{release}
149
150%description static
151clamav static libraries.
152
153%description static -l pl.UTF-8
154Biblioteki statyczne clamav.
155
156%prep
157%setup -q
158%patch0 -p1
159%patch1 -p1
160%patch2 -p1
161%patch3 -p1
162
163%build
164# automake 1.12+ needs configure.ac not .in
165mv configure.{in,ac}
166%{__libtoolize}
167%{__aclocal} -I m4
168%{__autoconf}
169%{__autoheader}
170%{__automake}
171%configure \
172 --disable-clamav \
173 %{?with_milter:--enable-milter} \
174 --with-dbdir=/var/lib/%{name} \
175 --with-no-cache \
176 --with-ltdl-include=%{_includedir} \
177 --with-ltdl-lib=%{_libdir}
178
179%{__make} \
180 LIBTOOL=%{_bindir}/libtool
181
182%install
183rm -rf $RPM_BUILD_ROOT
184install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
185 $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav} \
186 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
187
188%{__make} install \
189 LIBTOOL=%{_bindir}/libtool \
190 DESTDIR=$RPM_BUILD_ROOT
191%{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
192
193cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
1945 * * * * root %{_sbindir}/clamav-cron-updatedb
195EOF
196
197install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
198%if %{with milter}
199install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
200cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
201%endif
202cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
203install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
204cp -p etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
205cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
206
207install -p %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
208
209install %{SOURCE10} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
210
211# Not packaged/installed anymore, but we want it ghosted
212touch $RPM_BUILD_ROOT/var/lib/clamav/{daily,main}.cvd
213
214# NOTE: clamd uses sane rights to it's clamd.pid file
215# So better keep it dir
216# If it is fixed use of dir will be unecesary
217install -d $RPM_BUILD_ROOT/var/run/%{name}
218
219:> $RPM_BUILD_ROOT/var/log/freshclam.log
220
221%clean
222rm -rf $RPM_BUILD_ROOT
223
224%triggerin -- amavis-ng
225%addusertogroup -q clamav amavis
226
227%triggerin -- amavisd-new
228%addusertogroup -q clamav amavis
229
230%triggerin -- amavisd
231%addusertogroup -q clamav amavis
232
233%pre
234%groupadd -g 43 clamav
235%useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
236
237%post
238/sbin/chkconfig --add clamd
239%service clamd restart "Clam Antivirus daemon"
240touch /var/log/freshclam.log
241chown clamav:root /var/log/freshclam.log
242chmod 640 /var/log/freshclam.log
243
244%preun
245if [ "$1" = "0" ]; then
246 %service clamd stop
247 /sbin/chkconfig --del clamd
248fi
249
250%postun
251if [ "$1" = "0" ]; then
252 %userremove clamav
253 %groupremove clamav
254fi
255
256%triggerpostun -- %{name} < 0.80
257if [ -f /etc/clamav.conf.rpmsave ]; then
258 echo "Renaming config to new name /etc/clamd.conf"
259 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
260 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
261 echo "Changing config location in freshclam config"
262 %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
263fi
264
265%triggerpostun -- %{name} < 0.90-0.rc2.0.10
266%{__cp} -f /etc/clamd.conf{,.rpmsave}
267%{__sed} -i -e '
268 s,^LogSyslog$,& yes,
269 s,^FixStaleSocket$,& yes,
270 s,^AllowSupplementaryGroups$,& yes,
271 s,^ClamukoScanOnOpen$,& yes,
272 s,^ClamukoScanOnClose$,& yes,
273 s,^ClamukoScanOnExec$,& yes,
274 s,^LogTime$,& yes,
275 s,^ScanPE$,& yes,
276' /etc/clamd.conf
277%banner -e %{name}-0.90 <<EOF
278ClamAV config was automatically upgraded to 0.90 format. You should review it
279that it's still valid.
280EOF
281#'
282# unfortunately clamd has no configcheck option so we just have to start it
283# once again after config was broken after upgrade
284touch /var/lock/subsys/clamd
285%service -q clamd restart
286
287%post milter
288/sbin/chkconfig --add clamav-milter
289%service clamav-milter restart "Clam Antivirus daemon"
290
291%preun milter
292if [ "$1" = "0" ]; then
293 %service clamav-milter stop
294 /sbin/chkconfig --del clamav-milter
295fi
296
297%post libs -p /sbin/ldconfig
298%postun libs -p /sbin/ldconfig
299
300%files
301%defattr(644,root,root,755)
302%doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf
303%attr(755,root,root) %{_bindir}/clambc
304%attr(755,root,root) %{_bindir}/clamdscan
305%attr(755,root,root) %{_bindir}/clamdtop
306%attr(755,root,root) %{_bindir}/clamscan
307%attr(755,root,root) %{_bindir}/freshclam
308%attr(755,root,root) %{_bindir}/sigtool
309%attr(755,root,root) %{_bindir}/clamconf
310%attr(755,root,root) %{_sbindir}/clamd
311%attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
312%attr(755,root,root) %{_sbindir}/clamav-post-updatedb
313%{systemdtmpfilesdir}/%{name}.conf
314%attr(755,clamav,root) %dir /var/lib/%{name}
315%attr(644,clamav,root) %ghost %verify(not md5 mtime size) /var/lib/clamav/*.cvd
316%attr(640,clamav,root) %ghost /var/log/freshclam.log
317%attr(750,clamav,clamav) %dir /var/run/%{name}
318
319%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
320%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
321%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
322
323%attr(754,root,root) /etc/rc.d/init.d/clamd
324%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
325%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
326%{_mandir}/man[15]/*
327%{_mandir}/man8/clamd*
328
329%if %{with milter}
330%files milter
331%defattr(644,root,root,755)
332%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
333%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamav-milter.conf
334%attr(754,root,root) /etc/rc.d/init.d/clamav-milter
335#%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
336#%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
337#%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
338%attr(755,root,root) %{_sbindir}/clamav-milter
339%{_mandir}/man8/clamav-milter.8*
340%attr(700,clamav,clamav) /var/spool/clamav
341%endif
342
343%files libs
344%defattr(644,root,root,755)
345%attr(755,root,root) %{_libdir}/lib*.so.*.*
346%attr(755,root,root) %ghost %{_libdir}/libclamav.so.6
347%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.6
348%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.6
349
350%files devel
351%defattr(644,root,root,755)
352%attr(755,root,root) %{_bindir}/clamav-config
353%attr(755,root,root) %{_libdir}/lib*.so
354%{_libdir}/lib*.la
355%{_includedir}/*.h
356%{_pkgconfigdir}/*.pc
357
358%files static
359%defattr(644,root,root,755)
360%{_libdir}/*.a
This page took 0.097107 seconds and 4 git commands to generate.