Hi Micah,

Please find attached patch #2 to clean up patch #1 'if' statements and fix some other issues fond (mostly documentation).

The outstanding variable is LIBCLAMAV_LIBS.

It is used by clamav-config.in and libclamav.pc.in.

Not sure about the logic required for this one. On my OS, it is set to '-lbz2' for autotools but I don't know why it is being set and no other dependent libraries are there.

I would expect it to be a list of all dependent libraries used when linking with libclamav.

Regards
        Mark.

On 29/07/2021 00:54, Micah Snyder (micasnyd) wrote:
How's this? https://github.com/Cisco-Talos/clamav/pull/231


<snipped>

diff -rupd clamav-0.104.0-rc.231/CMakeLists.txt clamav.work/CMakeLists.txt
--- clamav.work.14.cmake/CMakeLists.txt	2021-07-28 20:04:14.000000000 +0100
+++ clamav.work/CMakeLists.txt	2021-07-30 00:43:00.535042945 +0100
@@ -532,7 +532,7 @@ else()
     if(SIZEOF_INT EQUAL 2)
         set(INT16_DEF "typedef signed int int16_t;")
         set(UINT16_DEF "typedef unsigned int uint16_t;")
-    elif(SIZEOF_SHORT EQUAL 2)
+    elseif(SIZEOF_SHORT EQUAL 2)
         set(INT16_DEF "typedef signed short int16_t;")
         set(UINT16_DEF "typedef unsigned short uint16_t;")
     endif()
@@ -540,7 +540,7 @@ else()
     if(SIZEOF_INT EQUAL 4)
         set(INT32_DEF "typedef signed int int32_t;")
         set(UINT32_DEF "typedef unsigned int uint32_t;")
-    elif(SIZEOF_LONG EQUAL 4)
+    elseif(SIZEOF_LONG EQUAL 4)
         set(INT32_DEF "typedef signed long int32_t;")
         set(UINT32_DEF "typedef unsigned long uint32_t;")
     endif()
@@ -548,7 +548,7 @@ else()
     if(SIZEOF_LONG EQUAL 8)
         set(INT64_DEF "typedef signed long int64_t;")
         set(UINT64_DEF "typedef unsigned long uint64_t;")
-    elif(SIZEOF_LONG_LONG EQUAL 8)
+    elseif(SIZEOF_LONG_LONG EQUAL 8)
         set(INT64_DEF "typedef signed long long int64_t;")
         set(UINT64_DEF "typedef unsigned long long uint64_t;")
     endif()
@@ -557,17 +557,13 @@ endif()
 # Always do this
 if(SIZEOF_INT EQUAL 4)
     set(DEFINE_SF32_PREFIX "#define _SF32_PREFIX \"\"")
-else()
-    if(SIZEOF_LONG EQUAL 4)
-        set(DEFINE_SF32_PREFIX "#define _SF32_PREFIX \"l\"")
-    endif()
+elseif(SIZEOF_LONG EQUAL 4)
+    set(DEFINE_SF32_PREFIX "#define _SF32_PREFIX \"l\"")
 endif()
 if(SIZEOF_LONG EQUAL 8)
     set(DEFINE_SF64_PREFIX "#define _SF64_PREFIX \"l\"")
-else()
-    if(SIZEOF_LONG_LONG EQUAL 8)
-        set(DEFINE_SF64_PREFIX "#define _SF64_PREFIX \"ll\"")
-    endif()
+elseif(SIZEOF_LONG_LONG EQUAL 8)
+    set(DEFINE_SF64_PREFIX "#define _SF64_PREFIX \"ll\"")
 endif()
 
 # Check for restrict keyword
diff -rupd clamav-0.104.0-rc.231/docs/man/clamav-milter.8.in clamav.work/docs/man/clamav-milter.8.in
--- clamav.work.14.cmake/docs/man/clamav-milter.8.in	2021-07-21 18:19:22.000000000 +0100
+++ clamav.work/docs/man/clamav-milter.8.in	2021-07-30 10:48:34.811048415 +0100
@@ -27,7 +27,7 @@ Print the version number and exit.
 Read configuration from FILE.
 .SH "FILES"
 .LP 
-@CFGDIR@/clamav-milter.conf
+@CONFDIR@/clamav-milter.conf
 .SH "AUTHOR"
 .LP 
 aCaB <a...@clamav.net>
