2 # Copyright (C) 2006-2010 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 \
120 ucd-snmp
/extensible \
129 SNMP_MIB_MODULES_EXCLUDED
= \
139 notification-log-mib \
147 SNMP_TRANSPORTS_INCLUDED
= Callback UDP
149 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPIPv6 Unix
151 TARGET_CFLAGS
+= $(FPIC
)
156 --with-endianness
=little \
157 --with-logfile
=/var
/log
/snmpd.log \
158 --with-persistent-directory
=/usr
/lib
/snmp
/ \
159 --with-default-snmp-version
=1 \
160 --with-sys-contact
=root@localhost \
161 --with-sys-location
=Unknown \
162 --enable-applications \
163 --disable-debugging \
167 --with-out-mib-modules
="$(SNMP_MIB_MODULES_EXCLUDED)" \
168 --with-mib-modules
="$(SNMP_MIB_MODULES_INCLUDED)" \
169 --with-out-transports
="$(SNMP_TRANSPORTS_EXCLUDED)" \
170 --with-transports
="$(SNMP_TRANSPORTS_INCLUDED)" \
176 ifeq ($(CONFIG_IPV6
),y
)
177 SNMP_TRANSPORTS_INCLUDED
+= UDPIPv6
178 CONFIGURE_ARGS
+= --enable-ipv6
181 TARGET_LDFLAGS
+= -L
$(TOOLCHAIN_DIR
)/usr
/lib
183 ifdef CONFIG_PACKAGE_snmpd-static
184 define Build
/Compile
/static
185 $(MAKE
) -C
$(PKG_BUILD_DIR
)/agent \
186 LDFLAGS
="$(TARGET_LDFLAGS) -lm -static" \
193 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
194 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
195 LDFLAGS
="$(TARGET_LDFLAGS) -lm -lc" \
197 $(Build
/Compile
/static
)
200 define Build
/InstallDev
201 $(INSTALL_DIR
) $(2)/bin
202 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/net-snmp-config
$(2)/bin
/
203 $(SED
) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin
/net-snmp-config
205 $(INSTALL_DIR
) $(1)/usr
/include
206 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/net-snmp
$(1)/usr
/include/
207 $(INSTALL_DIR
) $(1)/usr
/lib
208 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*} $(1)/usr
/lib
/
211 define Package
/libnetsnmp
/install
212 $(INSTALL_DIR
) $(1)/usr
/lib
213 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.so.
* $(1)/usr
/lib
/
216 define Package
/snmpd
/conffiles
221 define Package
/snmpd
/install
222 $(INSTALL_DIR
) $(1)/etc
/config
223 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
224 $(INSTALL_DIR
) $(1)/etc
/snmp
225 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
226 $(INSTALL_DIR
) $(1)/etc
/default
227 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
228 $(INSTALL_DIR
) $(1)/etc
/init.d
229 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
230 $(INSTALL_DIR
) $(1)/usr
/sbin
231 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd
$(1)/usr
/sbin
/snmpd
234 define Package
/snmpd-static
/conffiles
239 define Package
/snmpd-static
/install
240 $(INSTALL_DIR
) $(1)/etc
/config
241 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/config
/snmpd
242 $(INSTALL_DIR
) $(1)/etc
/snmp
243 ln
-sf
/var
/run
/snmpd.conf
$(1)/etc
/snmp
/
244 $(INSTALL_DIR
) $(1)/etc
/default
245 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
246 $(INSTALL_DIR
) $(1)/etc
/init.d
247 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
248 $(INSTALL_DIR
) $(1)/usr
/sbin
249 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/agent
/snmpd-static
$(1)/usr
/sbin
/snmpd
252 define Package
/snmp-utils
/install
253 $(INSTALL_DIR
) $(1)/usr
/bin
254 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/snmp
{get,set
,status
,test,trap
,walk
} $(1)/usr
/bin
/
257 $(eval
$(call BuildPackage
,libnetsnmp
))
258 $(eval
$(call BuildPackage
,snmp-utils
))
259 $(eval
$(call BuildPackage
,snmpd
))
260 $(eval
$(call BuildPackage
,snmpd-static
))