clamav: fix invalid zlib version error
[feed/packages.git] / net / clamav / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=clamav
11 PKG_VERSION:=0.99.2
12 PKG_RELEASE:=3
13
14 PKG_LICENSE:=GPL-2.0
15 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr> \
16 Lucian Cristian <lucian.cristian@gmail.com>
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/
20 PKG_HASH:=167bd6a13e05ece326b968fdb539b05c2ffcfef6018a274a10aeda85c2c0027a
21
22 PKG_BUILD_PARALLEL:=1
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/uclibc++.mk
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/clamav/Default
29 SECTION:=net
30 DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libopenssl +libltdl +libpcre2 +USE_MUSL:musl-fts
31 CATEGORY:=Network
32 SUBMENU:=Web Servers/Proxies
33 TITLE:=ClamAV
34 URL:=http://www.clamav.net/
35 endef
36
37 define Package/clamav
38 $(call Package/clamav/Default)
39 endef
40
41 define Package/freshclam
42 $(call Package/clamav/Default)
43 DEPENDS+= +clamav
44 TITLE+=database updater
45 endef
46
47 define Package/clamav/description
48 ClamAV is an open source antivirus engine for detecting trojans,
49 viruses, malware & other malicious threats.
50 endef
51
52 define Package/freshclam/description
53 Database updater for ClamAV
54 endef
55
56 define Package/clamav/conffiles
57 endef
58
59 CONFIGURE_VARS += \
60 INCLUDES="" \
61 CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \
62 $(if $(CONFIG_USE_MUSL),LIBS="-lpthread -lfts",LIBS="-lpthread") \
63
64 define Build/Configure
65 $(call Build/Configure/Default, \
66 --sysconfdir=/etc/clamav/ \
67 --prefix=/usr/ \
68 --exec-prefix=/usr/ \
69 --disable-xml \
70 --disable-bzip2 \
71 --with-user nobody \
72 --with-group nogroup \
73 --with-pcre="$(STAGING_DIR)/usr/" \
74 --with-openssl="$(STAGING_DIR)/usr/" \
75 --with-zlib="$(STAGING_DIR)/usr/" \
76 --disable-zlib-vcheck \
77 --disable-clamdtop \
78 )
79 endef
80
81 define Build/Compile
82 $(MAKE) -C $(PKG_BUILD_DIR) \
83 DESTDIR="$(PKG_INSTALL_DIR)" \
84 all install
85 endef
86
87 define Package/clamav/install
88 $(INSTALL_DIR) $(1)/usr/sbin
89 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
90 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/
91 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
92 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
93 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
95 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
96
97 $(INSTALL_DIR) $(1)/usr/include
98 $(CP) $(PKG_INSTALL_DIR)/usr/include/clamav.h $(1)/usr/include/
99
100 $(INSTALL_DIR) $(1)/usr/lib
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib*/* $(1)/usr/lib/
102
103 $(INSTALL_DIR) $(1)/etc/config
104 $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
105
106 $(INSTALL_DIR) $(1)/etc/init.d/
107 $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
108
109 $(INSTALL_DIR) $(1)/usr/share/clamav
110 $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
111 endef
112
113 define Package/freshclam/install
114 $(INSTALL_DIR) $(1)/usr/sbin
115 $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/
116
117 $(INSTALL_DIR) $(1)/etc/config
118 $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam
119
120 $(INSTALL_DIR) $(1)/etc/init.d/
121 $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam
122 endef
123
124 $(eval $(call BuildPackage,clamav))
125 $(eval $(call BuildPackage,freshclam))