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