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