1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
27 SUMMARY = Antivirus Toolkit
31 THISAPP = clamav-$(VER)
32 DL_FILE = $(THISAPP).tar.gz
33 DL_FROM = $(URL_IPFIRE)
34 DIR_APP = $(DIR_SRC)/$(THISAPP)
35 TARGET = $(DIR_INFO)/$(THISAPP)
43 DATABASE_DIR = /var/lib/clamav
45 ###############################################################################
47 ###############################################################################
51 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
53 $(DL_FILE)_BLAKE2 = 1373c6882b165e769dcc3c3631dfe7183231b2fe4830608b57d919af1a8e9a5a73aa3cc4767981a27bb9845390165b5241750904d50e1a90b7237200b97f7ef3
58 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
60 download :$(patsubst %,$(DIR_DL)/%,$(objects))
62 b2 : $(subst %,%_BLAKE2,$(objects))
67 ###############################################################################
68 # Downloading, checking, b2sum
69 ###############################################################################
71 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
74 $(patsubst %,$(DIR_DL)/%,$(objects)) :
77 $(subst %,%_BLAKE2,$(objects)) :
80 ###############################################################################
81 # Installation Details
82 ###############################################################################
84 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
86 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
88 cd $(DIR_APP) && mkdir -pv build
89 cd $(DIR_APP)/build && cmake .. -G Ninja \
90 -DCMAKE_BUILD_TYPE=Release \
91 -DCMAKE_INSTALL_PREFIX=/usr \
92 -DCMAKE_INSTALL_LIBDIR=/usr/lib \
94 -DBYTECODE_RUNTIME="interpreter" \
96 -DENABLE_CLAMONACC=OFF \
98 -DENABLE_MAN_PAGES=OFF \
99 -DENABLE_EXTERNAL_MSPACK=OFF \
100 -DENABLE_FRESHCLAM_DNS_FIX=ON \
101 -DAPP_CONFIG_DIRECTORY=/var/ipfire/clamav \
102 -DCURSES_LIBRARY=/usr/lib/libncurses.so \
103 -DDATABASE_DIRECTORY=$(DATABASE_DIR)
105 cd $(DIR_APP)/build && ninja $(MAKETUNING) && ninja install
107 mkdir -pv $(DATABASE_DIR)
108 chown clamav.clamav -R $(DATABASE_DIR)
109 rm -rfv $(DATABASE_DIR)/*.cvd
110 mkdir -pv /var/ipfire/clamav
111 cp -rf $(DIR_SRC)/config/clamav/* /var/ipfire/clamav/
112 mkdir -pv /var/run/clamav
113 chown clamav:clamav /var/run/clamav
115 $(call INSTALL_INITSCRIPTS,$(SERVICES))