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.4 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.1
  10. PKG_RELEASE:=2
  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:=84e026655152247de7237184ee13003701c40be030dd68e0316111049f58a59f
  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 +libjson-c +libmilter-sendmail +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. --enable-milter \
  56. --disable-xml \
  57. --disable-bzip2 \
  58. --with-user nobody \
  59. --with-group nogroup \
  60. --with-pcre="$(STAGING_DIR)/usr/" \
  61. --with-openssl="$(STAGING_DIR)/usr/" \
  62. --with-zlib="$(STAGING_DIR)/usr/" \
  63. --disable-zlib-vcheck \
  64. --disable-clamdtop \
  65. )
  66. endef
  67. define Build/Compile
  68. $(MAKE) -C $(PKG_BUILD_DIR) \
  69. DESTDIR="$(PKG_INSTALL_DIR)" \
  70. all install
  71. endef
  72. define Package/clamav/install
  73. $(INSTALL_DIR) $(1)/usr/sbin
  74. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
  75. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamav-milter $(1)/usr/sbin/
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
  80. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
  81. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
  82. $(INSTALL_DIR) $(1)/usr/include
  83. $(CP) $(PKG_INSTALL_DIR)/usr/include/clamav.h $(1)/usr/include/
  84. $(INSTALL_DIR) $(1)/usr/lib
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib*/* $(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))