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.

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