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.5 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:=3
  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. PKG_FIXUP:=autoreconf
  22. include $(INCLUDE_DIR)/uclibc++.mk
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/clamav/Default
  25. SECTION:=net
  26. DEPENDS:=$(CXX_DEPENDS) +libpthread +zlib +libcurl +libjson-c +libmilter-sendmail +libopenssl +libltdl +libpcre2 +USE_MUSL:musl-fts
  27. CATEGORY:=Network
  28. SUBMENU:=Web Servers/Proxies
  29. TITLE:=ClamAV
  30. URL:=https://www.clamav.net/
  31. endef
  32. define Package/clamav
  33. $(call Package/clamav/Default)
  34. endef
  35. define Package/freshclam
  36. $(call Package/clamav/Default)
  37. DEPENDS+= +clamav
  38. TITLE+=database updater
  39. endef
  40. define Package/clamav/description
  41. ClamAV is an open source antivirus engine for detecting trojans,
  42. viruses, malware & other malicious threats.
  43. endef
  44. define Package/freshclam/description
  45. Database updater for ClamAV
  46. endef
  47. define Package/clamav/conffiles
  48. endef
  49. CONFIGURE_ARGS += \
  50. --sysconfdir=/etc/clamav/ \
  51. --enable-milter \
  52. --disable-bzip2 \
  53. --disable-check \
  54. --disable-clamdtop \
  55. --disable-rpath \
  56. --disable-xml \
  57. --disable-zlib-vcheck \
  58. --with-user=nobody \
  59. --with-group=nogroup \
  60. --with-libcurl="$(STAGING_DIR)/usr/" \
  61. --with-libjson="$(STAGING_DIR)/usr/" \
  62. --with-openssl="$(STAGING_DIR)/usr/" \
  63. --with-pcre="$(STAGING_DIR)/usr/" \
  64. --with-zlib="$(STAGING_DIR)/usr/" \
  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/clambc $(1)/usr/sbin/
  80. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
  81. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
  82. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
  83. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
  84. $(INSTALL_DIR) $(1)/usr/lib
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib*/lib*.so.* $(1)/usr/lib/
  86. $(INSTALL_DIR) $(1)/etc/config
  87. $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
  88. $(INSTALL_DIR) $(1)/etc/init.d/
  89. $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
  90. $(INSTALL_DIR) $(1)/usr/share/clamav
  91. $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
  92. endef
  93. define Package/freshclam/install
  94. $(INSTALL_DIR) $(1)/usr/sbin
  95. $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/
  96. $(INSTALL_DIR) $(1)/etc/config
  97. $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam
  98. $(INSTALL_DIR) $(1)/etc/init.d/
  99. $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam
  100. endef
  101. $(eval $(call BuildPackage,clamav))
  102. $(eval $(call BuildPackage,freshclam))