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.

128 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.100.2
  10. PKG_RELEASE:=1
  11. PKG_LICENSE:=GPL-2.0
  12. PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr> \
  13. Lucian Cristian <lucian.cristian@gmail.com>
  14. PKG_CPE_ID:=cpe:/a:clamav:clamav
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/
  17. PKG_HASH:=4a2e4f0cd41e62adb5a713b4a1857c49145cd09a69957e6d946ecad575206dd6
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/uclibc++.mk
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/clamav/Default
  23. SECTION:=net
  24. DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libjson-c +libmilter-sendmail +libopenssl +libltdl +libpcre2 +USE_MUSL:musl-fts
  25. CATEGORY:=Network
  26. SUBMENU:=Web Servers/Proxies
  27. TITLE:=ClamAV
  28. URL:=https://www.clamav.net/
  29. endef
  30. define Package/clamav
  31. $(call Package/clamav/Default)
  32. endef
  33. define Package/freshclam
  34. $(call Package/clamav/Default)
  35. DEPENDS+= +clamav
  36. TITLE+=database updater
  37. endef
  38. define Package/clamav/description
  39. ClamAV is an open source antivirus engine for detecting trojans,
  40. viruses, malware & other malicious threats.
  41. endef
  42. define Package/freshclam/description
  43. Database updater for ClamAV
  44. endef
  45. define Package/clamav/conffiles
  46. endef
  47. CONFIGURE_VARS += \
  48. INCLUDES="" \
  49. CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \
  50. $(if $(CONFIG_USE_MUSL),LIBS="-lpthread -lfts",LIBS="-lpthread") \
  51. define Build/Configure
  52. $(call Build/Configure/Default, \
  53. --sysconfdir=/etc/clamav/ \
  54. --prefix=/usr/ \
  55. --exec-prefix=/usr/ \
  56. --enable-milter \
  57. --disable-xml \
  58. --disable-bzip2 \
  59. --with-user nobody \
  60. --with-group nogroup \
  61. --with-pcre="$(STAGING_DIR)/usr/" \
  62. --with-openssl="$(STAGING_DIR)/usr/" \
  63. --with-zlib="$(STAGING_DIR)/usr/" \
  64. --disable-zlib-vcheck \
  65. --disable-clamdtop \
  66. )
  67. endef
  68. define Build/Compile
  69. $(MAKE) -C $(PKG_BUILD_DIR) \
  70. DESTDIR="$(PKG_INSTALL_DIR)" \
  71. all install
  72. endef
  73. define Package/clamav/install
  74. $(INSTALL_DIR) $(1)/usr/sbin
  75. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamav-milter $(1)/usr/sbin/
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
  80. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
  81. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
  82. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
  83. $(INSTALL_DIR) $(1)/usr/include
  84. $(CP) $(PKG_INSTALL_DIR)/usr/include/clamav.h $(1)/usr/include/
  85. $(INSTALL_DIR) $(1)/usr/lib
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib*/* $(1)/usr/lib/
  87. $(INSTALL_DIR) $(1)/etc/config
  88. $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
  89. $(INSTALL_DIR) $(1)/etc/init.d/
  90. $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
  91. $(INSTALL_DIR) $(1)/usr/share/clamav
  92. $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
  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))