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