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_MD5SUM
:=d4a3459e1577d0efa8d96ca70a885e53
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.
80 $(call Package
/net-snmp
/Default
)
82 TITLE
:=Open source SNMP implementation
(daemon
)
85 define Package
/snmpd
/description
86 $(call Package
/net-snmp
/Default
/description
)
88 This package contains the SNMP agent
, dynamically linked.
92 define Package
/snmpd-static
93 $(call Package
/net-snmp
/Default
)
95 TITLE
:=Open source SNMP implementation
(daemon
)
100 SNMP_MIB_MODULES_INCLUDED
= \
125 snmpv3
/snmpMPDStats \
132 ucd-snmp
/extensible \
136 ucd-snmp
/pass_persist \
142 SNMP_MIB_MODULES_EXCLUDED
= \
151 notification-log-mib \
159 SNMP_TRANSPORTS_INCLUDED
= Callback UDP Unix
161 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPIPv6
163 TARGET_CFLAGS
+= $(FPIC
)
164 TARGET_CPPFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/libnl-tiny
167 --enable-mfd-rewrites \
170 --with-endianness
=$(if
$(CONFIG_BIG_ENDIAN
),big
,little
) \
171 --with-logfile
=/var
/log
/snmpd.log \
172 --with-persistent-directory
=/usr
/lib
/snmp
/ \
173 --with-default-snmp-version
=1 \
174 --with-sys-contact
=root@localhost \
175 --with-sys-location
=Unknown \
176 --enable-applications \
177 --disable-debugging \
180 --with-out-mib-modules
="$(SNMP_MIB_MODULES_EXCLUDED)" \
181 --with-mib-modules
="$(SNMP_MIB_MODULES_INCLUDED)" \
182 --with-out-transports
="$(SNMP_TRANSPORTS_EXCLUDED)" \
183 --with-transports
="$(SNMP_TRANSPORTS_INCLUDED)" \
189 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
192 ac_cv_header_netlink_netlink_h
=yes \
193 netsnmp_cv_func_nl_connect_LIBS
=-lnl-tiny \
195 ifeq ($(CONFIG_IPV6
),y
)
196 SNMP_TRANSPORTS_INCLUDED
+= UDPIPv6
199 TARGET_LDFLAGS
+= -L
$(TOOLCHAIN_DIR
)/usr
/lib
202 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
203 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
204 LDFLAGS
="$(TARGET_LDFLAGS) -lm -lc" \
208 define Build
/InstallDev
209 $(INSTALL_DIR
) $(2)/bin
210 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/net-snmp-config
$(2)/bin
/
211 $(SED
) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin
/net-snmp-config
213 $(INSTALL_DIR
) $(1)/usr
/include
214 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/net-snmp
$(1)/usr
/include/
215 $(INSTALL_DIR
) $(1)/usr
/lib
216 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*} $(1)/usr
/lib
/
219 define Package
/libnetsnmp
/install
220 $(INSTALL_DIR
) $(1)/usr
/lib
221 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.so.
* $(1)/usr
/lib
/
224 define Package
/snmp-mibs
/install
225 $(INSTALL_DIR
) $(1)/usr
/share
/snmp
/mibs
226 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/share
/snmp
/mibs
/* $(1)/usr
/share
/snmp
/mibs
/
229 define Package
/snmp-utils
/install
230 $(INSTALL_DIR
) $(1)/usr
/bin
231 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/snmp
{get,set
,status
,test,trap
,walk
} $(1)/usr
/bin
/
234 define Package
/snmpd
/conffiles
238 define Package
/snmpd
/install
239 $(INSTALL_DIR
) $(1)/etc
/config
240 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
241 $(INSTALL_DIR
) $(1)/etc
/snmp
242 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
243 $(INSTALL_DIR
) $(1)/etc
/init.d
244 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
245 $(INSTALL_DIR
) $(1)/usr
/sbin
246 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd
$(1)/usr
/sbin
/snmpd
249 $(eval
$(call BuildPackage
,libnetsnmp
))
250 $(eval
$(call BuildPackage
,snmp-mibs
))
251 $(eval
$(call BuildPackage
,snmp-utils
))
252 $(eval
$(call BuildPackage
,snmpd
))
253 $(eval
$(call BuildPackage
,snmpd-static
))