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