#14 Enable prelude support (bz#1829726)
Closed 4 years ago by sergiomb. Opened 4 years ago by orion.
rpms/ orion/clamav prelude  into  master

file added
+56
@@ -0,0 +1,56 @@ 

+ diff -up clamav-0.102.2/clamonacc/client/communication.c.curl clamav-0.102.2/clamonacc/client/communication.c

+ --- clamav-0.102.2/clamonacc/client/communication.c.curl	2020-02-04 07:59:26.000000000 -0700

+ +++ clamav-0.102.2/clamonacc/client/communication.c	2020-04-29 21:44:45.073020203 -0600

+ @@ -42,12 +42,12 @@

+  

+  #include "communication.h"

+  

+ -static int onas_socket_wait(curl_socket_t sockfd, int32_t b_recv, uint64_t timeout_ms);

+ +static int onas_socket_wait(long sockfd, int32_t b_recv, uint64_t timeout_ms);

+  

+  /**

+   * Function from curl example code, Copyright (C) 1998 - 2018, Daniel Stenberg, see COPYING.curl for license details

+   */

+ -static int onas_socket_wait(curl_socket_t sockfd, int32_t b_recv, uint64_t timeout_ms)

+ +static int onas_socket_wait(long sockfd, int32_t b_recv, uint64_t timeout_ms)

