You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.7 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=clamav
  9. PKG_VERSION:=0.104.2
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/
  13. PKG_HASH:=3e45e46d9aaeb3a6956ed30376237ab7c4cd9573bc0f5d6fc15c588d30978d9d
  14. PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr> \
  15. Lucian Cristian <lucian.cristian@gmail.com>
  16. PKG_LICENSE:=GPL-2.0-only
  17. PKG_LICENSE_FILES:=COPYING*
  18. PKG_CPE_ID:=cpe:/a:clamav:clamav
  19. PKG_BUILD_DEPENDS:=ncurses
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/nls.mk
  22. include $(INCLUDE_DIR)/cmake.mk
  23. define Package/clamav/Default
  24. SECTION:=net
  25. DEPENDS:=+check +libstdcpp +libpthread +zlib +libbz2 +libxml2 +libcurl +libjson-c +libmilter-sendmail +libopenssl +libltdl +libpcre2 $(ICONV_DEPENDS)
  26. CATEGORY:=Network
  27. SUBMENU:=Web Servers/Proxies
  28. TITLE:=ClamAV
  29. URL:=https://www.clamav.net/
  30. endef
  31. define Package/clamav
  32. $(call Package/clamav/Default)
  33. endef
  34. define Package/freshclam
  35. $(call Package/clamav/Default)
  36. DEPENDS+= +clamav
  37. TITLE+=database updater
  38. endef
  39. define Package/clamav/description
  40. ClamAV is an open source antivirus engine for detecting trojans,
  41. viruses, malware & other malicious threats.
  42. endef
  43. define Package/freshclam/description
  44. Database updater for ClamAV
  45. endef
  46. CMAKE_OPTIONS += \
  47. -DENABLE_MILTER=ON \
  48. -DHAVE_ATTRIB_PACKED=ON \
  49. -DHAVE_ATTRIB_ALIGNED=ON \
  50. -Dtest_run_result=ON \
  51. -Dtest_run_result__TRYRUN_OUTPUT=ON \
  52. -DCLAMAV_USER=nobody \
  53. -DCLAMAV_GROUP=nogroup \
  54. -DMMAP_FOR_CROSSCOMPILING=ON \
  55. -DENABLE_CLAMONACC=ON \
  56. -DENABLE_DOCS=OFF \
  57. -DENABLE_DOXYGEN=OFF \
  58. -DENABLE_EXAMPLES=OFF \
  59. -DENABLE_UNRAR=OFF \
  60. -DENABLE_SYSTEMD=OFF \
  61. -DIconv_INCLUDE_DIR=$(ICONV_PREFIX)/include \
  62. -DIconv_LIBRARY=$(ICONV_PREFIX)/lib/libiconv.$(if $(ICONV_FULL),so,a) \
  63. -DHAVE_SYSTEM_LFS_FTS=O$(if $(CONFIG_USE_GLIBC),N,FF)
  64. TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -fno-rtti -flto
  65. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  66. define Package/clamav/conffiles
  67. /etc/config/clamav
  68. /etc/config/clamav-milter
  69. endef
  70. define Package/clamav/install
  71. $(INSTALL_DIR) $(1)/usr/sbin
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
  73. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamav-milter $(1)/usr/sbin/
  74. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
  75. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamonacc $(1)/usr/sbin/
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib*/lib*.so.* $(1)/usr/lib/
  82. $(INSTALL_DIR) $(1)/etc/config
  83. $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
  84. $(INSTALL_CONF) ./files/clamav-milter.config $(1)/etc/config/clamav-milter
  85. $(INSTALL_DIR) $(1)/etc/init.d/
  86. $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
  87. $(INSTALL_BIN) ./files/clamav-milter.init $(1)/etc/init.d/clamav-milter
  88. $(INSTALL_DIR) $(1)/usr/share/clamav
  89. $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
  90. endef
  91. define Package/freshclam/conffiles
  92. /etc/config/freshclam
  93. endef
  94. define Package/freshclam/install
  95. $(INSTALL_DIR) $(1)/usr/sbin
  96. $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/
  97. $(INSTALL_DIR) $(1)/etc/config
  98. $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam
  99. $(INSTALL_DIR) $(1)/etc/init.d/
  100. $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam
  101. endef
  102. $(eval $(call BuildPackage,clamav))
  103. $(eval $(call BuildPackage,freshclam))