2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"). You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2016, Jim Klimov. All rights reserved.
13 # Copyright 2023, Friedrich Kink. All rights reserved.
17 USE_PARALLEL_BUILD
= yes
18 include ..
/..
/..
/make-rules
/shared-macros.mk
20 COMPONENT_NAME
= clamav
21 ### For X.Y.0 versions the TGZ and DIR do not include trailing .0 piece
22 ### But our IPS version should better have same number of components.
23 ### So the COMPONENT_VERSION may be 0.99 or 0.99.1 (as in original),
24 ### but the IPS_COMPONENT_VERSION is forced to 3-part 0.99.0 or 0.99.1.
25 COMPONENT_VERSION
= 1.4.1
26 ifeq ($(words $(subst .
, ,$(COMPONENT_VERSION
))),2)
27 IPS_COMPONENT_VERSION
= $(COMPONENT_VERSION
).0
29 IPS_COMPONENT_VERSION
= $(COMPONENT_VERSION
)
31 COMPONENT_SUMMARY
= ClamAV
$(IPS_COMPONENT_VERSION
) opensource antivirus toolkit
32 COMPONENT_DESCRIPTION
= ClamAV is an open source
(GPLv2
) anti-virus toolkit
, designed \
33 especially for e-mail scanning on mail gateways. It provides a \
34 number of utilities including a flexible and scalable \
35 multi-threaded daemon
, a command line scanner and advanced tool \
36 for automatic database updates. The core of the package is an \
37 anti-virus engine available in a form of shared library.
38 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
39 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
40 COMPONENT_ARCHIVE_HASH
= sha256
:a318e780ac39a6b3d6c46971382f96edde97ce48b8e361eb80e63415ed416ad8
41 COMPONENT_PROJECT_URL
= https
://www.clamav.net
42 COMPONENT_ARCHIVE_URL
= $(COMPONENT_PROJECT_URL
)/downloads
/production
/$(COMPONENT_ARCHIVE
)
43 #COMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).sig
44 COMPONENT_FMRI
= antivirus
/$(COMPONENT_NAME
)
45 COMPONENT_CLASSIFICATION
= Applications
/System Utilities
46 COMPONENT_LICENSE
= GPLv2
,LGPL
,Apache
47 COMPONENT_LICENSE_FILE
= COPYING.
$(COMPONENT_NAME
)
49 # We need to use non-default User-Agent for the fetch, otherwise we are denied
50 # to download the source file.
51 COMPONENT_FETCH_USER_AGENT
= fetch
53 include $(WS_MAKE_RULES
)/common.mk
55 # clamav now additionally also depends on rust :-(
56 CARGO_HOME
= $(BUILD_DIR
)/.cargo
60 ENV
+= CARGO_HOME
=$(CARGO_HOME
)
63 COMPONENT_BUILD_ENV
= $(ENV
)
65 # Note: This is done just in case, because according to
66 # https://github.com/vrtadmin/clamav-devel/issues/45 currently
67 # ClamAV doesn't support scanning files larger than 2.7GB due
68 # to constraints in the scanning engine.
69 # Still, this can help with not dying on e.g. huge log files :-)
70 CFLAGS
+= $(CPP_LARGEFILES
)
73 CPPFLAGS
+= $(CPP_LARGEFILES
) -I
$(OPENSSL_INCDIR
)
75 # gather all License files in one
76 COMPONENT_PREP_ACTION
= (cd
$(@D
) && for f in COPYING
/*; do cat
$$f >> COPYING.
$(COMPONENT_NAME
) ; done
)
78 CMAKE_ENV
+= LDFLAGS
="-L$(OPENSSL_LIBDIR) -lsocket -lnsl"
79 LDFLAGS
+=-L
$(OPENSSL_LIBDIR
) -lsocket
-lnsl
81 CMAKE_OPTIONS
+= -DPCRE2_INCLUDE_DIR
=/usr
/include/pcre
82 # clang still does not work
83 CMAKE_OPTIONS
+= -DBYTECODE_RUNTIME
=llvm
84 CMAKE_OPTIONS
+= -DBYTECODE_RUNTIME
=interpreter
85 #CMAKE_OPTIONS += -DLLVM_ROOT_DIR=$(CLANG_PREFIX)
86 CMAKE_OPTIONS
+= -DAPP_CONFIG_DIRECTORY
=/etc
/clamav
87 CMAKE_OPTIONS
+= -DCMAKE_SKIP_RPATH
=ON
88 CMAKE_OPTIONS
+= -DENABLE_JSON_SHARED
=OFF
89 CMAKE_OPTIONS
+= -DENABLE_UNRAR
=ON
90 CMAKE_OPTIONS
+= -DENABLE_JSON_SHARED
=ON
91 CMAKE_OPTIONS
+= -DENABLE_SYSTEMD
=OFF
93 # ClamAV has a JIT bytecode support based on CLang LLVM.
94 # All currently available CLang LLVM versions do not build with clamav
95 # Additionlly the included CLang LLVM was removed, so the only available
96 # bytecode support is interpreter.
98 COMPONENT_TEST_TRANSFORMS
+= \
102 # Needed for cmake tests
103 REQUIRED_PACKAGES
+= system
/library
/iconv
/unicode
104 REQUIRED_PACKAGES
+= developer
/check
105 REQUIRED_PACKAGES
+= developer
/lang
/rustc
107 # Auto-generated dependencies
108 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
109 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
110 REQUIRED_PACKAGES
+= $(OPENSSL_PKG
)
111 REQUIRED_PACKAGES
+= SUNWcs
112 REQUIRED_PACKAGES
+= compress
/bzip2
113 REQUIRED_PACKAGES
+= library
/json-c
114 REQUIRED_PACKAGES
+= library
/libmilter
115 REQUIRED_PACKAGES
+= library
/libxml2
116 REQUIRED_PACKAGES
+= library
/ncurses
117 REQUIRED_PACKAGES
+= library
/pcre2
118 REQUIRED_PACKAGES
+= library
/zlib
119 REQUIRED_PACKAGES
+= shell/ksh93
120 REQUIRED_PACKAGES
+= system
/library
121 REQUIRED_PACKAGES
+= system
/library
/math
122 REQUIRED_PACKAGES
+= web
/curl