+  {

+      struct timeval tv;

+      fd_set infd, outfd, errfd;

+ @@ -79,9 +79,9 @@ int onas_sendln(CURL *curl, const void *

+  {

+      size_t sent = 0;

+      CURLcode curlcode;

+ -    curl_socket_t sockfd;

+ +    long sockfd;

+  

+ -    curlcode = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd);

+ +    curlcode = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockfd);

+  

+      if (CURLE_OK != curlcode) {

+          logg("!ClamCom: could not get curl active socket info %s\n", curl_easy_strerror(curlcode));

+ @@ -137,9 +137,9 @@ int onas_recvln(struct RCVLN *rcv_data,

+  {

+      char *eol;

+      int ret = 0;

+ -    curl_socket_t sockfd;

+ +    long sockfd;

+  

+ -    rcv_data->curlcode = curl_easy_getinfo(rcv_data->curl, CURLINFO_ACTIVESOCKET, &sockfd);

+ +    rcv_data->curlcode = curl_easy_getinfo(rcv_data->curl, CURLINFO_LASTSOCKET, &sockfd);

+  

+      if (CURLE_OK != rcv_data->curlcode) {

+          logg("!ClamCom: could not get curl active socket info %s\n", curl_easy_strerror(rcv_data->curlcode));

+ diff -up clamav-0.102.2/m4/reorganization/libs/curl.m4.curl clamav-0.102.2/m4/reorganization/libs/curl.m4

+ --- clamav-0.102.2/m4/reorganization/libs/curl.m4.curl	2020-02-04 07:59:26.000000000 -0700

+ +++ clamav-0.102.2/m4/reorganization/libs/curl.m4	2020-04-29 21:36:15.043808045 -0600

+ @@ -62,8 +62,8 @@ if test "X$have_curl" = "Xyes"; then

+      dnl end of section

+  

+      AM_COND_IF([BUILD_CLAMONACC],

+ -                    dnl if version greater than (7.45)

+ -                    [if test $curl_version -ge 470272 ; then

+ +                    dnl if version greater than (7.29)

+ +                    [if test $curl_version -ge 466176 ; then

+                          $enable_clamonacc="yes"

+                      else

+                          AC_MSG_ERROR([m4_normalize([

file modified
+35 -8
@@ -2,13 +2,8 @@ 

  

  %global _hardened_build 1

  

- ## Fedora Extras specific customization below...

- # EL7's curl is too old

- %if 0%{?fedora} || 0%{?rhel} >= 8

+ ## Fedora specific customization below...

  %bcond_without  clamonacc

- %else

- %bcond_with     clamonacc

- %endif

  %bcond_without  tmpfiles

  %bcond_with     unrar

  %ifnarch ppc64
@@ -46,7 +41,7 @@ 

  Summary:    End-user tools for the Clam Antivirus scanner

  Name:       clamav

  Version:    0.102.2

- Release:    6%{?dist}

+ Release:    8%{?dist}

  License:    %{?with_unrar:proprietary}%{!?with_unrar:GPLv2}

  URL:        https://www.clamav.net/

  %if %{with unrar}
@@ -72,6 +67,8 @@ 

  Source11:   daily-25719.cvd

  #http://database.clamav.net/bytecode.cvd

  Source12:   bytecode-331.cvd

+ #for clamonacc

+ Source100:  clamonacc.service

  #for update

  Source200:  freshclam-sleep

  Source201:  freshclam.sysconfig
@@ -92,6 +89,8 @@ 

  Patch1:     clamav-default_confs.patch

  # Fix pkg-config flags for static linking, multilib

  Patch2:     clamav-0.99-private.patch

+ # Patch to use EL7 libcurl

+ Patch3:     clamav-curl.patch

  

  BuildRequires:  autoconf automake gettext-devel libtool libtool-ltdl-devel

  BuildRequires:  gcc-c++
@@ -99,6 +98,7 @@ 

  BuildRequires:  curl-devel

  BuildRequires:  gmp-devel

  BuildRequires:  json-c-devel

+ BuildRequires:  libprelude-devel

  BuildRequires:  libxml2-devel

  BuildRequires:  ncurses-devel

  BuildRequires:  openssl-devel
@@ -117,6 +117,7 @@ 

  #for milter

  BuildRequires:  sendmail-devel

  

+ Requires:   clamav-filesystem = %version-%release

  Requires:   clamav-lib = %version-%release

  Requires:   data(clamav)

  
@@ -247,6 +248,8 @@ 

  %endif

  %patch1 -p1 -b .default_confs

  %patch2 -p1 -b .private

+ # Patch to use older libcurl

+ %{?el7:%patch3 -p1 -b .curl}

  

  install -p -m0644 %SOURCE300 clamav-milter/

  
@@ -277,6 +280,7 @@ 

      --disable-rpath \

      --disable-silent-rules \

      --enable-clamdtop \

+     --enable-prelude \

      %{!?with_clamonacc:--disable-clamonacc} \

      %{!?with_llvm:--disable-llvm}

  
@@ -316,6 +320,8 @@ 

  install -D -m 0644 -p %SOURCE3      _doc_server/clamd.logrotate

  install -D -m 0644 -p %SOURCE5      _doc_server/README

  

+ install -D -p -m 0644 %SOURCE100        $RPM_BUILD_ROOT%_unitdir/clamonacc.service

+ 

  install -D -p -m 0644 %SOURCE530        $RPM_BUILD_ROOT%_unitdir/clamd@.service

  

  ## prepare the update-files
@@ -407,6 +413,16 @@ 

  make check

  

  

+ %post

+ %systemd_post clamonacc.service

+ 

+ %preun

+ %systemd_preun clamonacc.service

+ 

+ %postun

+ %systemd_postun_with_restart clamonacc.service

+ 

+ 

  %pre filesystem

  getent group %{updateuser} >/dev/null || groupadd -r %{updateuser}

  getent passwd %{updateuser} >/dev/null || \
@@ -511,6 +527,7 @@ 

  %_mandir/man[15]/*

  %exclude %_mandir/*/freshclam*

  %exclude %_mandir/man5/clamd.conf.5*

+ %_unitdir/clamonacc.service

  

  

  %files lib
@@ -531,6 +548,8 @@ 

  %files filesystem

  %attr(-,%updateuser,%updateuser) %dir %homedir

  %dir %_sysconfdir/clamd.d

+ # Used by both clamd, clamdscan, and clamonacc

+ %config(noreplace) %_sysconfdir/clamd.d/scan.conf

  

  

  %files data
@@ -565,7 +584,6 @@ 

  %_sbindir/clamd

  %_unitdir/clamd@.service

  

- %config(noreplace) %_sysconfdir/clamd.d/scan.conf

  %ghost %scanstatedir/clamd.sock

  %if %{with tmpfiles}

    %_tmpfilesdir/clamd.scan.conf
@@ -594,6 +612,15 @@ 

  

  

  %changelog

+ * Thu Apr 30 2020 Orion Poplawski <orion@nwra.com> - 0.102.2-8

+ - Enable prelude support (bz#1829726)

+ 

+ * Wed Apr 29 2020 Orion Poplawski <orion@nwra.com> - 0.102.2-7

+ - Move /etc/clamd.d/scan.conf to clamav-filesystem

+ - Add patch to build with EL7 libcurl - re-enable on-access scanning

+   (bz#1820395)

+ - Add clamonacc.service

+ 

  * Tue Apr 21 2020 Björn Esser <besser82@fedoraproject.org> - 0.102.2-6

  - Rebuild (json-c)

  

file added
+11
@@ -0,0 +1,11 @@ 

+ [Unit]

+ Description=Clam AntiVirus userspace daemon for OnAccess Scanning

+ Documentation=man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/

+ ConditionPathExists=/etc/clamd.d/scan.conf

+ After=clamd@scan.service

+ 

+ [Service]

+ ExecStart=/usr/bin/clamonacc --foreground

+ 

+ [Install]

+ WantedBy=multi-user.target

Note that this is built on top of PR #13

i'm deeply sorry I pushed commits to master when I wanted pushed the commits to my fork , now I can't revert it .

https://src.fedoraproject.org/rpms/clamav/pull-request/15 is what I'd like propose .

Pull-Request has been closed by sergiomb

4 years ago