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