]> TLD Linux GIT Repositories - packages/clamav.git/commitdiff
- updated to 0.104.2, partial PLD merge master
authorMarcin Krol <hawk@tld-linux.org>
Sat, 22 Jan 2022 12:06:05 +0000 (13:06 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 22 Jan 2022 12:06:05 +0000 (13:06 +0100)
clamav-add-support-for-system-tomsfastmath.patch
clamav-headers.patch [deleted file]
clamav-nolibs.patch [deleted file]
clamav.spec
x32.patch

index 8dca9c160f3d8822ab1801a1bcc60c5f8231adf2..4435deb631f5b19f30a72f553a9318c0143b50ba 100644 (file)
@@ -13,55 +13,9 @@ Patch-Name: add-support-for-system-tomsfastmath.patch
  5 files changed, 28 insertions(+), 4 deletions(-)
  create mode 100644 m4/reorganization/libs/tomsfastmath.m4
 
-diff --git a/configure.ac b/configure.ac
-index 9ef4105..a286b44 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -82,6 +82,7 @@ m4_include([m4/reorganization/libs/xml.m4])
- m4_include([m4/reorganization/libs/json.m4])
- m4_include([m4/reorganization/libs/pcre.m4])
- m4_include([m4/reorganization/libs/libmspack.m4])
-+m4_include([m4/reorganization/libs/tomsfastmath.m4])
- if test "x$use_internal_mspack" = "xno"; then
-     mspack_msg="External, $LIBMSPACK_CFLAGS $LIBMSPACK_LIBS"
-@@ -286,6 +287,7 @@ fi
- CL_MSG_STATUS([yara        ],[$enable_yara],[$enable_yara])
- CL_MSG_STATUS([fts         ],[yes],[$lfs_fts_msg])
-+CL_MSG_STATUS([tomsfastmath],[yes],[$tomsfastmath_msg])
- # Yep, downgrading the compiler avoids the bug too:
- # 4.0.x, and 4.1.0 are the known buggy versions
---- clamav-0.103.0/libclamav/Makefile.am.orig  2020-09-13 02:27:09.000000000 +0200
-+++ clamav-0.103.0/libclamav/Makefile.am       2020-11-23 06:32:13.715611447 +0100
-@@ -588,7 +588,10 @@
-       yara_clam.h
- endif
--libclamav_la_SOURCES += bignum.h\
-+libclamav_la_SOURCES += bignum.h
-+
-+if !SYSTEM_TOMSFASTMATH
-+libclamav_la_SOURCES += \
-       bignum_fast.h\
-       tomsfastmath/addsub/fp_add.c\
-       tomsfastmath/addsub/fp_add_d.c\
-@@ -671,6 +674,10 @@
-       tomsfastmath/sqr/fp_sqr_comba_generic.c\
-       tomsfastmath/sqr/fp_sqr_comba_small_set.c\
-       tomsfastmath/sqr/fp_sqrmod.c
-+else
-+libclamav_la_CFLAGS += $(TOMSFASTMATH_CFLAGS)
-+libclamav_la_LIBADD += $(TOMSFASTMATH_LIBS)
-+endif
- .PHONY2: version.h.tmp
- version.c: version.h
-diff --git a/libclamav/bignum.h b/libclamav/bignum.h
-index 9acb17b..56967b1 100644
---- a/libclamav/bignum.h
-+++ b/libclamav/bignum.h
+diff -urNp -x '*.orig' clamav-0.103.0.org/libclamav/bignum.h clamav-0.103.0/libclamav/bignum.h
+--- clamav-0.103.0.org/libclamav/bignum.h      2020-09-13 02:27:09.000000000 +0200
++++ clamav-0.103.0/libclamav/bignum.h  2021-04-06 16:40:12.578841141 +0200
 @@ -1,9 +1,13 @@
  #ifndef BIGNUM_H_
  #define BIGNUM_H_
@@ -76,12 +30,11 @@ index 9acb17b..56967b1 100644
 +
  typedef fp_int mp_int;
  #define mp_cmp fp_cmp
- #define mp_toradix_n(a,b,c,d) fp_toradix_n(a,b,c,d)
-diff --git a/libclamav/xdp.c b/libclamav/xdp.c
-index 00edfa8..674dc7c 100644
---- a/libclamav/xdp.c
-+++ b/libclamav/xdp.c
-@@ -57,7 +57,7 @@
+ #define mp_toradix_n(a, b, c, d) fp_toradix_n(a, b, c, d)
+diff -urNp -x '*.orig' clamav-0.103.0.org/libclamav/xdp.c clamav-0.103.0/libclamav/xdp.c
+--- clamav-0.103.0.org/libclamav/xdp.c 2020-09-13 02:27:10.000000000 +0200
++++ clamav-0.103.0/libclamav/xdp.c     2021-04-06 16:40:12.578841141 +0200
+@@ -52,7 +52,7 @@
  #include "scanners.h"
  #include "conv.h"
  #include "xdp.h"
@@ -90,21 +43,153 @@ index 00edfa8..674dc7c 100644
  #include "filetypes.h"
  
  static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz);
