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