2 # Copyright (C) 2006-2014 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
:=95aa054f3c99a1ce242807d7eaf98619
17 PKG_MAINTAINER
:=Jo-Philipp Wich
<jow@openwrt.org
>
18 PKG_LICENSE
:=MIT BSD-3-Clause-Clear
20 PKG_FIXUP
= patch-libtool
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-utils
55 $(call Package
/net-snmp
/Default
)
57 TITLE
:=Open source SNMP implementation
(utilities
)
60 define Package
/snmp-utils
/description
61 $(call Package
/net-snmp
/Default
/description
)
63 This package contains SNMP client utilities.
68 $(call Package
/net-snmp
/Default
)
70 TITLE
:=Open source SNMP implementation
(daemon
)
73 define Package
/snmpd
/description
74 $(call Package
/net-snmp
/Default
/description
)
76 This package contains the SNMP agent
, dynamically linked.
80 define Package
/snmpd-static
81 $(call Package
/net-snmp
/Default
)
82 TITLE
:=Open source SNMP implementation
(daemon
)
86 define Package
/snmpd-static
/description
87 $(call Package
/net-snmp
/Default
/description
)
89 This package contains the SNMP agent
, statically linked.
93 SNMP_MIB_MODULES_INCLUDED
= \
116 snmpv3
/snmpMPDStats \
123 ucd-snmp
/extensible \
132 SNMP_MIB_MODULES_EXCLUDED
= \
142 notification-log-mib \
150 SNMP_TRANSPORTS_INCLUDED
= Callback UDP
152 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPIPv6 Unix
154 TARGET_CFLAGS
+= $(FPIC
)
157 --enable-mfd-rewrites \
160 --with-endianness
=$(if
$(CONFIG_BIG_ENDIAN
),big
,little
) \
161 --with-logfile
=/var
/log
/snmpd.log \
162 --with-persistent-directory
=/usr
/lib
/snmp
/ \
163 --with-default-snmp-version
=1 \
164 --with-sys-contact
=root@localhost \
165 --with-sys-location
=Unknown \
166 --enable-applications \
167 --disable-debugging \
171 --with-out-mib-modules
="$(SNMP_MIB_MODULES_EXCLUDED)" \
172 --with-mib-modules
="$(SNMP_MIB_MODULES_INCLUDED)" \
173 --with-out-transports
="$(SNMP_TRANSPORTS_EXCLUDED)" \
174 --with-transports
="$(SNMP_TRANSPORTS_INCLUDED)" \
179 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
181 ifeq ($(CONFIG_IPV6
),y
)
182 SNMP_TRANSPORTS_INCLUDED
+= UDPIPv6
185 TARGET_LDFLAGS
+= -L
$(TOOLCHAIN_DIR
)/usr
/lib
187 ifdef CONFIG_PACKAGE_snmpd-static
188 define Build
/Compile
/static
189 $(MAKE
) -C
$(PKG_BUILD_DIR
)/agent \
190 LDFLAGS
="$(TARGET_LDFLAGS) -lm -static" \
197 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
198 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
199 LDFLAGS
="$(TARGET_LDFLAGS) -lm -lc" \
201 $(Build
/Compile
/static
)
204 define Build
/InstallDev
205 $(INSTALL_DIR
) $(2)/bin
206 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/net-snmp-config
$(2)/bin
/
207 $(SED
) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin
/net-snmp-config
209 $(INSTALL_DIR
) $(1)/usr
/include
210 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/net-snmp
$(1)/usr
/include/
211 $(INSTALL_DIR
) $(1)/usr
/lib
212 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*} $(1)/usr
/lib
/
215 define Package
/libnetsnmp
/install
216 $(INSTALL_DIR
) $(1)/usr
/lib
217 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.so.
* $(1)/usr
/lib
/
220 define Package
/snmpd
/conffiles
225 define Package
/snmpd
/install
226 $(INSTALL_DIR
) $(1)/etc
/config
227 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
228 $(INSTALL_DIR
) $(1)/etc
/snmp
229 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
230 $(INSTALL_DIR
) $(1)/etc
/default
231 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
232 $(INSTALL_DIR
) $(1)/etc
/init.d
233 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
234 $(INSTALL_DIR
) $(1)/usr
/sbin
235 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd
$(1)/usr
/sbin
/snmpd
238 define Package
/snmpd-static
/conffiles
243 define Package
/snmpd-static
/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
/default
249 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
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_BUILD_DIR
)/agent
/snmpd-static
$(1)/usr
/sbin
/snmpd
256 define Package
/snmp-utils
/install
257 $(INSTALL_DIR
) $(1)/usr
/bin
258 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/snmp
{get,set
,status
,test,trap
,walk
} $(1)/usr
/bin
/
261 $(eval
$(call BuildPackage
,libnetsnmp
))
262 $(eval
$(call BuildPackage
,snmp-utils
))
263 $(eval
$(call BuildPackage
,snmpd
))
264 $(eval
$(call BuildPackage
,snmpd-static
))