]> git.pld-linux.org Git - packages/clamav.git/blob - clamav.spec
- updated description from homepage
[packages/clamav.git] / clamav.spec
1 # TODO:
2 # - Make freshclam package (script and daemon)
3 #
4 # Conditional build:
5 %bcond_without  milter          # build without milter subpackage
6 %bcond_with     curl            # enable curl support
7 #
8 Summary:        An anti-virus utility for Unix
9 Summary(pl.UTF-8):      Narzędzie antywirusowe dla Uniksów
10 Name:           clamav
11 Version:        0.91.2
12 Release:        1
13 Epoch:          0
14 License:        GPL
15 Group:          Applications
16 Source0:        http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
17 # Source0-md5:  2a7265d17cfa80c32858978f16a3f47b
18 Source1:        %{name}.init
19 Source2:        %{name}.sysconfig
20 Source3:        %{name}-milter.init
21 Source4:        %{name}-cron-updatedb
22 Source5:        %{name}.logrotate
23 Source8:        %{name}-post-updatedb
24 Source9:        %{name}-milter.sysconfig
25 Patch0:         %{name}-pld_config.patch
26 Patch1:         %{name}-no_auto_libwrap.patch
27 Patch2:         %{name}-nolibs.patch
28 Patch3:         %{name}-find_milter.patch
29 Patch4:         %{name}-valid_pp_exp.patch
30 URL:            http://www.clamav.net/
31 BuildRequires:  autoconf
32 BuildRequires:  automake
33 BuildRequires:  bzip2-devel
34 %{?with_curl:BuildRequires:     curl-devel}
35 BuildRequires:  gmp-devel
36 %{?with_milter:BuildRequires:   libmilter-devel}
37 BuildRequires:  libtool
38 %{?with_milter:BuildRequires:   libwrap-devel}
39 BuildRequires:  rpmbuild(macros) >= 1.268
40 BuildRequires:  zlib-devel
41 Requires(post,preun):   /sbin/chkconfig
42 Requires(postun):       /usr/sbin/groupdel
43 Requires(postun):       /usr/sbin/userdel
44 Requires(postun,pre):   /usr/sbin/usermod
45 Requires(pre):  /bin/id
46 Requires(pre):  /usr/bin/getgid
47 Requires(pre):  /usr/sbin/groupadd
48 Requires(pre):  /usr/sbin/useradd
49 Requires(triggerpostun):        sed >= 4.0
50 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
51 Requires:       /usr/sbin/usermod
52 Requires:       bc
53 Requires:       rc-scripts
54 Provides:       group(clamav)
55 Provides:       user(clamav)
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %description
59 Clam AntiVirus is an open source anti-virus toolkit for UNIX, designed
60 especially for e-mail scanning on mail gateways. It provides a number
61 of utilities including a flexible and scalable multi-threaded daemon,
62 a command line scanner and advanced tool for automatic database
63 updates. The core of the package is an anti-virus engine available in
64 a form of shared library.
65
66 Here is a list of the main features:
67 - command-line scanner
68 - fast, multi-threaded daemon with support for on-access scanning
69 - milter interface for sendmail
70 - advanced database updater with support for scripted updates and
71   digital signatures
72 - virus scanner C library
73 - on-access scanning (Linux® and FreeBSD®)
74 - virus database updated multiple times per day (see home page for
75   total number of signatures)
76 - built-in support for various archive formats, including Zip, RAR,
77   Tar, Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others
78 - built-in support for almost all mail file formats
79 - built-in support for ELF executables and Portable Executable files
80   compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and
81   obfuscated with SUE, Y0da Cryptor and others
82 - built-in support for popular document formats including MS Office
83   and MacOffice files, HTML, RTF and PDF
84
85 %description -l pl.UTF-8
86 Clam Antivirus jest potężnym skanerem antywirusowym dla systemów
87 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
88 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
89 Baza wirusów zawiera ponad 90000 sygnatur. Skaner jest wielowątkowy,
90 napisany w C i zgodny z POSIXem.
91
92 %package libs
93 Summary:        Shared libraries for clamav
94 Summary(pl.UTF-8):      Biblioteki dzielone clamav
95 Group:          Libraries
96
97 %description libs
98 Shared libraries for clamav.
99
100 %description libs -l pl.UTF-8
101 Biblioteki dzielone clamav.
102
103 %package milter
104 Summary:        ClamAV filter using milter interface
105 Summary(pl.UTF-8):      Filtr ClamAV korzystający z interfejsu milter
106 Group:          Daemons
107 Requires:       %{name} = %{epoch}:%{version}-%{release}
108 Requires:       sendmail >= 8.11
109 Requires:       tcp_wrappers
110
111 %description milter
112 ClamAV sendmail filter using MILTER interface.
113
114 %description milter -l pl.UTF-8
115 Filtr ClamAV dla sendmaila korzystający z interfejsu MILTER.
116
117 %package devel
118 Summary:        clamav - Development header files and libraries
119 Summary(pl.UTF-8):      clamav - Pliki nagłówkowe i biblioteki dla programistów
120 Group:          Development/Libraries
121 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
122 Requires:       bzip2-devel
123 Requires:       gmp-devel
124 Requires:       zlib-devel
125
126 %description devel
127 This package contains the development header files and libraries
128 necessary to develop clamav client applications.
129
130 %description devel -l pl.UTF-8
131 Pliki nagłówkowe i biblioteki konieczne do kompilacji aplikacji
132 klienckich clamav.
133
134 %package static
135 Summary:        clamav static libraries
136 Summary(pl.UTF-8):      Biblioteki statyczne clamav
137 Group:          Development/Libraries
138 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
139
140 %description static
141 clamav static libraries.
142
143 %description static -l pl.UTF-8
144 Biblioteki statyczne clamav.
145
146 %prep
147 %setup -q %{?_rc:-n %{name}-%{version}%{_rc}}
148 %patch0 -p1
149 %patch1 -p1
150 %patch2 -p1
151 %patch3 -p1
152 %patch4 -p0
153
154 %build
155 %{__libtoolize}
156 %{__aclocal}
157 %{__autoconf}
158 %{__autoheader}
159 %{__automake}
160 %configure \
161         --disable-clamav \
162         %{!?with_curl:--without-libcurl} \
163         %{?with_milter:--enable-milter} \
164         --with-dbdir=/var/lib/%{name}
165 %{__make}
166
167 %install
168 rm -rf $RPM_BUILD_ROOT
169 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
170         $RPM_BUILD_ROOT%{_var}/{log,spool/clamav}
171
172 %{__make} install \
173         DESTDIR=$RPM_BUILD_ROOT
174 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
175
176 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
177 5 * * * *       root    %{_sbindir}/clamav-cron-updatedb
178 EOF
179
180 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
181 %if %{with milter}
182 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
183 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
184 %endif
185 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
186 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
187 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
188 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
189
190 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
191
192 # NOTE: clamd uses sane rights to it's clamd.pid file
193 # So better keep it dir
194 # If it is fixed use of dir will be unecesary
195 install -d $RPM_BUILD_ROOT/var/run/%{name}
196
197 :> $RPM_BUILD_ROOT/var/log/freshclam.log
198
199 %clean
200 rm -rf $RPM_BUILD_ROOT
201
202 %triggerin -- amavis-ng
203 AMAVIS=$(/usr/bin/getgid amavis)
204 RESULT=$?
205 if [ $RESULT -eq 0 ]; then
206         echo "Adding clamav to amavis group GID=$AMAVIS"
207         /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
208 fi
209
210 %triggerin -- amavisd-new
211 AMAVIS=$(/usr/bin/getgid amavis)
212 RESULT=$?
213 if [ $RESULT -eq 0 ]; then
214         echo "Adding clamav to amavis group GID=$AMAVIS"
215         /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
216 fi
217
218 %triggerin -- amavisd
219 AMAVIS=$(/usr/bin/getgid amavis)
220 RESULT=$?
221 if [ $RESULT -eq 0 ]; then
222         echo "Adding clamav to amavis group GID=$AMAVIS"
223         /usr/sbin/usermod -G amavis clamav 1>&2
224 fi
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 # FIXME: check this. is it proper after useradd macro?
231 # TODO: use addusertogroup macro?
232 if [ -n "`/usr/bin/getgid amavis`" ]; then
233         echo "Adding clamav to amavis group"
234         /usr/sbin/usermod -G amavis clamav 1>&2
235 fi
236
237 %post
238 /sbin/chkconfig --add clamd
239 %service clamd restart "Clam Antivirus daemon"
240 touch /var/log/freshclam.log
241 chown clamav:root /var/log/freshclam.log
242 chmod 640 /var/log/freshclam.log
243
244 %preun
245 if [ "$1" = "0" ]; then
246         %service clamd stop
247         /sbin/chkconfig --del clamd
248 fi
249
250 %postun
251 if [ "$1" = "0" ]; then
252         %userremove clamav
253         %groupremove clamav
254 fi
255
256 %triggerpostun -- %{name} <= 0.75.1
257 if [ -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
263 fi
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
278 ClamAV config was automatically upgraded to 0.90 format. You should review it
279 that it's still valid.
280 EOF
281 #'
282 # unfortunately clamd has no configcheck option so we just have to start it
283 # once again after config was broken after upgrade
284 touch /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
292 if [ "$1" = "0" ]; then
293         %service clamav-milter stop
294         /sbin/chkconfig --del clamav-milter
295 fi
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}/clamdscan
304 %attr(755,root,root) %{_bindir}/clamscan
305 %attr(755,root,root) %{_bindir}/freshclam
306 %attr(755,root,root) %{_bindir}/sigtool
307 %attr(755,root,root) %{_bindir}/clamconf
308 %attr(755,root,root) %{_sbindir}/clamd
309 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
310 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
311 %attr(755,clamav,root) %dir /var/lib/%{name}
312 %ghost %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/clamav/*.cvd
313 %attr(640,clamav,root) %ghost /var/log/freshclam.log
314 %attr(750,clamav,clamav) %dir /var/run/%{name}
315
316 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
317 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf
318 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf
319
320 %attr(754,root,root) /etc/rc.d/init.d/clamd
321 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd
322 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav
323 %{_mandir}/man[15]/*
324 %{_mandir}/man8/clamd*
325
326 %if %{with milter}
327 %files milter
328 %defattr(644,root,root,755)
329 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter
330 %attr(754,root,root) /etc/rc.d/init.d/clamav-milter
331 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
332 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
333 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
334 %attr(755,root,root) %{_sbindir}/clamav-milter
335 %{_mandir}/man8/clamav-milter.8*
336 %attr(700,clamav,clamav) /var/spool/clamav
337 %endif
338
339 %files libs
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{_libdir}/lib*.so.*.*
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.118453 seconds and 4 git commands to generate.