net-snmp: improve snmp-utils description
[feed/packages.git] / net / net-snmp / Makefile
1 #
2 # Copyright (C) 2006-2017 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:=net-snmp
11 PKG_VERSION:=5.7.3
12 PKG_RELEASE:=7
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/net-snmp
16 PKG_HASH:=12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
17 PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
18 PKG_LICENSE:=MIT BSD-3-Clause-Clear
19
20 PKG_FIXUP:=autoreconf
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/net-snmp/Default
25 SECTION:=net
26 CATEGORY:=Network
27 URL:=http://www.net-snmp.org/
28 endef
29
30 define Package/net-snmp/Default/description
31 Simple Network Management Protocol (SNMP) is a widely used protocol for
32 monitoring the health and welfare of network equipment (eg. routers),
33 computer equipment and even devices like UPSs. Net-SNMP is a suite of
34 applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both
35 IPv4 and IPv6.
36 endef
37
38
39 define Package/libnetsnmp
40 $(call Package/net-snmp/Default)
41 SECTION:=libs
42 CATEGORY:=Libraries
43 DEPENDS:=+libnl-tiny
44 TITLE:=Open source SNMP implementation (libraries)
45 endef
46
47 define Package/libnetsnmp/description
48 $(call Package/net-snmp/Default/description)
49 .
50 This package contains shared libraries, needed by other programs.
51 endef
52
53
54 define Package/snmp-mibs
55 $(call Package/net-snmp/Default)
56 TITLE:=Open source SNMP implementation (MIB-files)
57 endef
58
59 define Package/snmp-mibs/description
60 $(call Package/net-snmp/Default/description)
61 .
62 This package contains SNMP MIB-Files.
63 endef
64
65
66 define Package/snmp-utils
67 $(call Package/net-snmp/Default)
68 DEPENDS:=+libnetsnmp
69 TITLE:=Open source SNMP implementation (utilities)
70 endef
71
72 define Package/snmp-utils/description
73 $(call Package/net-snmp/Default/description)
74 .
75 This package contains SNMP client utilities:
76 - snmpget
77 - snmpset
78 - snmpstatus
79 - snmptest
80 - snmptrap
81 - snmpwalk
82 endef
83
84
85 define Package/snmpd
86 $(call Package/net-snmp/Default)
87 DEPENDS:=+libnetsnmp
88 TITLE:=Open source SNMP implementation (daemon)
89 endef
90
91 define Package/snmpd/description
92 $(call Package/net-snmp/Default/description)
93 .
94 This package contains the SNMP agent, dynamically linked.
95 endef
96
97
98 define Package/snmpd-static
99 $(call Package/net-snmp/Default)
100 DEPENDS:=+snmpd
101 TITLE:=Open source SNMP implementation (daemon)
102 endef
103
104
105
106 SNMP_MIB_MODULES_INCLUDED = \
107 agent/extend \
108 agentx \
109 host/hr_device \
110 host/hr_disk \
111 host/hr_filesys \
112 host/hr_network \
113 host/hr_partition \
114 host/hr_proc \
115 host/hr_storage \
116 host/hr_system \
117 ieee802dot11 \
118 if-mib/ifXTable \
119 mibII/at \
120 mibII/icmp \
121 mibII/ifTable \
122 mibII/ip \
123 mibII/snmp_mib \
124 mibII/sysORTable \
125 mibII/system_mib \
126 mibII/tcp \
127 mibII/udp \
128 mibII/vacm_context \
129 mibII/vacm_vars \
130 snmpv3/snmpEngine \
131 snmpv3/snmpMPDStats \
132 snmpv3/usmConf \
133 snmpv3/usmStats \
134 snmpv3/usmUser \
135 tunnel \
136 ucd-snmp/disk \
137 ucd-snmp/dlmod \
138 ucd-snmp/extensible \
139 ucd-snmp/loadave \
140 ucd-snmp/memory \
141 ucd-snmp/pass \
142 ucd-snmp/pass_persist \
143 ucd-snmp/proc \
144 ucd-snmp/vmstat \
145 util_funcs \
146 utilities/execute \
147
148 SNMP_MIB_MODULES_EXCLUDED = \
149 agent_mibs \
150 disman/event \
151 disman/schedule \
152 hardware \
153 host \
154 if-mib \
155 mibII \
156 notification \
157 notification-log-mib \
158 snmpv3mibs \
159 target \
160 tcp-mib \
161 ucd_snmp \
162 udp-mib \
163 utilities \
164
165 SNMP_TRANSPORTS_INCLUDED = Callback UDP Unix
166
167 SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6
168
169 TARGET_CFLAGS += $(FPIC)
170 TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
171
172 CONFIGURE_ARGS += \
173 --enable-mfd-rewrites \
174 --enable-shared \
175 --enable-static \
176 --with-endianness=$(if $(CONFIG_BIG_ENDIAN),big,little) \
177 --with-logfile=/var/log/snmpd.log \
178 --with-persistent-directory=/usr/lib/snmp/ \
179 --with-default-snmp-version=1 \
180 --with-sys-contact=root@localhost \
181 --with-sys-location=Unknown \
182 --enable-applications \
183 --disable-debugging \
184 --disable-manuals \
185 --disable-scripts \
186 --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
187 --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
188 --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \
189 --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
190 --without-openssl \
191 --without-libwrap \
192 --without-rpm \
193 --without-zlib \
194 --with-nl \
195 $(call autoconf_bool,CONFIG_IPV6,ipv6) \
196
197 CONFIGURE_VARS += \
198 ac_cv_header_netlink_netlink_h=yes \
199 netsnmp_cv_func_nl_connect_LIBS=-lnl-tiny \
200
201 ifeq ($(CONFIG_IPV6),y)
202 SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
203 endif
204
205 TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
206
207 define Build/Compile
208 $(MAKE) -C $(PKG_BUILD_DIR) \
209 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
210 LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \
211 all install
212 endef
213
214 define Build/InstallDev
215 $(INSTALL_DIR) $(2)/bin
216 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/
217 $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config
218 $(LN) $(STAGING_DIR)/host/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
219
220 $(INSTALL_DIR) $(1)/usr/include
221 $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/
222 $(INSTALL_DIR) $(1)/usr/lib
223 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/
224 endef
225
226 define Package/libnetsnmp/install
227 $(INSTALL_DIR) $(1)/usr/lib
228 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
229 endef
230
231 define Package/snmp-mibs/install
232 $(INSTALL_DIR) $(1)/usr/share/snmp/mibs
233 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* $(1)/usr/share/snmp/mibs/
234 endef
235
236 define Package/snmp-utils/install
237 $(INSTALL_DIR) $(1)/usr/bin
238 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
239 endef
240
241 define Package/snmpd/conffiles
242 /etc/config/snmpd
243 endef
244
245 define Package/snmpd/install
246 $(INSTALL_DIR) $(1)/etc/config
247 $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
248 $(INSTALL_DIR) $(1)/etc/snmp
249 ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
250 $(INSTALL_DIR) $(1)/etc/init.d
251 $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
252 $(INSTALL_DIR) $(1)/usr/sbin
253 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
254 endef
255
256 $(eval $(call BuildPackage,libnetsnmp))
257 $(eval $(call BuildPackage,snmp-mibs))
258 $(eval $(call BuildPackage,snmp-utils))
259 $(eval $(call BuildPackage,snmpd))
260 $(eval $(call BuildPackage,snmpd-static))