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