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