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