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