Makefile (3252B)
1 # 2 # Copyright (C) 2015 OpenWrt.org 3 # 4 # This is free software, licensed under the GNU General Public License v2. 5 # See /LICENSE for more information. 6 # 7 8 include $(TOPDIR)/rules.mk 9 10 PKG_NAME:=clamav 11 PKG_VERSION:=0.99.2 12 PKG_RELEASE:=1 13 14 PKG_LICENSE:=GPL-2.0 15 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr> \ 16 Lucian Cristian <lucian.cristian@gmail.com> 17 18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 19 PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/ 20 PKG_HASH:=167bd6a13e05ece326b968fdb539b05c2ffcfef6018a274a10aeda85c2c0027a 21 22 PKG_BUILD_PARALLEL:=1 23 PKG_INSTALL:=1 24 25 include $(INCLUDE_DIR)/uclibc++.mk 26 include $(INCLUDE_DIR)/package.mk 27 28 define Package/clamav/Default 29 SECTION:=net 30 DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libopenssl +libltdl +libpcre2 +USE_MUSL:musl-fts 31 CATEGORY:=Network 32 SUBMENU:=Web Servers/Proxies 33 TITLE:=ClamAV 34 URL:=http://www.clamav.net/ 35 endef 36 37 define Package/clamav 38 $(call Package/clamav/Default) 39 endef 40 41 define Package/freshclam 42 $(call Package/clamav/Default) 43 DEPENDS+= +clamav 44 TITLE+=database updater 45 endef 46 47 define Package/clamav/description 48 ClamAV is an open source antivirus engine for detecting trojans, 49 viruses, malware & other malicious threats. 50 endef 51 52 define Package/freshclam/description 53 Database updater for ClamAV 54 endef 55 56 define Package/clamav/conffiles 57 endef 58 59 CONFIGURE_VARS += \ 60 INCLUDES="" \ 61 CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ 62 $(if $(CONFIG_USE_MUSL),LIBS="-lpthread -lfts",LIBS="-lpthread") \ 63 64 define Build/Configure 65 $(call Build/Configure/Default, \ 66 --sysconfdir=/etc/clamav/ \ 67 --prefix=/usr/ \ 68 --exec-prefix=/usr/ \ 69 --disable-xml \ 70 --disable-bzip2 \ 71 --with-user nobody \ 72 --with-group nogroup \ 73 --with-pcre="$(STAGING_DIR)/usr/" \ 74 ) 75 endef 76 77 define Build/Compile 78 $(MAKE) -C $(PKG_BUILD_DIR) \ 79 DESTDIR="$(PKG_INSTALL_DIR)" \ 80 all install 81 endef 82 83 define Package/clamav/install 84 $(INSTALL_DIR) $(1)/usr/sbin 85 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/ 86 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/ 87 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/ 88 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/ 89 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/ 90 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/ 91 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/ 92 93 $(INSTALL_DIR) $(1)/usr/include 94 $(CP) $(PKG_INSTALL_DIR)/usr/include/clamav.h $(1)/usr/include/ 95 96 $(INSTALL_DIR) $(1)/usr/lib 97 $(CP) $(PKG_INSTALL_DIR)/usr/lib*/* $(1)/usr/lib/ 98 99 $(INSTALL_DIR) $(1)/etc/config 100 $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav 101 102 $(INSTALL_DIR) $(1)/etc/init.d/ 103 $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav 104 105 $(INSTALL_DIR) $(1)/usr/share/clamav 106 $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/ 107 endef 108 109 define Package/freshclam/install 110 $(INSTALL_DIR) $(1)/usr/sbin 111 $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/ 112 113 $(INSTALL_DIR) $(1)/etc/config 114 $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam 115 116 $(INSTALL_DIR) $(1)/etc/init.d/ 117 $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam 118 endef 119 120 $(eval $(call BuildPackage,clamav)) 121 $(eval $(call BuildPackage,freshclam))