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