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.

121 lines
3.2 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.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_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/
  16. PKG_HASH:=167bd6a13e05ece326b968fdb539b05c2ffcfef6018a274a10aeda85c2c0027a
  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. )
  61. endef
  62. define Build/Compile
  63. $(MAKE) -C $(PKG_BUILD_DIR) \
  64. DESTDIR="$(PKG_INSTALL_DIR)" \
  65. all install
  66. endef
  67. define Package/clamav/install
  68. $(INSTALL_DIR) $(1)/usr/sbin
  69. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
  70. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/
  71. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
  73. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
  74. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
  75. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
  76. $(INSTALL_DIR) $(1)/usr/include
  77. $(CP) $(PKG_INSTALL_DIR)/usr/include/clamav.h $(1)/usr/include/
  78. $(INSTALL_DIR) $(1)/usr/lib
  79. $(CP) $(PKG_INSTALL_DIR)/usr/lib*/* $(1)/usr/lib/
  80. $(INSTALL_DIR) $(1)/etc/config
  81. $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
  82. $(INSTALL_DIR) $(1)/etc/init.d/
  83. $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
  84. $(INSTALL_DIR) $(1)/usr/share/clamav
  85. $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
  86. endef
  87. define Package/freshclam/install
  88. $(INSTALL_DIR) $(1)/usr/sbin
  89. $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/
  90. $(INSTALL_DIR) $(1)/etc/config
  91. $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam
  92. $(INSTALL_DIR) $(1)/etc/init.d/
  93. $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam
  94. endef
  95. $(eval $(call BuildPackage,clamav))
  96. $(eval $(call BuildPackage,freshclam))