2 # Copyright (C) 2006-2009 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
:=984932520143f0c8bf7b7ce1fc9e1da1
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
)
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-utils
53 $(call Package
/net-snmp
/Default
)
55 TITLE
:=Open source SNMP implementation
(utilities
)
58 define Package
/snmp-utils
/description
59 $(call Package
/net-snmp
/Default
/description
)
61 This package contains SNMP client utilities.
66 $(call Package
/net-snmp
/Default
)
68 TITLE
:=Open source SNMP implementation
(daemon
)
71 define Package
/snmpd
/description
72 $(call Package
/net-snmp
/Default
/description
)
74 This package contains the SNMP agent
, dynamically linked.
78 define Package
/snmpd-static
79 $(call Package
/net-snmp
/Default
)
80 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
= \
113 snmpv3
/snmpMPDStats \
119 ucd-snmp
/extensible \
128 SNMP_MIB_MODULES_EXCLUDED
= \
138 notification-log-mib \
146 SNMP_TRANSPORTS_INCLUDED
= Callback UDP
148 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPIPv6 Unix
150 TARGET_CFLAGS
+= $(FPIC
)
155 --with-endianness
=little \
156 --with-logfile
=/var
/log
/snmpd.log \
157 --with-persistent-directory
=/usr
/lib
/snmp
/ \
158 --with-default-snmp-version
=1 \
159 --with-sys-contact
=root@localhost \
160 --with-sys-location
=Unknown \
161 --enable-applications \
162 --disable-debugging \
166 --with-out-mib-modules
="$(SNMP_MIB_MODULES_EXCLUDED)" \
167 --with-mib-modules
="$(SNMP_MIB_MODULES_INCLUDED)" \
168 --with-out-transports
="$(SNMP_TRANSPORTS_EXCLUDED)" \
169 --with-transports
="$(SNMP_TRANSPORTS_INCLUDED)" \
175 ifeq ($(CONFIG_IPV6
),y
)
176 SNMP_TRANSPORTS_INCLUDED
+= UDPIPv6
177 CONFIGURE_ARGS
+= --enable-ipv6
180 TARGET_LDFLAGS
+= -L
$(TOOLCHAIN_DIR
)/usr
/lib
182 ifdef CONFIG_PACKAGE_snmpd-static
183 define Build
/Compile
/static
184 $(MAKE
) -C
$(PKG_BUILD_DIR
)/agent \
185 LDFLAGS
="$(TARGET_LDFLAGS) -lm -static" \
192 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
193 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
194 LDFLAGS
="$(TARGET_LDFLAGS) -lm -lc" \
196 $(Build
/Compile
/static
)
199 define Build
/InstallDev
200 $(INSTALL_DIR
) $(2)/bin
201 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/net-snmp-config
$(2)/bin
/
202 $(SED
) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin
/net-snmp-config
204 $(INSTALL_DIR
) $(1)/usr
/include
205 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/net-snmp
$(1)/usr
/include/
206 $(INSTALL_DIR
) $(1)/usr
/lib
207 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*} $(1)/usr
/lib
/
210 define Package
/libnetsnmp
/install
211 $(INSTALL_DIR
) $(1)/usr
/lib
212 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.so.
* $(1)/usr
/lib
/
215 define Package
/snmpd
/conffiles
220 define Package
/snmpd
/install
221 $(INSTALL_DIR
) $(1)/etc
/config
222 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
223 $(INSTALL_DIR
) $(1)/etc
/snmp
224 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
225 $(INSTALL_DIR
) $(1)/etc
/default
226 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
227 $(INSTALL_DIR
) $(1)/etc
/init.d
228 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
229 $(INSTALL_DIR
) $(1)/usr
/sbin
230 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd
$(1)/usr
/sbin
/snmpd
233 define Package
/snmpd-static
/conffiles
238 define Package
/snmpd-static
/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
/default
244 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
245 $(INSTALL_DIR
) $(1)/etc
/init.d
246 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
247 $(INSTALL_DIR
) $(1)/usr
/sbin
248 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/agent
/snmpd-static
$(1)/usr
/sbin
/snmpd
251 define Package
/snmp-utils
/install
252 $(INSTALL_DIR
) $(1)/usr
/bin
253 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/snmp
{get,set
,status
,test,trap
,walk
} $(1)/usr
/bin
/
256 $(eval
$(call BuildPackage
,libnetsnmp
))
257 $(eval
$(call BuildPackage
,snmp-utils
))
258 $(eval
$(call BuildPackage
,snmpd
))
259 $(eval
$(call BuildPackage
,snmpd-static
))