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.

133 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.102.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:=89fcdcc0eba329ca84d270df09d2bb89ae55f5024b0c3bddb817512fb2c907d3
  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_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. CONFIGURE_ARGS += \
  48. --sysconfdir=/etc/clamav/ \
  49. --enable-milter \
  50. --disable-bzip2 \
  51. --disable-check \
  52. --disable-clamdtop \
  53. --disable-rpath \
  54. --disable-xml \
  55. --disable-zlib-vcheck \
  56. --with-user=nobody \
  57. --with-group=nogroup \
  58. --with-libcurl="$(STAGING_DIR)/usr/" \
  59. --with-libjson="$(STAGING_DIR)/usr/" \
  60. --with-openssl="$(STAGING_DIR)/usr/" \
  61. --with-pcre="$(STAGING_DIR)/usr/" \
  62. --with-zlib="$(STAGING_DIR)/usr/" \
  63. --without-iconv \
  64. --without-libncurses-prefix
  65. CONFIGURE_VARS += \
  66. ax_cv_uname_syscall=yes \
  67. ac_cv_c_mmap_private=yes \
  68. have_cv_gai=yes \
  69. ac_cv_sys_file_offset_bits=no
  70. CONFIGURE_VARS += $(if $(CONFIG_IPV6),have_cv_ipv6=yes)
  71. TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -fno-rtti -flto
  72. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed $(if $(CONFIG_USE_MUSL),-lfts)
  73. define Package/clamav/conffiles
  74. /etc/config/clamav
  75. endef
  76. define Package/clamav/install
  77. $(INSTALL_DIR) $(1)/usr/sbin
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamav-milter $(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/clamonacc $(1)/usr/sbin/
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
  86. $(INSTALL_DIR) $(1)/usr/lib
  87. $(CP) $(PKG_INSTALL_DIR)/usr/lib*/lib*.so.* $(1)/usr/lib/
  88. $(INSTALL_DIR) $(1)/etc/config
  89. $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
  90. $(INSTALL_DIR) $(1)/etc/init.d/
  91. $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
  92. $(INSTALL_DIR) $(1)/usr/share/clamav
  93. $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
  94. endef
  95. define Package/freshclam/conffiles
  96. /etc/config/freshclam
  97. endef
  98. define Package/freshclam/install
  99. $(INSTALL_DIR) $(1)/usr/sbin
  100. $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/
  101. $(INSTALL_DIR) $(1)/etc/config
  102. $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam
  103. $(INSTALL_DIR) $(1)/etc/init.d/
  104. $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam
  105. endef
  106. $(eval $(call BuildPackage,clamav))
  107. $(eval $(call BuildPackage,freshclam))