diff --git a/packages/clamav/CMakeLists.txt.patch b/packages/clamav/CMakeLists.txt.patch new file mode 100644 index 0000000000..00827820a0 --- /dev/null +++ b/packages/clamav/CMakeLists.txt.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -57,7 +57,7 @@ + # + # Define C_LINUX and C_BSD because CMake only defines UNIX, APPLE, WIN32, MSVC + # +-if(CMAKE_SYSTEM_NAME STREQUAL "Linux") ++if(CMAKE_SYSTEM_NAME MATCHES "Linux|Android") + set(C_LINUX 1) + elseif(APPLE OR CMAKE_SYSTEM_NAME MATCHES "BSD") + set(C_BSD 1) diff --git a/packages/clamav/build.sh b/packages/clamav/build.sh index 150db872e2..74ce907442 100644 --- a/packages/clamav/build.sh +++ b/packages/clamav/build.sh @@ -2,39 +2,34 @@ TERMUX_PKG_HOMEPAGE=https://www.clamav.net/ TERMUX_PKG_DESCRIPTION="Anti-virus toolkit for Unix" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=0.103.6 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_VERSION=0.105.1 TERMUX_PKG_SRCURL=https://www.clamav.net/downloads/production/clamav-$TERMUX_PKG_VERSION.tar.gz -TERMUX_PKG_SHA256=aaa12e3dc19f1d323b1c50d7a10fa8af557e4390149e864d59bde39b6ad9ba33 -TERMUX_PKG_DEPENDS="json-c, libandroid-support, libbz2, libc++, libcurl, libltdl, liblzma, libxml2, openssl, pcre2, zlib" +TERMUX_PKG_SHA256=d2bc16374db889a6e5a6ac40f8c6e700254a039acaa536885a09eeea4b8529f6 +TERMUX_PKG_DEPENDS="json-c, libandroid-support, libbz2, libc++, libcurl, libiconv, libxml2, ncurses, openssl, pcre2, zlib" TERMUX_PKG_BREAKS="clamav-dev" TERMUX_PKG_REPLACES="clamav-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ---sysconfdir=$TERMUX_PREFIX/etc/clamav ---with-libcurl=$TERMUX_PREFIX ---with-pcre=$TERMUX_PREFIX ---with-libjson=$TERMUX_PREFIX ---with-openssl=$TERMUX_PREFIX ---with-xml=$TERMUX_PREFIX ---with-zlib=$TERMUX_PREFIX ---disable-clamonacc ---disable-llvm ---disable-dns" - +-DAPP_CONFIG_DIRECTORY=$TERMUX_PREFIX/etc/clamav +-DBYTECODE_RUNTIME=interpreter +-DENABLE_CLAMONACC=OFF +-DENABLE_MILTER=OFF +-DENABLE_TESTS=OFF +-Dtest_run_result=0 +-Dtest_run_result__TRYRUN_OUTPUT= +" TERMUX_PKG_RM_AFTER_INSTALL=" share/man/man5/clamav-milter.conf.5 -share/man/man8/clamav-milter.8" - +share/man/man8/clamav-milter.8 +share/man/man8/clamonacc.8 +" TERMUX_PKG_CONFFILES=" etc/clamav/clamd.conf etc/clamav/freshclam.conf" termux_step_pre_configure() { - export OBJC=$CC - - local _libgcc="$($CC -print-libgcc-file-name)" - LDFLAGS+=" -L$(dirname $_libgcc) -l:$(basename $_libgcc)" + termux_setup_rust + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DRUST_COMPILER_TARGET=$CARGO_TARGET_NAME" } termux_step_post_make_install() { diff --git a/packages/clamav/cmake-FindRust.cmake.patch b/packages/clamav/cmake-FindRust.cmake.patch new file mode 100644 index 0000000000..def7e9ad88 --- /dev/null +++ b/packages/clamav/cmake-FindRust.cmake.patch @@ -0,0 +1,11 @@ +--- a/cmake/FindRust.cmake ++++ b/cmake/FindRust.cmake +@@ -245,7 +245,7 @@ + # Determine the native libs required to link w/ rust static libs + # message(STATUS "Detecting native static libs for rust: ${rustc_EXECUTABLE} --crate-type staticlib --print=native-static-libs /dev/null") + execute_process( +- COMMAND ${CMAKE_COMMAND} -E env "CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}" ${rustc_EXECUTABLE} --crate-type staticlib --print=native-static-libs /dev/null ++ COMMAND ${CMAKE_COMMAND} -E env "CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}" ${rustc_EXECUTABLE} --target ${RUST_COMPILER_TARGET} --crate-type staticlib --print=native-static-libs /dev/null + OUTPUT_VARIABLE RUST_NATIVE_STATIC_LIBS_OUTPUT + ERROR_VARIABLE RUST_NATIVE_STATIC_LIBS_ERROR + RESULT_VARIABLE RUST_NATIVE_STATIC_LIBS_RESULT diff --git a/packages/clamav/configure.patch b/packages/clamav/configure.patch deleted file mode 100644 index b3440ba065..0000000000 --- a/packages/clamav/configure.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr clamav-0.102.0/configure clamav-0.102.0.mod/configure ---- clamav-0.102.0/configure 2019-10-01 20:24:08.000000000 +0300 -+++ clamav-0.102.0.mod/configure 2019-11-02 23:32:29.043631184 +0200 -@@ -26711,7 +26711,7 @@ - - have_fanotify="no" - if test "$have_pthreads" = "yes"; then -- THREAD_LIBS="-lpthread" -+ THREAD_LIBS="" - TH_SAFE="-thread-safe" - if test "$want_fanotify" = "yes"; then - ac_fn_c_check_header_mongrel "$LINENO" "sys/fanotify.h" "ac_cv_header_sys_fanotify_h" "$ac_includes_default" diff --git a/packages/clamav/docs-CMakeLists.txt.patch b/packages/clamav/docs-CMakeLists.txt.patch new file mode 100644 index 0000000000..5f56721454 --- /dev/null +++ b/packages/clamav/docs-CMakeLists.txt.patch @@ -0,0 +1,11 @@ +--- a/docs/CMakeLists.txt ++++ b/docs/CMakeLists.txt +@@ -107,7 +107,7 @@ + + # When built from the release tarball, this includes the user manual + # which is exported from the clamav-faq repo. +-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html/index.html) ++if(FALSE) + if(WIN32) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/html/ + DESTINATION ./UserManual diff --git a/packages/clamav/fix-hardcoded-paths.patch b/packages/clamav/fix-hardcoded-paths.patch index 6e3a226af8..3067c4b015 100644 --- a/packages/clamav/fix-hardcoded-paths.patch +++ b/packages/clamav/fix-hardcoded-paths.patch @@ -22,8 +22,8 @@ diff -uNr clamav-0.102.0/libclamav/others_common.c clamav-0.102.0.mod/libclamav/ #endif /* _WIN32 */ #endif /* P_tmpdir */ -diff -uNr clamav-0.102.0/shared/optparser.c clamav-0.102.0.mod/shared/optparser.c ---- clamav-0.102.0/shared/optparser.c 2019-10-01 20:24:09.000000000 +0300 +diff -uNr clamav-0.102.0/common/optparser.c clamav-0.102.0.mod/shared/optparser.c +--- clamav-0.102.0/common/optparser.c 2019-10-01 20:24:09.000000000 +0300 +++ clamav-0.102.0.mod/shared/optparser.c 2019-11-02 23:40:11.705398185 +0200 @@ -192,7 +192,7 @@ @@ -56,12 +56,12 @@ diff -uNr clamav-0.102.0/shared/optparser.c clamav-0.102.0.mod/shared/optparser. {"LocalSocketGroup", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Sets the group ownership on the unix socket.", "virusgroup"}, -@@ -271,7 +271,7 @@ +@@ -333,7 +333,7 @@ {"DisableCache", "disable-cache", 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN, "This option allows you to disable clamd's caching feature.", "no"}, -- {"VirusEvent", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Execute a command when a virus is found. In the command string %v will be\nreplaced with the virus name. Additionally, two environment variables will\nbe defined: $CLAM_VIRUSEVENT_FILENAME and $CLAM_VIRUSEVENT_VIRUSNAME.", "/usr/bin/mailx -s \"ClamAV VIRUS ALERT: %v\" alert < /dev/null"}, -+ {"VirusEvent", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Execute a command when a virus is found. In the command string %v will be\nreplaced with the virus name. Additionally, two environment variables will\nbe defined: $CLAM_VIRUSEVENT_FILENAME and $CLAM_VIRUSEVENT_VIRUSNAME.", "@TERMUX_PREFIX@/bin/mailx -s \"ClamAV VIRUS ALERT: %v\" alert < /dev/null"}, +- {"VirusEvent", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Execute a command when a virus is found. In the command string %v will be\nreplaced with the virus name and %f will be replaced with the file name.\nAdditionally, two environment variables will be defined: $CLAM_VIRUSEVENT_FILENAME\nand $CLAM_VIRUSEVENT_VIRUSNAME.", "/usr/bin/mailx -s \"ClamAV VIRUS ALERT: %v\" alert < /dev/null"}, ++ {"VirusEvent", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, "Execute a command when a virus is found. In the command string %v will be\nreplaced with the virus name and %f will be replaced with the file name.\nAdditionally, two environment variables will be defined: $CLAM_VIRUSEVENT_FILENAME\nand $CLAM_VIRUSEVENT_VIRUSNAME.", "@TERMUX_PREFIX@/bin/mailx -s \"ClamAV VIRUS ALERT: %v\" alert < /dev/null"}, {"ExitOnOOM", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD, "Stop the daemon when libclamav reports an out of memory condition.", "yes"}, @@ -83,12 +83,15 @@ diff -uNr clamav-0.102.0/shared/optparser.c clamav-0.102.0.mod/shared/optparser. {"MilterSocketGroup", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Define the group ownership for the (unix) milter socket.", "virusgroup"}, -@@ -554,7 +554,7 @@ +@@ -621,9 +621,9 @@ {"Chroot", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Chroot to the specified directory.\nChrooting is performed just after reading the config file and before\ndropping privileges.", "/newroot"}, -- {"Whitelist", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned. Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be whitelisted.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "/etc/whitelisted_addresses"}, -+ {"Whitelist", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned. Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be whitelisted.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "@TERMUX_PREFIX@/etc/clamav/whitelisted_addresses"}, +- {"AllowList", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned. Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be allowed.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "/etc/allowed_addresses"}, ++ {"AllowList", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned. Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be allowed.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "@TERMUX_PREFIX@/etc/allowed_addresses"}, + // The Whitelist option should remain functional for a version or two, but has been deprecated in the documentation in favor of "AllowList". +- {"Whitelist", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned. Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be allowed.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "/etc/allowed_addresses"}, ++ {"Whitelist", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "This option specifies a file which contains a list of basic POSIX regular\nexpressions. Addresses (sent to or from - see below) matching these regexes\nwill not be scanned. Optionally each line can start with the string \"From:\"\nor \"To:\" (note: no whitespace after the colon) indicating if it is,\nrespectively, the sender or recipient that is to be allowed.\nIf the field is missing, \"To:\" is assumed.\nLines starting with #, : or ! are ignored.", "@TERMUX_PREFIX@/etc/allowed_addresses"}, {"SkipAuthenticated", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, "Messages from authenticated SMTP users matching this extended POSIX\nregular expression (egrep-like) will not be scanned.\nAs an alternative, a file containing a plain (not regex) list of names (one\nper line) can be specified using the prefix \"file:\".\ne.g. SkipAuthenticated file:/etc/good_guys\n\nNote: this is the AUTH login name!", "SkipAuthenticated ^(tom|dick|henry)$"}, diff --git a/packages/clamav/libfreshclam-CMakeLists.txt.patch b/packages/clamav/libfreshclam-CMakeLists.txt.patch new file mode 100644 index 0000000000..7bba44c78c --- /dev/null +++ b/packages/clamav/libfreshclam-CMakeLists.txt.patch @@ -0,0 +1,11 @@ +--- a/libfreshclam/CMakeLists.txt ++++ b/libfreshclam/CMakeLists.txt +@@ -48,7 +48,7 @@ + resolv + ${APPLE_CORE_FOUNDATION} + ${APPLE_SECURITY} ) +- elseif(UNIX) ++ elseif(FALSE) + if(HAVE_RESOLV_H AND NOT C_BSD) # BSD appears to have libresolv inside libc + target_link_libraries( freshclam + PUBLIC