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