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
)
43 TITLE
:=Open source SNMP implementation
(libraries
)
46 define Package
/libnetsnmp
/description
47 $(call Package
/net-snmp
/Default
/description
)
49 This package contains shared libraries
, needed by other programs.
53 define Package
/snmp-utils
54 $(call Package
/net-snmp
/Default
)
56 TITLE
:=Open source SNMP implementation
(utilities
)
59 define Package
/snmp-utils
/description
60 $(call Package
/net-snmp
/Default
/description
)
62 This package contains SNMP client utilities.
67 $(call Package
/net-snmp
/Default
)
69 TITLE
:=Open source SNMP implementation
(daemon
)
72 define Package
/snmpd
/description
73 $(call Package
/net-snmp
/Default
/description
)
75 This package contains the SNMP agent
, dynamically linked.
79 define Package
/snmpd-static
80 $(call Package
/net-snmp
/Default
)
81 TITLE
:=Open source SNMP implementation
(daemon
)
84 define Package
/snmpd-static
/description
85 $(call Package
/net-snmp
/Default
/description
)
87 This package contains the SNMP agent
, statically linked.
91 SNMP_MIB_MODULES_INCLUDED
= \
114 snmpv3
/snmpMPDStats \
121 ucd-snmp
/extensible \
130 SNMP_MIB_MODULES_EXCLUDED
= \
140 notification-log-mib \
148 SNMP_TRANSPORTS_INCLUDED
= Callback UDP
150 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPIPv6 Unix
152 TARGET_CFLAGS
+= $(FPIC
)
155 --enable-mfd-rewrites \
158 --with-endianness
=$(if
$(CONFIG_BIG_ENDIAN
),big
,little
) \
159 --with-logfile
=/var
/log
/snmpd.log \
160 --with-persistent-directory
=/usr
/lib
/snmp
/ \
161 --with-default-snmp-version
=1 \
162 --with-sys-contact
=root@localhost \
163 --with-sys-location
=Unknown \
164 --enable-applications \
165 --disable-debugging \
169 --with-out-mib-modules
="$(SNMP_MIB_MODULES_EXCLUDED)" \
170 --with-mib-modules
="$(SNMP_MIB_MODULES_INCLUDED)" \
171 --with-out-transports
="$(SNMP_TRANSPORTS_EXCLUDED)" \
172 --with-transports
="$(SNMP_TRANSPORTS_INCLUDED)" \
177 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
179 ifeq ($(CONFIG_IPV6
),y
)
180 SNMP_TRANSPORTS_INCLUDED
+= UDPIPv6
183 TARGET_LDFLAGS
+= -L
$(TOOLCHAIN_DIR
)/usr
/lib
185 ifdef CONFIG_PACKAGE_snmpd-static
186 define Build
/Compile
/static
187 $(MAKE
) -C
$(PKG_BUILD_DIR
)/agent \
188 LDFLAGS
="$(TARGET_LDFLAGS) -lm -static" \
195 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
196 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
197 LDFLAGS
="$(TARGET_LDFLAGS) -lm -lc" \
199 $(Build
/Compile
/static
)
202 define Build
/InstallDev
203 $(INSTALL_DIR
) $(2)/bin
204 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/net-snmp-config
$(2)/bin
/
205 $(SED
) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin
/net-snmp-config
207 $(INSTALL_DIR
) $(1)/usr
/include
208 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/net-snmp
$(1)/usr
/include/
209 $(INSTALL_DIR
) $(1)/usr
/lib
210 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*} $(1)/usr
/lib
/
213 define Package
/libnetsnmp
/install
214 $(INSTALL_DIR
) $(1)/usr
/lib
215 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.so.
* $(1)/usr
/lib
/
218 define Package
/snmpd
/conffiles
223 define Package
/snmpd
/install
224 $(INSTALL_DIR
) $(1)/etc
/config
225 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
226 $(INSTALL_DIR
) $(1)/etc
/snmp
227 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
228 $(INSTALL_DIR
) $(1)/etc
/default
229 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
230 $(INSTALL_DIR
) $(1)/etc
/init.d
231 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
232 $(INSTALL_DIR
) $(1)/usr
/sbin
233 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd
$(1)/usr
/sbin
/snmpd
236 define Package
/snmpd-static
/conffiles
241 define Package
/snmpd-static
/install
242 $(INSTALL_DIR
) $(1)/etc
/config
243 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
244 $(INSTALL_DIR
) $(1)/etc
/snmp
245 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
246 $(INSTALL_DIR
) $(1)/etc
/default
247 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
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_BUILD_DIR
)/agent
/snmpd-static
$(1)/usr
/sbin
/snmpd
254 define Package
/snmp-utils
/install
255 $(INSTALL_DIR
) $(1)/usr
/bin
256 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/snmp
{get,set
,status
,test,trap
,walk
} $(1)/usr
/bin
/
259 $(eval
$(call BuildPackage
,libnetsnmp
))
260 $(eval
$(call BuildPackage
,snmp-utils
))
261 $(eval
$(call BuildPackage
,snmpd
))
262 $(eval
$(call BuildPackage
,snmpd-static
))