diff -rupd clamav-0.104.0-rc.231/docs/man/clamav-milter.conf.5.in clamav.work/docs/man/clamav-milter.conf.5.in
--- clamav.work.14.cmake/docs/man/clamav-milter.conf.5.in	2021-07-21 18:19:22.000000000 +0100
+++ clamav.work/docs/man/clamav-milter.conf.5.in	2021-07-30 10:48:34.811048415 +0100
@@ -239,7 +239,7 @@ Default: no
 All options expressing a size are limited to max 4GB. Values in excess will be reset to the maximum.
 .SH "FILES"
 .LP
-@CFGDIR@/clamav-milter.conf
+@CONFDIR@/clamav-milter.conf
 .SH "AUTHOR"
 .LP
 aCaB <a...@clamav.net>
diff -rupd clamav-0.104.0-rc.231/docs/man/clamd.8.in clamav.work/docs/man/clamd.8.in
--- clamav.work.14.cmake/docs/man/clamd.8.in	2021-07-21 18:19:22.000000000 +0100
+++ clamav.work/docs/man/clamd.8.in	2021-07-30 10:48:34.815048464 +0100
@@ -7,7 +7,7 @@ clamd \- an anti\-virus daemon
 clamd [options]
 .SH "DESCRIPTION"
 .LP 
-The daemon listens for incoming connections on Unix and/or TCP socket and scans files or directories on demand. It reads the configuration from @CFGDIR@/clamd.conf
+The daemon listens for incoming connections on Unix and/or TCP socket and scans files or directories on demand. It reads the configuration from @CONFDIR@/clamd.conf
 .SH "COMMANDS"
 .LP 
 It's recommended to prefix clamd commands with the letter \fBz\fR (eg. zSCAN) to indicate that the command will be delimited by a NULL character and that clamd should continue reading command data until a NULL character is read. The null delimiter assures that the complete command and its entire argument will be processed as a single command. Alternatively commands may be prefixed with the letter \fBn\fR (e.g. nSCAN) to use a newline character as the delimiter. Clamd replies will honour the requested terminator in turn.
@@ -125,7 +125,7 @@ Reload the signature databases.
 Perform a clean exit.
 .SH "FILES"
 .LP 
-@CFGDIR@/clamd.conf
+@CONFDIR@/clamd.conf
 .SH "CREDITS"
 Please check the full documentation for credits.
 .SH "AUTHOR"
diff -rupd clamav-0.104.0-rc.231/docs/man/clamd.conf.5.in clamav.work/docs/man/clamd.conf.5.in
--- clamav.work.14.cmake/docs/man/clamd.conf.5.in	2021-07-21 18:19:22.000000000 +0100
+++ clamav.work/docs/man/clamd.conf.5.in	2021-07-30 10:48:34.815048464 +0100
@@ -765,7 +765,7 @@ Default: no
 All options expressing a size are limited to max 4GB. Values in excess will be reset to the maximum.
 .SH "FILES"
 .LP
-@CFGDIR@/clamd.conf
+@CONFDIR@/clamd.conf
 .SH "AUTHORS"
 .LP
 Tomasz Kojm <tk...@clamav.net>, Kevin Lin <k...@sourcefire.com>
diff -rupd clamav-0.104.0-rc.231/docs/man/clamonacc.8.in clamav.work/docs/man/clamonacc.8.in
--- clamav.work.14.cmake/docs/man/clamonacc.8.in	2021-07-21 18:19:22.000000000 +0100
+++ clamav.work/docs/man/clamonacc.8.in	2021-07-30 10:48:34.819048513 +0100
@@ -73,7 +73,7 @@ Reload the signature databases.
 Perform a clean exit.
 .SH "FILES"
 .LP
-@CFGDIR@/clamd.conf
+@CONFDIR@/clamd.conf
 .SH "CREDITS"
 Please check the full documentation for credits.
 .SH "AUTHOR"
diff -rupd clamav-0.104.0-rc.231/docs/man/clamscan.1.in clamav.work/docs/man/clamscan.1.in
--- clamav.work.14.cmake/docs/man/clamscan.1.in	2021-07-21 18:19:22.000000000 +0100
+++ clamav.work/docs/man/clamscan.1.in	2021-07-30 10:48:34.819048513 +0100
@@ -46,7 +46,7 @@ Skip printing OK files
 Sound bell on virus detection.
 .TP
 \fB\-\-tempdir=DIRECTORY\fR
-Create temporary files in DIRECTORY. Directory must be writable for the '@CLAMAVUSER@' user or unprivileged user running clamscan.
+Create temporary files in DIRECTORY. Directory must be writable for the '@CLAMAV_USER@' user or unprivileged user running clamscan.
 .TP
 \fB\-\-leave\-temps\fR
 Do not remove temporary files.
