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
20 include $(INCLUDE_DIR
)/package.mk
22 define Package
/net-snmp
/Default
25 URL
:=http
://www.net-snmp.org
/
28 define Package
/net-snmp
/Default
/description
29 Simple Network Management Protocol
(SNMP
) is a widely used protocol for
30 monitoring the health and welfare of network equipment
(eg. routers
),
31 computer equipment and even devices like UPSs. Net-SNMP is a suite of
32 applications used to implement SNMP v1
, SNMP v2c and SNMP v3 using both
37 define Package
/libnetsnmp
38 $(call Package
/net-snmp
/Default
)
41 DEPENDS
:=+PACKAGE_libnl-core
:libnl-core
42 TITLE
:=Open source SNMP implementation
(libraries
)
45 define Package
/libnetsnmp
/description
46 $(call Package
/net-snmp
/Default
/description
)
48 This package contains shared libraries
, needed by other programs.
52 define Package
/snmp-mibs
53 $(call Package
/net-snmp
/Default
)
54 TITLE
:=Open source SNMP implementation
(MIB-files
)
57 define Package
/snmp-mibs
/description
58 $(call Package
/net-snmp
/Default
/description
)
60 This package contains SNMP MIB-Files.
64 define Package
/snmp-utils
65 $(call Package
/net-snmp
/Default
)
67 TITLE
:=Open source SNMP implementation
(utilities
)
70 define Package
/snmp-utils
/description
71 $(call Package
/net-snmp
/Default
/description
)
73 This package contains SNMP client utilities.
78 $(call Package
/net-snmp
/Default
)
80 TITLE
:=Open source SNMP implementation
(daemon
)
83 define Package
/snmpd
/description
84 $(call Package
/net-snmp
/Default
/description
)
86 This package contains the SNMP agent
, dynamically linked.
90 define Package
/snmpd-static
91 $(call Package
/net-snmp
/Default
)
92 TITLE
:=Open source SNMP implementation
(daemon
)
95 define Package
/snmpd-static
/description
96 $(call Package
/net-snmp
/Default
/description
)
98 This package contains the SNMP agent
, statically linked.
102 SNMP_MIB_MODULES_INCLUDED
= \
125 snmpv3
/snmpMPDStats \
132 ucd-snmp
/extensible \
136 ucd-snmp
/pass_persist \
142 SNMP_MIB_MODULES_EXCLUDED
= \
152 notification-log-mib \
160 SNMP_TRANSPORTS_INCLUDED
= Callback UDP
162 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPIPv6 Unix
164 TARGET_CFLAGS
+= $(FPIC
)
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)" \
188 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
190 ifeq ($(CONFIG_IPV6
),y
)
191 SNMP_TRANSPORTS_INCLUDED
+= UDPIPv6
194 TARGET_LDFLAGS
+= -L
$(TOOLCHAIN_DIR
)/usr
/lib
196 ifdef CONFIG_PACKAGE_snmpd-static
197 define Build
/Compile
/static
198 $(MAKE
) -C
$(PKG_BUILD_DIR
)/agent \
199 LDFLAGS
="$(TARGET_LDFLAGS) -lm -static" \
206 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
207 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
208 LDFLAGS
="$(TARGET_LDFLAGS) -lm -lc" \
210 $(Build
/Compile
/static
)
213 define Build
/InstallDev
214 $(INSTALL_DIR
) $(2)/bin
215 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/net-snmp-config
$(2)/bin
/
216 $(SED
) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin
/net-snmp-config
218 $(INSTALL_DIR
) $(1)/usr
/include
219 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/net-snmp
$(1)/usr
/include/
220 $(INSTALL_DIR
) $(1)/usr
/lib
221 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*} $(1)/usr
/lib
/
224 define Package
/libnetsnmp
/install
225 $(INSTALL_DIR
) $(1)/usr
/lib
226 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.so.
* $(1)/usr
/lib
/
229 define Package
/snmp-mibs
/install
230 $(INSTALL_DIR
) $(1)/usr
/share
/snmp
/mibs
231 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/share
/snmp
/mibs
/* $(1)/usr
/share
/snmp
/mibs
/
234 define Package
/snmp-utils
/install
235 $(INSTALL_DIR
) $(1)/usr
/bin
236 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/snmp
{get,set
,status
,test,trap
,walk
} $(1)/usr
/bin
/
239 define Package
/snmpd
/conffiles
243 define Package
/snmpd
/install
244 $(INSTALL_DIR
) $(1)/etc
/config
245 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
246 $(INSTALL_DIR
) $(1)/etc
/snmp
247 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
248 $(INSTALL_DIR
) $(1)/etc
/init.d
249 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
250 $(INSTALL_DIR
) $(1)/usr
/sbin
251 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd
$(1)/usr
/sbin
/snmpd
254 define Package
/snmpd-static
/conffiles
258 define Package
/snmpd-static
/install
259 $(INSTALL_DIR
) $(1)/etc
/config
260 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
261 $(INSTALL_DIR
) $(1)/etc
/snmp
262 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
263 $(INSTALL_DIR
) $(1)/etc
/init.d
264 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
265 $(INSTALL_DIR
) $(1)/usr
/sbin
266 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/agent
/snmpd-static
$(1)/usr
/sbin
/snmpd
269 $(eval
$(call BuildPackage
,libnetsnmp
))
270 $(eval
$(call BuildPackage
,snmp-mibs
))
271 $(eval
$(call BuildPackage
,snmp-utils
))
272 $(eval
$(call BuildPackage
,snmpd
))
273 $(eval
$(call BuildPackage
,snmpd-static
))