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