@@ -85,10 +85,10 @@ Scan files listed line by line in FILE.
 Remove infected files. \fBBe careful!\fR
 .TP
 \fB\-\-move=DIRECTORY\fR
-Move infected files into DIRECTORY. Directory must be writable for the '@CLAMAVUSER@' user or unprivileged user running clamscan.
+Move infected files into DIRECTORY. Directory must be writable for the '@CLAMAV_USER@' user or unprivileged user running clamscan.
 .TP
 \fB\-\-copy=DIRECTORY\fR
-Copy infected files into DIRECTORY. Directory must be writable for the '@CLAMAVUSER@' user or unprivileged user running clamscan.
+Copy infected files into DIRECTORY. Directory must be writable for the '@CLAMAV_USER@' user or unprivileged user running clamscan.
 .TP
 \fB\-\-exclude=REGEX, \-\-exclude\-dir=REGEX\fR
 Don't scan file/directory names matching regular expression. These options can be used multiple times.
diff -rupd clamav-0.104.0-rc.231/docs/man/freshclam.1.in clamav.work/docs/man/freshclam.1.in
--- clamav.work.14.cmake/docs/man/freshclam.1.in	2021-07-21 18:19:22.000000000 +0100
+++ clamav.work/docs/man/freshclam.1.in	2021-07-30 10:48:34.823048480 +0100
@@ -52,7 +52,7 @@ Write daemon's pid to FILE.
 Don't fork into background (for use in daemon mode).
 .TP
 \fB\-u USER, \-\-user USER\fR
-Run as USER. By default (when started by root) freshclam drops privileges and operates as the '@CLAMAVUSER@' user.
+Run as USER. By default (when started by root) freshclam drops privileges and operates as the '@CLAMAV_USER@' user.
 .TP
 \fB\-\-no\-dns\fR
 This option forces old non\-DNS verification method (without a TTL delay).
@@ -61,7 +61,7 @@ This option forces old non\-DNS verifica
 Check #n times per day for a new database. #n must be between 1 and 50.
 .TP
 \fB\-\-datadir=DIRECTORY\fR
-Install new database in DIRECTORY. The directory must be writable for the '@CLAMAVUSER@' user or unprivileged user running freshclam.
+Install new database in DIRECTORY. The directory must be writable for the '@CLAMAV_USER@' user or unprivileged user running freshclam.
 .TP
 \fB\-\-daemon\-notify=/path/to/clamd.conf\fR
 Notify the daemon about the new database. By default it reads a hardcoded config file but you can use a different one. Both local and TCP sockets are supported.
@@ -121,14 +121,14 @@ Some return codes of freshclam can be ov
 .TP
 59: Mirrors are not fully synchronized (try again later).
 .TP
-60: Can't get information about '@CLAMAVUSER@' user from /etc/passwd.
+60: Can't get information about '@CLAMAV_USER@' user from /etc/passwd.
 .TP
 61: Can't drop privileges.
 .TP
 62: Can't initialize logger.
 .SH "FILES"
 .LP
-@CFGDIR@/freshclam.conf
+@CONFDIR@/freshclam.conf
 .SH "CREDITS"
 Please check the full documentation for credits.
 .SH "AUTHOR"
diff -rupd clamav-0.104.0-rc.231/docs/man/freshclam.conf.5.in clamav.work/docs/man/freshclam.conf.5.in
--- clamav.work.14.cmake/docs/man/freshclam.conf.5.in	2021-07-21 18:19:22.000000000 +0100
+++ clamav.work/docs/man/freshclam.conf.5.in	2021-07-30 10:48:34.823048480 +0100
@@ -84,7 +84,7 @@ Default: disabled.
 \fBDatabaseOwner STRING\fR
 When started by root, drop privileges to a specified user.
 .br
-Default: @CLAMAVUSER@
+Default: @CLAMAV_USER@
 .TP
 \fBChecks NUMBER\fR
 Number of database checks per day.
@@ -210,7 +210,7 @@ This option enables downloading of bytec
 Default: yes
 .SH "FILES"
 .LP
-@CFGDIR@/freshclam.conf
+@CONFDIR@/freshclam.conf
 .SH "AUTHOR"
 .LP
 Thomas Lamy <thomas.l...@netwake.de>, Tomasz Kojm <tk...@clamav.net>, Kevin Lin <k...@sourcefire.com>
_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml

Reply via email to