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