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.

131 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.101.2
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/
  13. PKG_HASH:=0a12ebdf6ff7a74c0bde2bdc2b55cae33449e6dd953ec90824a9e01291277634
  14. PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr> \
  15. Lucian Cristian <lucian.cristian@gmail.com>
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_LICENSE_FILES:=COPYING*
  18. PKG_CPE_ID:=cpe:/a:clamav:clamav
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/uclibc++.mk
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/clamav/Default
  24. SECTION:=net
  25. DEPENDS:=$(CXX_DEPENDS) +libpthread +zlib +libcurl +libjson-c +libmilter-sendmail +libopenssl +libltdl +libpcre2 +USE_MUSL:musl-fts
  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. define Package/clamav/conffiles
  47. endef
  48. CONFIGURE_ARGS += \
  49. --sysconfdir=/etc/clamav/ \
  50. --enable-milter \
  51. --disable-bzip2 \
  52. --disable-check \
  53. --disable-clamdtop \
  54. --disable-rpath \
  55. --disable-xml \
  56. --disable-zlib-vcheck \
  57. --with-user=nobody \
  58. --with-group=nogroup \
  59. --with-libcurl="$(STAGING_DIR)/usr/" \
  60. --with-libjson="$(STAGING_DIR)/usr/" \
  61. --with-openssl="$(STAGING_DIR)/usr/" \
  62. --with-pcre="$(STAGING_DIR)/usr/" \
  63. --with-zlib="$(STAGING_DIR)/usr/" \
  64. --without-xml \
  65. --without-iconv \
  66. --without-libncurses-prefix
  67. CONFIGURE_VARS += \
  68. ax_cv_uname_syscall=yes \
  69. ac_cv_c_mmap_private=yes \
  70. have_cv_gai=yes \
  71. ac_cv_sys_file_offset_bits=no
  72. CONFIGURE_VARS += $(if $(CONFIG_IPV6),have_cv_ipv6=yes)
  73. TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -fno-rtti -flto
  74. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed $(if $(CONFIG_USE_MUSL),-lfts)
  75. define Package/clamav/install
  76. $(INSTALL_DIR) $(1)/usr/sbin
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamav-milter $(1)/usr/sbin/
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/
  80. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
  81. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
  82. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
  83. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
  84. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
  85. $(INSTALL_DIR) $(1)/usr/include
  86. $(CP) $(PKG_INSTALL_DIR)/usr/include/clamav.h $(1)/usr/include/
  87. $(INSTALL_DIR) $(1)/usr/lib
  88. $(CP) $(PKG_INSTALL_DIR)/usr/lib*/* $(1)/usr/lib/
  89. $(INSTALL_DIR) $(1)/etc/config
  90. $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
  91. $(INSTALL_DIR) $(1)/etc/init.d/
  92. $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
  93. $(INSTALL_DIR) $(1)/usr/share/clamav
  94. $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
  95. endef
  96. define Package/freshclam/install
  97. $(INSTALL_DIR) $(1)/usr/sbin
  98. $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/
  99. $(INSTALL_DIR) $(1)/etc/config
  100. $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam
  101. $(INSTALL_DIR) $(1)/etc/init.d/
  102. $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam
  103. endef
  104. $(eval $(call BuildPackage,clamav))
  105. $(eval $(call BuildPackage,freshclam))