]>
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 |
88439ba9 | 6 | %bcond_with curl # enable curl support |
eba74cc1 | 7 | # |
b014d766 | 8 | Summary: An anti-virus utility for Unix |
da5aee7a | 9 | Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów |
e6c034d3 | 10 | Name: clamav |
f19478b0 ER |
11 | Version: 0.92.1 |
12 | Release: 1 | |
e77f89d2 | 13 | Epoch: 0 |
92c5ef39 | 14 | License: GPL |
4460ff0b | 15 | Group: Applications |
9d42dc39 | 16 | Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz |
f19478b0 | 17 | # Source0-md5: c16e60f569b6ec575d8de494e788f9d2 |
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 |
83eaf0c7 | 26 | Patch1: %{name}-no_auto_libwrap.patch |
82747f5b | 27 | Patch2: %{name}-nolibs.patch |
4ffd87a3 | 28 | Patch3: %{name}-find_milter.patch |
51500a9b | 29 | Patch4: %{name}-valid_pp_exp.patch |
182b1736 | 30 | URL: http://www.clamav.net/ |
e6c034d3 | 31 | BuildRequires: autoconf |
32 | BuildRequires: automake | |
bc21dbca | 33 | BuildRequires: bzip2-devel |
a3809365 | 34 | %{?with_curl:BuildRequires: curl-devel} |
73b401c8 | 35 | BuildRequires: gmp-devel |
9d42dc39 | 36 | %{?with_milter:BuildRequires: libmilter-devel} |
2d1a6e1f | 37 | BuildRequires: libtool |
dd6d36d5 ER |
38 | %{?with_milter:BuildRequires: libwrap-devel} |
39 | BuildRequires: rpmbuild(macros) >= 1.268 | |
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 |
6a92e05d | 52 | Requires: bc |
0e86f481 | 53 | Requires: rc-scripts |
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 | |
74 | - on-access scanning (Linux® and FreeBSD®) | |
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 JR |
86 | %description -l pl.UTF-8 |
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. | |
e2414f52 | 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 | |
da5aee7a | 106 | Summary(pl.UTF-8): Filtr ClamAV korzystający z interfejsu milter |
eba74cc1 | 107 | Group: Daemons |
d4117574 | 108 | Requires: %{name} = %{epoch}:%{version}-%{release} |
eba74cc1 | 109 | Requires: sendmail >= 8.11 |
110 | Requires: tcp_wrappers | |
eba74cc1 | 111 | |
112 | %description milter | |
113 | ClamAV sendmail filter using MILTER interface. | |
114 | ||
d8cf2de3 JR |
115 | %description milter -l pl.UTF-8 |
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 |
da5aee7a | 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 JR |
131 | %description devel -l pl.UTF-8 |
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 |
c8321415 | 148 | %setup -q %{?_rc:-n %{name}-%{version}%{_rc}} |
c935072a | 149 | %patch0 -p1 |
83eaf0c7 | 150 | %patch1 -p1 |
82747f5b | 151 | %patch2 -p1 |
9d42dc39 | 152 | %patch3 -p1 |
51500a9b | 153 | %patch4 -p0 |
82747f5b | 154 | |
e6c034d3 | 155 | %build |
82747f5b | 156 | %{__libtoolize} |
4460ff0b | 157 | %{__aclocal} |
ed667a13 | 158 | %{__autoconf} |
82747f5b | 159 | %{__autoheader} |
ed667a13 | 160 | %{__automake} |
92c5ef39 | 161 | %configure \ |
ca57b115 | 162 | --disable-clamav \ |
7c471170 | 163 | %{!?with_curl:--without-libcurl} \ |
142cc22a | 164 | %{?with_milter:--enable-milter} \ |
ca57b115 | 165 | --with-dbdir=/var/lib/%{name} |
92c5ef39 | 166 | %{__make} |
4d3c9f35 | 167 | |
e6c034d3 | 168 | %install |
169 | rm -rf $RPM_BUILD_ROOT | |
06e3ab45 TP |
170 | install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \ |
171 | $RPM_BUILD_ROOT%{_var}/{log,spool/clamav} | |
92c5ef39 AM |
172 | |
173 | %{__make} install \ | |
174 | DESTDIR=$RPM_BUILD_ROOT | |
142cc22a | 175 | %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*} |
92c5ef39 | 176 | |
d78cc52a | 177 | cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name} |
719d471d | 178 | 5 * * * * root %{_sbindir}/clamav-cron-updatedb |
ca57b115 | 179 | EOF |
92c5ef39 | 180 | |
05eb87ef | 181 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd |
4381c9a3 | 182 | %if %{with milter} |
eba74cc1 | 183 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter |
eba74cc1 | 184 | install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter |
4381c9a3 | 185 | %endif |
186 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd | |
719d471d | 187 | install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb |
142cc22a | 188 | install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir} |
813b04f8 | 189 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
2b9f3e64 | 190 | |
3e84b306 | 191 | install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir} |
4460ff0b | 192 | |
c935072a MK |
193 | # NOTE: clamd uses sane rights to it's clamd.pid file |
194 | # So better keep it dir | |
195 | # If it is fixed use of dir will be unecesary | |
d78cc52a | 196 | install -d $RPM_BUILD_ROOT/var/run/%{name} |
c935072a | 197 | |
d78cc52a | 198 | :> $RPM_BUILD_ROOT/var/log/freshclam.log |
ef21d0fa | 199 | |
e6c034d3 | 200 | %clean |
92c5ef39 | 201 | rm -rf $RPM_BUILD_ROOT |
e6c034d3 | 202 | |
c935072a MK |
203 | %triggerin -- amavis-ng |
204 | AMAVIS=$(/usr/bin/getgid amavis) | |
205 | RESULT=$? | |
1475e7a3 | 206 | if [ $RESULT -eq 0 ]; then |
236dddf1 | 207 | echo "Adding clamav to amavis group GID=$AMAVIS" |
06e3ab45 | 208 | /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null |
c935072a MK |
209 | fi |
210 | ||
211 | %triggerin -- amavisd-new | |
212 | AMAVIS=$(/usr/bin/getgid amavis) | |
213 | RESULT=$? | |
1475e7a3 | 214 | if [ $RESULT -eq 0 ]; then |
236dddf1 | 215 | echo "Adding clamav to amavis group GID=$AMAVIS" |
06e3ab45 | 216 | /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null |
c935072a MK |
217 | fi |
218 | ||
219 | %triggerin -- amavisd | |
220 | AMAVIS=$(/usr/bin/getgid amavis) | |
221 | RESULT=$? | |
1475e7a3 | 222 | if [ $RESULT -eq 0 ]; then |
236dddf1 | 223 | echo "Adding clamav to amavis group GID=$AMAVIS" |
49797116 | 224 | /usr/sbin/usermod -G amavis clamav 1>&2 |
c935072a MK |
225 | fi |
226 | ||
e278889f | 227 | %pre |
236dddf1 ER |
228 | %groupadd -g 43 clamav |
229 | %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav | |
230 | ||
231 | # FIXME: check this. is it proper after useradd macro? | |
232 | # TODO: use addusertogroup macro? | |
233 | if [ -n "`/usr/bin/getgid amavis`" ]; then | |
234 | echo "Adding clamav to amavis group" | |
235 | /usr/sbin/usermod -G amavis clamav 1>&2 | |
174915c1 | 236 | fi |
237 | ||
66d1575d | 238 | %post |
66d1575d | 239 | /sbin/chkconfig --add clamd |
dd6d36d5 | 240 | %service clamd restart "Clam Antivirus daemon" |
d78cc52a ER |
241 | touch /var/log/freshclam.log |
242 | chown clamav:root /var/log/freshclam.log | |
243 | chmod 640 /var/log/freshclam.log | |
66d1575d | 244 | |
66d1575d | 245 | %preun |
246 | if [ "$1" = "0" ]; then | |
dd6d36d5 | 247 | %service clamd stop |
66d1575d | 248 | /sbin/chkconfig --del clamd |
249 | fi | |
e6c034d3 | 250 | |
0c8c3ba4 | 251 | %postun |
174915c1 | 252 | if [ "$1" = "0" ]; then |
49797116 | 253 | %userremove clamav |
254 | %groupremove clamav | |
174915c1 | 255 | fi |
256 | ||
ed0b0327 | 257 | %triggerpostun -- %{name} < 0.80 |
1eab800a | 258 | if [ -f /etc/clamav.conf.rpmsave ]; then |
d093ed8c | 259 | echo "Renaming config to new name /etc/clamd.conf" |
260 | mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew | |
261 | mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf | |
d4117574 | 262 | echo "Changing config location in freshclam config" |
f12ca2c1 ER |
263 | %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf |
264 | fi | |
265 | ||
29f80fd8 ER |
266 | %triggerpostun -- %{name} < 0.90-0.rc2.0.10 |
267 | %{__cp} -f /etc/clamd.conf{,.rpmsave} | |
268 | %{__sed} -i -e ' | |
269 | s,^LogSyslog$,& yes, | |
270 | s,^FixStaleSocket$,& yes, | |
271 | s,^AllowSupplementaryGroups$,& yes, | |
272 | s,^ClamukoScanOnOpen$,& yes, | |
273 | s,^ClamukoScanOnClose$,& yes, | |
274 | s,^ClamukoScanOnExec$,& yes, | |
3bc0b921 AM |
275 | s,^LogTime$,& yes, |
276 | s,^ScanPE$,& yes, | |
29f80fd8 ER |
277 | ' /etc/clamd.conf |
278 | %banner -e %{name}-0.90 <<EOF | |
279 | ClamAV config was automatically upgraded to 0.90 format. You should review it | |
280 | that it's still valid. | |
281 | EOF | |
282 | #' | |
283 | # unfortunately clamd has no configcheck option so we just have to start it | |
284 | # once again after config was broken after upgrade | |
285 | touch /var/lock/subsys/clamd | |
286 | %service -q clamd restart | |
1eab800a | 287 | |
eba74cc1 | 288 | %post milter |
289 | /sbin/chkconfig --add clamav-milter | |
dd6d36d5 | 290 | %service clamav-milter restart "Clam Antivirus daemon" |
eba74cc1 | 291 | |
4c570814 | 292 | %preun milter |
eba74cc1 | 293 | if [ "$1" = "0" ]; then |
dd6d36d5 | 294 | %service clamav-milter stop |
eba74cc1 | 295 | /sbin/chkconfig --del clamav-milter |
296 | fi | |
fba342ab | 297 | |
1475e7a3 | 298 | %post libs -p /sbin/ldconfig |
299 | %postun libs -p /sbin/ldconfig | |
4460ff0b | 300 | |
e6c034d3 | 301 | %files |
302 | %defattr(644,root,root,755) | |
c5a8ecb5 | 303 | %doc AUTHORS ChangeLog FAQ NEWS README docs/*.pdf |
24f68046 | 304 | %attr(755,root,root) %{_bindir}/clamdscan |
305 | %attr(755,root,root) %{_bindir}/clamscan | |
306 | %attr(755,root,root) %{_bindir}/freshclam | |
307 | %attr(755,root,root) %{_bindir}/sigtool | |
d78cc52a | 308 | %attr(755,root,root) %{_bindir}/clamconf |
24f68046 | 309 | %attr(755,root,root) %{_sbindir}/clamd |
310 | %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb | |
c8321415 | 311 | %attr(755,root,root) %{_sbindir}/clamav-post-updatedb |
ca57b115 | 312 | %attr(755,clamav,root) %dir /var/lib/%{name} |
c8321415 | 313 | %ghost %attr(644,clamav,root) %verify(not md5 mtime size) /var/lib/clamav/*.cvd |
d78cc52a ER |
314 | %attr(640,clamav,root) %ghost /var/log/freshclam.log |
315 | %attr(750,clamav,clamav) %dir /var/run/%{name} | |
c935072a | 316 | |
b5177881 | 317 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name} |
0e86f481 JB |
318 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/clamd.conf |
319 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/freshclam.conf | |
6586d93d | 320 | |
05eb87ef | 321 | %attr(754,root,root) /etc/rc.d/init.d/clamd |
7c801993 ER |
322 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamd |
323 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/clamav | |
eba74cc1 | 324 | %{_mandir}/man[15]/* |
325 | %{_mandir}/man8/clamd* | |
326 | ||
327 | %if %{with milter} | |
328 | %files milter | |
329 | %defattr(644,root,root,755) | |
7c801993 | 330 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clamav-milter |
491eb046 | 331 | %attr(754,root,root) /etc/rc.d/init.d/clamav-milter |
eba74cc1 | 332 | #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter |
333 | #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter | |
334 | #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf | |
335 | %attr(755,root,root) %{_sbindir}/clamav-milter | |
336 | %{_mandir}/man8/clamav-milter.8* | |
0e86f481 | 337 | %attr(700,clamav,clamav) /var/spool/clamav |
eba74cc1 | 338 | %endif |
4460ff0b AM |
339 | |
340 | %files libs | |
341 | %defattr(644,root,root,755) | |
263ab0bb | 342 | %attr(755,root,root) %{_libdir}/lib*.so.*.* |
f19478b0 ER |
343 | %attr(755,root,root) %ghost %{_libdir}/libclamav.so.3 |
344 | %attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.3 | |
345 | %attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.3 | |
4460ff0b AM |
346 | |
347 | %files devel | |
348 | %defattr(644,root,root,755) | |
24f68046 | 349 | %attr(755,root,root) %{_bindir}/clamav-config |
4460ff0b | 350 | %attr(755,root,root) %{_libdir}/lib*.so |
52d00604 | 351 | %{_libdir}/lib*.la |
4460ff0b | 352 | %{_includedir}/*.h |
0d90572a | 353 | %{_pkgconfigdir}/*.pc |
4460ff0b AM |
354 | |
355 | %files static | |
356 | %defattr(644,root,root,755) | |
357 | %{_libdir}/*.a |