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
:=8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544
17 PKG_MAINTAINER
:=Stijn Tintel
<stijn@linux-ipv6.be
>
18 PKG_LICENSE
:=MIT BSD-3-Clause-Clear
19 PKG_CPE_ID
:=cpe
:/a
:net-snmp
:net-snmp
23 include $(INCLUDE_DIR
)/package.mk
25 define Package
/net-snmp
/Default
28 URL
:=http
://www.net-snmp.org
/
31 define Package
/net-snmp
/Default
/description
32 Simple Network Management Protocol
(SNMP
) is a widely used protocol for
33 monitoring the health and welfare of network equipment
(eg. routers
),
34 computer equipment and even devices like UPSs. Net-SNMP is a suite of
35 applications used to implement SNMP v1
, SNMP v2c and SNMP v3 using both
40 define Package
/libnetsnmp
41 $(call Package
/net-snmp
/Default
)
44 DEPENDS
:=+libnl-tiny
+libpci
+libpcre2
45 TITLE
:=Open source SNMP implementation
(libraries
)
48 define Package
/libnetsnmp
/description
49 $(call Package
/net-snmp
/Default
/description
)
51 This package contains shared libraries
, needed by other programs.
55 define Package
/snmp-mibs
56 $(call Package
/net-snmp
/Default
)
57 TITLE
:=Open source SNMP implementation
(MIB-files
)
60 define Package
/snmp-mibs
/description
61 $(call Package
/net-snmp
/Default
/description
)
63 This package contains SNMP MIB-Files.
67 define Package
/snmp-utils
68 $(call Package
/net-snmp
/Default
)
70 TITLE
:=Open source SNMP implementation
(utilities
)
73 define Package
/snmp-utils
/description
74 $(call Package
/net-snmp
/Default
/description
)
76 This package contains SNMP client utilities
:
87 $(call Package
/net-snmp
/Default
)
89 TITLE
:=Open source SNMP implementation
(daemon
)
92 define Package
/snmpd
/description
93 $(call Package
/net-snmp
/Default
/description
)
95 This package contains the SNMP agent
, dynamically linked.
99 define Package
/snmpd-static
100 $(call Package
/net-snmp
/Default
)
102 TITLE
:=Open source SNMP implementation
(daemon
)
107 define Package
/snmptrapd
108 $(call Package
/net-snmp
/Default
)
110 TITLE
:=Open source SNMP implementation
(notification receiver
)
113 define Package
/snmptrapd
/description
114 $(call Package
/net-snmp
/Default
/description
)
116 This package contains the SNMP notification receiver.
120 SNMP_MIB_MODULES_INCLUDED
= \
133 ip-mib
/inetNetToMediaTable \
146 snmpv3
/snmpMPDStats \
153 ucd-snmp
/extensible \
157 ucd-snmp
/pass_persist \
163 SNMP_MIB_MODULES_EXCLUDED
= \
173 notification-log-mib \
181 SNMP_TRANSPORTS_INCLUDED
= Callback UDP Unix
183 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPIPv6
185 TARGET_CFLAGS
+= $(FPIC
)
186 TARGET_CPPFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/libnl-tiny
189 --enable-mfd-rewrites \
192 --with-endianness
=$(if
$(CONFIG_BIG_ENDIAN
),big
,little
) \
193 --with-logfile
=/var
/log
/snmpd.log \
194 --with-persistent-directory
=/usr
/lib
/snmp
/ \
195 --with-default-snmp-version
=1 \
196 --with-sys-contact
=root@localhost \
197 --with-sys-location
=Unknown \
198 --enable-applications \
199 --disable-debugging \
202 --with-out-mib-modules
="$(SNMP_MIB_MODULES_EXCLUDED)" \
203 --with-mib-modules
="$(SNMP_MIB_MODULES_INCLUDED)" \
204 --with-out-transports
="$(SNMP_TRANSPORTS_EXCLUDED)" \
205 --with-transports
="$(SNMP_TRANSPORTS_INCLUDED)" \
213 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
214 --disable-perl-cc-checks \
215 --disable-embedded-perl \
216 --without-perl-modules
219 ac_cv_header_netlink_netlink_h
=yes \
220 netsnmp_cv_func_nl_connect_LIBS
=-lnl-tiny \
222 ifeq ($(CONFIG_IPV6
),y
)
223 SNMP_TRANSPORTS_INCLUDED
+= UDPIPv6
226 TARGET_LDFLAGS
+= -L
$(TOOLCHAIN_DIR
)/usr
/lib
229 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
230 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
231 LDFLAGS
="$(TARGET_LDFLAGS) -lm -lc" \
235 define Build
/InstallDev
236 $(INSTALL_DIR
) $(2)/bin
237 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/net-snmp-config
$(2)/bin
/
238 $(SED
) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin
/net-snmp-config
239 $(INSTALL_DIR
) $(STAGING_DIR
)/usr
/bin
240 $(LN
) $(STAGING_DIR
)/host
/bin
/net-snmp-config
$(STAGING_DIR
)/usr
/bin
/
242 $(INSTALL_DIR
) $(1)/usr
/include
243 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/net-snmp
$(1)/usr
/include/
244 $(INSTALL_DIR
) $(1)/usr
/lib
245 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*} $(1)/usr
/lib
/
248 define Package
/libnetsnmp
/install
249 $(INSTALL_DIR
) $(1)/usr
/lib
250 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.so.
* $(1)/usr
/lib
/
253 define Package
/snmp-mibs
/install
254 $(INSTALL_DIR
) $(1)/usr
/share
/snmp
/mibs
255 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/share
/snmp
/mibs
/* $(1)/usr
/share
/snmp
/mibs
/
258 define Package
/snmp-utils
/install
259 $(INSTALL_DIR
) $(1)/usr
/bin
260 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/snmp
{get,set
,status
,test,trap
,walk
} $(1)/usr
/bin
/
263 define Package
/snmpd
/conffiles
267 define Package
/snmpd
/install
268 $(INSTALL_DIR
) $(1)/etc
/config
269 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
270 $(INSTALL_DIR
) $(1)/etc
/snmp
271 $(LN
) /var
/run
/snmpd.conf
$(1)/etc
/snmp
/
272 $(INSTALL_DIR
) $(1)/etc
/init.d
273 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
274 $(INSTALL_DIR
) $(1)/usr
/sbin
275 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd
$(1)/usr
/sbin
/snmpd
278 define Package
/snmptrapd
/install
279 $(INSTALL_DIR
) $(1)/etc
/init.d
280 $(INSTALL_BIN
) .
/files
/snmptrapd.init
$(1)/etc
/init.d
/snmptrapd
281 $(INSTALL_DIR
) $(1)/usr
/lib
282 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmptrapd.so.
* $(1)/usr
/lib
/
283 $(INSTALL_DIR
) $(1)/usr
/sbin
284 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmptrapd
$(1)/usr
/sbin
/
287 $(eval
$(call BuildPackage
,libnetsnmp
))
288 $(eval
$(call BuildPackage
,snmp-mibs
))
289 $(eval
$(call BuildPackage
,snmp-utils
))
290 $(eval
$(call BuildPackage
,snmpd
))
291 $(eval
$(call BuildPackage
,snmpd-static
))
292 $(eval
$(call BuildPackage
,snmptrapd
))