X-Git-Url: http://git.pld-linux.org/?p=packages%2Fclamav.git;a=blobdiff_plain;f=clamav.spec;h=6b10e95c3703d3ac11d353de24832742f4a6dddc;hp=abafb816be0df6e8d0ec74a716181ddcb5f2c8a7;hb=HEAD;hpb=8cdcf5e041a72942ef3a97a6a3381162c9f0f0d9 diff --git a/clamav.spec b/clamav.spec index abafb81..a7b739f 100644 --- a/clamav.spec +++ b/clamav.spec @@ -1,6 +1,10 @@ # TODO: # - Make freshclam package (script and daemon) # - restart amavis in triggers if group membership was modified? +# NOTE: +# ClamAV requires non-default build options for TomsFastMath to support bigger +# floating point numbers. Without this change, database and Windows EXE/DLL +# authenticode certificate validation may fail. Don't use system one. # # Conditional build: %bcond_without milter # milter interface subpackage @@ -19,13 +23,13 @@ Summary: An anti-virus utility for Unix Summary(pl.UTF-8): Narzędzie antywirusowe dla Uniksów Name: clamav -Version: 0.103.0 +Version: 1.3.0 Release: 1 License: GPL v2+ Group: Daemons #Source0Download: http://www.clamav.net/download Source0: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz -# Source0-md5: 453a389e0147b5df8fae5601b390d7db +# Source0-md5: c70168adc7c88506e079ac86a0c57031 Source1: %{name}.init Source2: %{name}.sysconfig Source3: %{name}-milter.init @@ -38,18 +42,10 @@ Source11: clamd.service Source12: cronjob-clamav.timer Source13: cronjob-clamav.service.in Patch0: %{name}-pld_config.patch -Patch1: %{name}-nolibs.patch -%if "%{pld_release}" == "ac" -Patch2: am-nosilentrules.patch -%endif -Patch3: ac2.68.patch -Patch4: x32.patch -Patch5: %{name}-add-support-for-system-tomsfastmath.patch -Patch6: %{name}-headers.patch URL: http://www.clamav.net/ -BuildRequires: autoconf >= 2.59 -BuildRequires: automake >= 1:1.11.1 BuildRequires: bzip2-devel >= 1.0.5 +BuildRequires: cargo +BuildRequires: cmake >= 3.14 BuildRequires: check-devel BuildRequires: curl-devel >= 7.40 BuildRequires: gmp-devel @@ -58,7 +54,6 @@ BuildRequires: libltdl-devel %{?with_milter:BuildRequires: libmilter-devel} %{?with_system_libmspack:BuildRequires: libmspack-devel} BuildRequires: libstdc++-devel >= 5:3.4 -BuildRequires: libtool >= 2:2 %{?with_milter:BuildRequires: libwrap-devel} BuildRequires: libxml2-devel >= 2 %{?with_llvm:%{?with_system_llvm:BuildRequires: llvm-devel < 3.7}} @@ -66,10 +61,10 @@ BuildRequires: ncurses-devel BuildRequires: openssl-devel >= 0.9.8 BuildRequires: pcre2-8-devel >= 10.30 BuildRequires: pkgconfig >= 1:0.16 -BuildRequires: rpm >= 4.4.9-56 -BuildRequires: rpmbuild(macros) >= 1.647 +BuildRequires: rpm-build >= 4.6 +BuildRequires: rpmbuild(macros) >= 1.742 +BuildRequires: rust >= 1.56 BuildRequires: systemd-devel -BuildRequires: tomsfastmath-devel >= 0.13.1-2 BuildRequires: zlib-devel >= 1.2.2 Requires(post,preun): /sbin/chkconfig Requires(postun): /usr/sbin/groupdel @@ -81,7 +76,7 @@ Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd Requires(post,preun,postun): systemd-units >= 38 Requires: systemd-units >= 38 -Requires(triggerpostun): sed >= 4.0 +Requires(postun): sed >= 4.0 Requires: %{name}-libs = %{epoch}:%{version}-%{release} Requires: /usr/sbin/usermod Requires: rc-scripts >= 0.4.1.23 @@ -210,43 +205,37 @@ clamav static libraries. %description static -l pl.UTF-8 Biblioteki statyczne clamav. +%package doc +Summary: ClamAV documentation +Summary(pl.UTF-8): Dokumentacja do ClamAVa +Group: Documentation +BuildArch: noarch + +%description doc +ClamAV documentation. + +%description doc -l pl.UTF-8 +Dokumentacja do ClamAVa. + %prep %setup -q %patch0 -p1 -%patch1 -p1 -%if "%{pld_release}" == "ac" -%patch2 -p1 -%endif -%if "%{pld_release}" != "ac" -%patch3 -p1 -%endif -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 %build -export CFLAGS="%{rpmcflags} -Wall -W -Wmissing-prototypes -Wmissing-declarations -std=gnu99" -export CXXFLAGS="%{rpmcxxflags} -std=gnu++98" -%{__libtoolize} -%{__aclocal} -I m4 -%{__autoconf} -%{__autoheader} -%{__automake} -%configure \ - --disable-clamav \ - --enable-clamonacc \ - --enable-clamdtop \ - %{?with_llvm:--enable-llvm %{!?with_system_llvm:--with-system-llvm=no}} \ - %{?with_milter:--enable-milter} \ - --disable-silent-rules \ - %{?with_static_libs:--enable-static} \ - --disable-zlib-vcheck \ - --with-dbdir=/var/lib/%{name} \ - --with-ltdl-include=%{_includedir} \ - --with-ltdl-lib=%{_libdir} \ - --with-no-cache \ - %{?with_system_libmspack:--with-system-libmspack} - +install -d build +cd build +%{cmake} \ + %{cmake_on_off system_libmspack ENABLE_EXTERNAL_MSPACK} \ + %{cmake_on_off milter ENABLE_MILTER} \ + %{cmake_on_off static_libs ENABLE_STATIC_LIB} \ + -DENABLE_APP=ON \ + -DENABLE_CLAMONACC=ON \ + -DENABLE_FRESHCLAM_NO_CACHE=ON \ + -DRUST_COMPILER_TARGET=%{rust_target} \ + -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/%{name} \ + -DAPP_CONFIG_DIRECTORY=%{_sysconfdir} \ + -DDATABASE_DIRECTORY="/var/lib/%{name}" \ + .. %{__make} %install @@ -256,9 +245,19 @@ install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \ $RPM_BUILD_ROOT%{systemdtmpfilesdir} \ $RPM_BUILD_ROOT%{systemdunitdir} -%{__make} install \ +%{__make} -C build install \ DESTDIR=$RPM_BUILD_ROOT + %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*} +# packged as %doc +%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/html + +%if %{with static_libs} +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libclamav{_static,}.a +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libclamunrar{_static,}.a +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libclamunrar_iface{_static,}.a +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libfreshclam{_static,}.a +%endif cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name} 5 * * * * root %{_sbindir}/clamav-cron-updatedb @@ -329,7 +328,7 @@ if [ "$1" = "0" ]; then fi %systemd_reload -%triggerpostun -- %{name} < 0.80 +%triggerpostun -- %{name} < 0.99.2-2 if [ -f /etc/clamav.conf.rpmsave ]; then echo "Renaming config to new name /etc/clamd.conf" mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew @@ -338,7 +337,6 @@ if [ -f /etc/clamav.conf.rpmsave ]; then %{__sed} -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf fi -%triggerpostun -- %{name} < 0.90-0.rc2.0.10 %{__cp} -f /etc/clamd.conf{,.rpmsave} %{__sed} -i -e ' s,^LogSyslog$,& yes, @@ -360,11 +358,7 @@ EOF touch /var/lock/subsys/clamd %service -q clamd restart -%triggerpostun -- %{name} < 0.97.7-4 -%systemd_trigger clamd.service - -%triggerpostun -- %{name} < 0.99.2-2 -%systemd_service_enable cronjob-clamav.timer +%systemd_trigger clamd.service cronjob-clamav.timer %post milter /sbin/chkconfig --add clamav-milter @@ -399,6 +393,9 @@ fi %{systemdunitdir}/clamav-daemon.service %{systemdunitdir}/clamav-daemon.socket %{systemdunitdir}/clamav-freshclam.service +# instead of cron? +#%{systemdunitdir}/clamav-freshclam-once.service +#%{systemdunitdir}/clamav-freshclam-once.timer %{systemdunitdir}/clamd.service %{systemdunitdir}/cronjob-clamav.service %{systemdunitdir}/cronjob-clamav.timer @@ -442,17 +439,17 @@ fi %files libs %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/libclamav.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libclamav.so.9 +%attr(755,root,root) %ghost %{_libdir}/libclamav.so.12 %if %{without system_libmspack} %attr(755,root,root) %{_libdir}/libclammspack.*.*.* %attr(755,root,root) %ghost %{_libdir}/libclammspack.so.0 %endif %attr(755,root,root) %{_libdir}/libclamunrar.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.9 +%attr(755,root,root) %ghost %{_libdir}/libclamunrar.so.12 %attr(755,root,root) %{_libdir}/libclamunrar_iface.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.9 +%attr(755,root,root) %ghost %{_libdir}/libclamunrar_iface.so.12 %attr(755,root,root) %{_libdir}/libfreshclam.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libfreshclam.so.2 +%attr(755,root,root) %ghost %{_libdir}/libfreshclam.so.3 %files devel %defattr(644,root,root,755) @@ -464,13 +461,6 @@ fi %attr(755,root,root) %{_libdir}/libclamunrar.so %attr(755,root,root) %{_libdir}/libfreshclam.so %attr(755,root,root) %{_libdir}/libclamunrar_iface.so -%{_libdir}/libclamav.la -%if %{without system_libmspack} -%{_libdir}/libclammspack.la -%endif -%{_libdir}/libclamunrar.la -%{_libdir}/libfreshclam.la -%{_libdir}/libclamunrar_iface.la %dir %{_includedir}/clamav %{_includedir}/clamav/clamav.h %{_includedir}/clamav/clamav-types.h @@ -481,9 +471,14 @@ fi %files static %defattr(644,root,root,755) %{_libdir}/libclamav.a +%{_libdir}/libclamav_rust.a %if %{without system_libmspack} %{_libdir}/libclammspack.a %endif %{_libdir}/libclamunrar.a -%{_libdir}/libfreshclam.a %{_libdir}/libclamunrar_iface.a +%{_libdir}/libfreshclam.a + +%files doc +%defattr(644,root,root,755) +%doc docs/html/*