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