2 # Copyright (C) 2006-2017 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
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
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/net-snmp
/Default
27 URL
:=http
://www.net-snmp.org
/
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
39 define Package
/libnetsnmp
40 $(call Package
/net-snmp
/Default
)
44 TITLE
:=Open source SNMP implementation
(libraries
)
47 define Package
/libnetsnmp
/description
48 $(call Package
/net-snmp
/Default
/description
)
50 This package contains shared libraries
, needed by other programs.
54 define Package
/snmp-mibs
55 $(call Package
/net-snmp
/Default
)
56 TITLE
:=Open source SNMP implementation
(MIB-files
)
59 define Package
/snmp-mibs
/description
60 $(call Package
/net-snmp
/Default
/description
)
62 This package contains SNMP MIB-Files.
66 define Package
/snmp-utils
67 $(call Package
/net-snmp
/Default
)
69 TITLE
:=Open source SNMP implementation
(utilities
)
72 define Package
/snmp-utils
/description
73 $(call Package
/net-snmp
/Default
/description
)
75 This package contains SNMP client utilities
:
86 $(call Package
/net-snmp
/Default
)
88 TITLE
:=Open source SNMP implementation
(daemon
)
91 define Package
/snmpd
/description
92 $(call Package
/net-snmp
/Default
/description
)
94 This package contains the SNMP agent
, dynamically linked.
98 define Package
/snmpd-static
99 $(call Package
/net-snmp
/Default
)
101 TITLE
:=Open source SNMP implementation
(daemon
)
106 SNMP_MIB_MODULES_INCLUDED
= \
131 snmpv3
/snmpMPDStats \
138 ucd-snmp
/extensible \
142 ucd-snmp
/pass_persist \
148 SNMP_MIB_MODULES_EXCLUDED
= \
157 notification-log-mib \
165 SNMP_TRANSPORTS_INCLUDED
= Callback UDP Unix
167 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPIPv6
169 TARGET_CFLAGS
+= $(FPIC
)
170 TARGET_CPPFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/libnl-tiny
173 --enable-mfd-rewrites \
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 \
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)" \
195 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
198 ac_cv_header_netlink_netlink_h
=yes \
199 netsnmp_cv_func_nl_connect_LIBS
=-lnl-tiny \
201 ifeq ($(CONFIG_IPV6
),y
)
202 SNMP_TRANSPORTS_INCLUDED
+= UDPIPv6
205 TARGET_LDFLAGS
+= -L
$(TOOLCHAIN_DIR
)/usr
/lib
208 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
209 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
210 LDFLAGS
="$(TARGET_LDFLAGS) -lm -lc" \
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
/
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
/
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
/
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
/
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
/
241 define Package
/snmpd
/conffiles
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
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
))