-diff --git a/m4/reorganization/libs/tomsfastmath.m4 b/m4/reorganization/libs/tomsfastmath.m4
-new file mode 100644
-index 0000000..2a821a1
---- /dev/null
-+++ b/m4/reorganization/libs/tomsfastmath.m4
-@@ -0,0 +1,12 @@
-+dnl Check for system tomsfastmath
-+PKG_CHECK_MODULES([TOMSFASTMATH], [tomsfastmath], [have_system_tomsfastmath=yes], [have_system_tomsfastmath=no])
-+
-+AM_CONDITIONAL([SYSTEM_TOMSFASTMATH], [test "x$have_system_tomsfastmath" = "xyes"])
-+
-+if test "x$have_system_tomsfastmath" = "xyes"; then
-+    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [1], [link against system-wide tomsfastmath library])
-+    tomsfastmath_msg="External, $TOMSFASTMATH_CFLAGS $TOMSFASTMATH_LIBS"
-+else
-+    AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [0], [don't link against system-wide tomsfastmath library])
-+    tomsfastmath_msg="Internal"
-+fi
+
+--- clamav-0.104.0/libclamav/CMakeLists.txt~   2021-08-27 22:41:31.000000000 +0000
++++ clamav-0.104.0/libclamav/CMakeLists.txt    2021-10-08 14:11:34.629965363 +0000
+@@ -157,99 +157,6 @@ target_link_libraries( yara
+         PCRE2::pcre2
+         JSONC::jsonc )
+-add_library( tomsfastmath OBJECT )
+-target_sources( tomsfastmath
+-    PRIVATE
+-        tomsfastmath/addsub/fp_add.c
+-        tomsfastmath/addsub/fp_add_d.c
+-        tomsfastmath/addsub/fp_addmod.c
+-        tomsfastmath/addsub/fp_cmp.c
+-        tomsfastmath/addsub/fp_cmp_d.c
+-        tomsfastmath/addsub/fp_cmp_mag.c
+-        tomsfastmath/addsub/fp_sub.c
+-        tomsfastmath/addsub/fp_sub_d.c
+-        tomsfastmath/addsub/fp_submod.c
+-        tomsfastmath/addsub/s_fp_add.c
+-        tomsfastmath/addsub/s_fp_sub.c
+-        tomsfastmath/bin/fp_radix_size.c
+-        tomsfastmath/bin/fp_read_radix.c
+-        tomsfastmath/bin/fp_read_signed_bin.c
+-        tomsfastmath/bin/fp_read_unsigned_bin.c
+-        tomsfastmath/bin/fp_reverse.c
+-        tomsfastmath/bin/fp_s_rmap.c
+-        tomsfastmath/bin/fp_signed_bin_size.c
+-        tomsfastmath/bin/fp_to_signed_bin.c
+-        tomsfastmath/bin/fp_to_unsigned_bin.c
+-        tomsfastmath/bin/fp_toradix.c
+-        tomsfastmath/bin/fp_toradix_n.c
+-        tomsfastmath/bin/fp_unsigned_bin_size.c
+-        tomsfastmath/bit/fp_cnt_lsb.c
+-        tomsfastmath/bit/fp_count_bits.c
+-        tomsfastmath/bit/fp_div_2.c
+-        tomsfastmath/bit/fp_div_2d.c
+-        tomsfastmath/bit/fp_lshd.c
+-        tomsfastmath/bit/fp_mod_2d.c
+-        tomsfastmath/bit/fp_rshd.c
+-        tomsfastmath/divide/fp_div.c
+-        tomsfastmath/divide/fp_div_d.c
+-        tomsfastmath/divide/fp_mod.c
+-        tomsfastmath/divide/fp_mod_d.c
+-        tomsfastmath/exptmod/fp_2expt.c
+-        tomsfastmath/exptmod/fp_exptmod.c
+-        tomsfastmath/misc/fp_ident.c
+-        tomsfastmath/misc/fp_set.c
+-        tomsfastmath/mont/fp_montgomery_calc_normalization.c
+-        tomsfastmath/mont/fp_montgomery_reduce.c
+-        tomsfastmath/mont/fp_montgomery_setup.c
+-        tomsfastmath/mul/fp_mul.c
+-        tomsfastmath/mul/fp_mul_comba.c
+-        tomsfastmath/mul/fp_mul_2.c
+-        tomsfastmath/mul/fp_mul_2d.c
+-        tomsfastmath/mul/fp_mul_comba_12.c
+-        tomsfastmath/mul/fp_mul_comba_17.c
+-        tomsfastmath/mul/fp_mul_comba_20.c
+-        tomsfastmath/mul/fp_mul_comba_24.c
+-        tomsfastmath/mul/fp_mul_comba_28.c
+-        tomsfastmath/mul/fp_mul_comba_3.c
+-        tomsfastmath/mul/fp_mul_comba_32.c
+-        tomsfastmath/mul/fp_mul_comba_4.c
+-        tomsfastmath/mul/fp_mul_comba_48.c
+-        tomsfastmath/mul/fp_mul_comba_6.c
+-        tomsfastmath/mul/fp_mul_comba_64.c
+-        tomsfastmath/mul/fp_mul_comba_7.c
+-        tomsfastmath/mul/fp_mul_comba_8.c
+-        tomsfastmath/mul/fp_mul_comba_9.c
+-        tomsfastmath/mul/fp_mul_comba_small_set.c
+-        tomsfastmath/mul/fp_mul_d.c
+-        tomsfastmath/mul/fp_mulmod.c
+-        tomsfastmath/numtheory/fp_invmod.c
+-        tomsfastmath/sqr/fp_sqr.c
+-        tomsfastmath/sqr/fp_sqr_comba_12.c
+-        tomsfastmath/sqr/fp_sqr_comba_17.c
+-        tomsfastmath/sqr/fp_sqr_comba_20.c
+-        tomsfastmath/sqr/fp_sqr_comba_24.c
+-        tomsfastmath/sqr/fp_sqr_comba_28.c
+-        tomsfastmath/sqr/fp_sqr_comba_3.c
+-        tomsfastmath/sqr/fp_sqr_comba_32.c
+-        tomsfastmath/sqr/fp_sqr_comba_4.c
+-        tomsfastmath/sqr/fp_sqr_comba_48.c
+-        tomsfastmath/sqr/fp_sqr_comba_6.c
+-        tomsfastmath/sqr/fp_sqr_comba_64.c
+-        tomsfastmath/sqr/fp_sqr_comba_7.c
+-        tomsfastmath/sqr/fp_sqr_comba_8.c
+-        tomsfastmath/sqr/fp_sqr_comba_9.c
+-        tomsfastmath/sqr/fp_sqr_comba_generic.c
+-        tomsfastmath/sqr/fp_sqr_comba_small_set.c
+-        tomsfastmath/sqr/fp_sqrmod.c
+-    PUBLIC
+-        bignum.h
+-        bignum_fast.h )
+-target_include_directories( tomsfastmath
+-    PRIVATE ${CMAKE_BINARY_DIR}
+-    PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR} )
+-set_target_properties( tomsfastmath PROPERTIES
+-    COMPILE_FLAGS "${WARNCFLAGS}" )
+-
+ # Bytecode Runtime
+ add_library( bytecode_runtime OBJECT )
+ if(LLVM_FOUND)
+@@ -424,7 +424,7 @@ if(ENABLE_SHARED_LIB)
+             regex
+             lzma_sdk
+             yara
+-            tomsfastmath
++            tfm
+             bytecode_runtime
+             ${LIBMSPACK}
+             ClamAV::libunrar_iface_iface
+@@ -525,7 +525,7 @@ if(ENABLE_STATIC_LIB)
+             regex
+             lzma_sdk
+             yara
+-            tomsfastmath
++            tfm
+             bytecode_runtime
+             ${LIBMSPACK}
+             OpenSSL::SSL
+--- clamav-0.104.0/unit_tests/CMakeLists.txt~  2021-08-27 22:41:31.000000000 +0000
++++ clamav-0.104.0/unit_tests/CMakeLists.txt   2021-10-08 14:20:36.239965193 +0000
+@@ -52,7 +52,7 @@ if(ENABLE_APP)
+             regex
+             lzma_sdk
+             yara
+-            tomsfastmath
++            tfm
+             bytecode_runtime
+             JSONC::jsonc
+             ${LIBMSPACK}
+@@ -92,7 +92,7 @@ if(ENABLE_APP)
+             regex
+             lzma_sdk
+             yara
+-            tomsfastmath
++            tfm
+             bytecode_runtime
+             JSONC::jsonc
+             ${LIBMSPACK}
+@@ -144,7 +144,7 @@ target_link_libraries(check_clamav
+         regex
+         lzma_sdk
+         yara
+-        tomsfastmath
++        tfm
+         bytecode_runtime
+         JSONC::jsonc
+         ${LIBMSPACK}
diff --git a/clamav-headers.patch b/clamav-headers.patch
deleted file mode 100644 (file)
index 8b0f354..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
---- clamav-0.101.0/Makefile.am~        2018-11-29 14:52:31.000000000 +0100
-+++ clamav-0.101.0/Makefile.am 2018-12-07 09:00:16.238721757 +0100
-@@ -34,7 +34,7 @@
- pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = libclamav.pc
--nodist_include_HEADERS = clamav-types.h clamav-version.h
-+pkginclude_HEADERS = clamav-types.h clamav-version.h
- # don't complain that configuration files and databases are not removed, this is intended
- distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print
---- clamav-0.101.0/libclamav/Makefile.am~      2018-11-29 14:52:31.000000000 +0100
-+++ clamav-0.101.0/libclamav/Makefile.am       2018-12-07 09:00:16.312058931 +0100
-@@ -269,7 +269,7 @@
- libclamav_la_LDFLAGS += -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamav/libclamav.map
- endif
--include_HEADERS = clamav.h
-+pkginclude_HEADERS = clamav.h
- libclamav_la_SOURCES = \
-         matcher-ac.c \
---- clamav-0.101.0/libclamav.pc.in~    2018-11-29 14:52:31.000000000 +0100
-+++ clamav-0.101.0/libclamav.pc.in     2018-12-10 11:11:47.748327272 +0100
-@@ -1,7 +1,7 @@
- prefix=@prefix@
- exec_prefix=@exec_prefix@
- libdir=@libdir@
--includedir=@includedir@
-+includedir=@includedir@/clamav
- Name: libclamav
- Description: A GPL virus scanner
---- clamav-0.101.0/clamav-config.in.orig       2018-11-29 14:52:31.000000000 +0100
-+++ clamav-0.101.0/clamav-config.in    2018-12-10 19:32:41.185456107 +0100
-@@ -3,7 +3,7 @@
- prefix=@prefix@
- exec_prefix=@exec_prefix@
--includedir=@includedir@
-+includedir=@includedir@/clamav
- libdir=@libdir@
- usage()
-@@ -55,7 +55,7 @@
-       ;;
-     --cflags)
--              echo -I@includedir@ @CFLAGS@
-+              echo -I${includedir} @CFLAGS@
-               ;;
-     --libs)
---- clamav-0.102.0/libfreshclam/Makefile.am~   2019-10-01 19:24:09.000000000 +0200
-+++ clamav-0.102.0/libfreshclam/Makefile.am    2019-10-04 09:08:07.702507579 +0200
-@@ -32,7 +32,7 @@
- EXTRA_DIST = libfreshclam.map
--include_HEADERS = libfreshclam.h
-+pkginclude_HEADERS = libfreshclam.h
- libfreshclam_la_SOURCES = \
-     $(top_srcdir)/shared/output.c \
diff --git a/clamav-nolibs.patch b/clamav-nolibs.patch
deleted file mode 100644 (file)
index f6fc589..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -ur clamav-0.100.0.orig/m4/reorganization/code_checks/functions.m4 clamav-0.100.0/m4/reorganization/code_checks/functions.m4
---- clamav-0.100.0.orig/m4/reorganization/code_checks/functions.m4     2018-05-28 14:48:02.575976382 +0000
-+++ clamav-0.100.0/m4/reorganization/code_checks/functions.m4  2018-05-28 14:48:28.266976093 +0000
-@@ -1,6 +1,10 @@
- AX_CHECK_UNAME_SYSCALL
-+AC_CHECK_FUNC(socket,, [
- AC_CHECK_LIB([socket], [bind], [LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"])
-+])
-+AC_CHECK_FUNC(gethostent,, [
- AC_SEARCH_LIBS([gethostent],[nsl], [(LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl")])
-+])
- AC_CHECK_FUNCS_ONCE([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise getnameinfo])
- AC_CHECK_FUNCS([strndup])
index 663889318ffda0789675febb53650aa46d50797f..7f833954c5ce555d35b450d02d46c14b3a879617 100644 (file)
@@ -1,4 +1,5 @@
 # TODO:
+# - verify why system tomsfastmath lib fails to check integrity of database after update (as of 2021-11-17)
 # - Make freshclam package (script and daemon)
 # - restart amavis in triggers if group membership was modified?
 #
 Summary:       An anti-virus utility for Unix
 Summary(pl.UTF-8):     Narzędzie antywirusowe dla Uniksów
 Name:          clamav
-Version:       0.103.3
+Version:       0.104.2
 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: f8dcf678953f6af056ddd5917bcc50c3
+# Source0-md5: ad099675f2c09c07850e36496b06c552
 Source1:       %{name}.init
 Source2:       %{name}.sysconfig
 Source3:       %{name}-milter.init
@@ -30,15 +31,12 @@ Source5:    %{name}.logrotate
 Source8:       %{name}-post-updatedb
 Source9:       %{name}-milter.sysconfig
 Patch0:                %{name}-config.patch
-Patch1:                %{name}-nolibs.patch
-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: cmake >= 3.14
 BuildRequires: check-devel
 BuildRequires: curl-devel >= 7.40
 BuildRequires: gmp-devel
@@ -47,7 +45,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}}
@@ -61,7 +58,7 @@ BuildRequires:        tomsfastmath-devel >= 0.13.1-2
 BuildRequires: zlib-devel >= 1.2.2
 Requires(post,preun):  /sbin/chkconfig
 Requires(postun,pre):  /usr/sbin/usermod
-Requires(triggerpostun):       sed >= 4.0
+Requires(postun):      sed >= 4.0
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
 Requires:      %{name}-libs = %{epoch}:%{version}-%{release}
 Requires:      /usr/sbin/usermod
@@ -209,38 +206,39 @@ 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
-%patch3 -p1
+
 %patch4 -p1
-%patch5 -p1
-%patch6 -p1
+#%patch5 -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 \
+       -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/%{name} \
+       -DAPP_CONFIG_DIRECTORY=%{_sysconfdir} \
+       -DDATABASE_DIRECTORY="/var/lib/%{name}" \
+       ..
 %{__make}
 
 %install
@@ -248,9 +246,17 @@ rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,rc.d/init.d,sysconfig} \
        $RPM_BUILD_ROOT%{_var}/{log,spool/clamav,lib/clamav}
 
-%{__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}/libfreshclam{_static,}.a
+%endif
 
 cat <<'EOF' >$RPM_BUILD_ROOT/etc/cron.d/%{name}
 5 * * * *      root    %{_sbindir}/clamav-cron-updatedb
@@ -302,7 +308,7 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del clamd
 fi
 
-%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
@@ -311,7 +317,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,
@@ -436,13 +441,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
@@ -456,6 +454,8 @@ fi
 %if %{without system_libmspack}
 %{_libdir}/libclammspack.a
 %endif
-%{_libdir}/libclamunrar.a
 %{_libdir}/libfreshclam.a
-%{_libdir}/libclamunrar_iface.a
+
+%files doc
+%defattr(644,root,root,755)
+%doc docs/html/*
index 74c216e939d46df9950947048d0b1b58b65df615..5864749be453098382870b71453bc05b4b6f4371 100644 (file)
--- a/x32.patch
+++ b/x32.patch
                     tv1.tv_sec * 1000000 + tv1.tv_usec, pc);
      }
      if (stop == CL_EBYTECODE) {
+--- clamav-0.104.1/libclamav/bignum_fast.h.orig        2021-11-02 20:09:25.000000000 +0100
++++ clamav-0.104.1/libclamav/bignum_fast.h     2021-12-11 10:43:55.832213985 +0100
+@@ -102,7 +102,7 @@
+ #endif
+ /* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */
+-#if defined(__x86_64__)
++#if defined(__x86_64__) && !defined(__ILP32__)
+ #if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM)
+ #error x86-64 detected, x86-32/SSE2/ARM optimizations are not valid!
+ #endif
+@@ -117,7 +117,7 @@
+ #endif
+ /* try to detect x86-32 */
+-#if defined(__i386__) && !defined(TFM_SSE2)
++#if (defined(__i386__) || defined(__ILP32__)) && !defined(TFM_SSE2)
+ #if defined(TFM_X86_64) || defined(TFM_ARM)
+ #error x86-32 detected, x86-64/ARM optimizations are not valid!
+ #endif
+--- clamav-0.104.1/libclamav/tomsfastmath/mont/fp_montgomery_reduce.c.orig     2021-12-11 10:41:02.011008906 +0100
++++ clamav-0.104.1/libclamav/tomsfastmath/mont/fp_montgomery_reduce.c  2021-12-11 10:41:23.713556450 +0100
+@@ -42,7 +42,7 @@
+ : "%eax", "cc")
+ /******************************************************************/
+-#elif defined(TFM_X86_64)
++#elif defined(TFM_X86_64) && !defined(__ILP32__)
+ /* x86-64 code */
+ #define MONT_START