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