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