2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/net-snmp
18 PKG_MD5SUM:=8080555ab3f90011f25d5122042d9a8d
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23 include $(INCLUDE_DIR)/package.mk
25 define Package/libnetsnmp
29 TITLE:=Open source SNMP implementation (librairies)
30 DESCRIPTION:=Open source SNMP (Simple Network Management Protocol) implementation (libraries).\\\
31 Simple Network Management Protocol (SNMP) is a widely used \\\
32 protocol for monitoring the health and welfare of network \\\
33 equipment (eg. routers), computer equipment and even devices \\\
34 like UPSs. Net-SNMP is a suite of applications used to implement \\\
35 SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.\\\
37 This package contains shared libraries, needed by other programs.
38 URL:=http://www.net-snmp.org/
41 define Package/snmp-utils
45 TITLE:=Open source SNMP implementation (utilities)
46 DESCRIPTION:=Open source SNMP (Simple Network Management Protocol) implementation (utilities).\\\
47 Simple Network Management Protocol (SNMP) is a widely used \\\
48 protocol for monitoring the health and welfare of network \\\
49 equipment (eg. routers), computer equipment and even devices \\\
50 like UPSs. Net-SNMP is a suite of applications used to implement \\\
51 SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.\\\
53 This package contains SNMP client utilities.
54 URL:=http://www.net-snmp.org/
61 TITLE:=Open source SNMP implementation (daemon)
62 DESCRIPTION:=Open source SNMP (Simple Network Management Protocol) implementation (daemon).\\\
63 Simple Network Management Protocol (SNMP) is a widely used \\\
64 protocol for monitoring the health and welfare of network \\\
65 equipment (eg. routers), computer equipment and even devices \\\
66 like UPSs. Net-SNMP is a suite of applications used to implement \\\
67 SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.\\\
69 This package contains the SNMP agent, dynamically linked.
70 URL:=http://www.net-snmp.org/
73 define Package/snmpd/conffiles
78 define Package/snmpd-static
81 TITLE:=Open source SNMP implementation (daemon)
82 DESCRIPTION:=Open source SNMP (Simple Network Management Protocol) implementation (daemon).\\\
83 Simple Network Management Protocol (SNMP) is a widely used \\\
84 protocol for monitoring the health and welfare of network \\\
85 equipment (eg. routers), computer equipment and even devices \\\
86 like UPSs. Net-SNMP is a suite of applications used to implement \\\
87 SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.\\\
89 This package contains the SNMP agent, statically linked.
90 URL:=http://www.net-snmp.org/
93 define Package/snmpd-static/conffiles
98 SNMP_MIB_MODULES_INCLUDED = \
119 snmpv3/snmpMPDStats \
126 ucd-snmp/extensible \
135 SNMP_MIB_MODULES_EXCLUDED = \
147 SNMP_TRANSPORTS_INCLUDED = Callback UDP
149 SNMP_TRANSPORTS_EXCLUDED = TCP TCPv6 UDPv6 Unix
151 PKG_CONFIGURE_OPTIONS = \
154 --with-endianness=little \
155 --with-logfile=/var/log/snmpd.log \
156 --with-persistent-directory=/usr/lib/snmp/ \
157 --with-default-snmp-version=1 \
158 --with-sys-contact=root@localhost \
159 --with-sys-location=Unknown \
160 --enable-applications \
161 --disable-debugging \
164 --disable-mib-loading \
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)" \
171 --without-opaque-special-types \
177 define Build/Configure
178 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
179 $(TARGET_CONFIGURE_OPTS) \
180 CFLAGS="$(TARGET_CFLAGS)" \
181 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
182 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
183 ac_cv_header_pcap_h=no \
185 --target=$(GNU_TARGET_NAME) \
186 --host=$(GNU_TARGET_NAME) \
187 --build=$(GNU_HOST_NAME) \
188 --program-prefix="" \
189 --program-suffix="" \
193 --datadir=/usr/share \
194 --includedir=/usr/include \
195 --infodir=/usr/share/info \
197 --libexecdir=/usr/lib \
198 --localstatedir=/var \
199 --mandir=/usr/share/man \
200 --sbindir=/usr/sbin \
202 $(DISABLE_LARGEFILE) \
204 $(PKG_CONFIGURE_OPTIONS) \
209 rm -rf $(PKG_INSTALL_DIR)
210 mkdir -p $(PKG_INSTALL_DIR)
211 $(MAKE) -C $(PKG_BUILD_DIR) \
212 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
214 ( cd $(PKG_INSTALL_DIR); mv ./usr/sbin/snmpd ./usr/sbin/snmpd-shared; )
215 #ifneq ($(CONFIG_PACKAGE_snmpd-static),)
216 ( cd $(PKG_BUILD_DIR); rm -f agent/snmpd; )
217 $(MAKE) -C $(PKG_BUILD_DIR) \
218 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -static" \
219 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
221 ( cd $(PKG_INSTALL_DIR); mv ./usr/sbin/snmpd ./usr/sbin/snmpd-static; )
225 define Package/libnetsnmp/install
226 $(INSTALL_DIR) $(1)/usr/lib
227 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
230 define Package/snmpd/install
231 $(INSTALL_DIR) $(1)/etc/snmp
232 $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/snmp/snmpd.conf
233 $(INSTALL_DIR) $(1)/etc/default
234 $(INSTALL_DATA) ./files/snmpd.default $(1)/etc/default/snmpd
235 $(INSTALL_DIR) $(1)/etc/init.d
236 $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
237 $(INSTALL_DIR) $(1)/usr/sbin
238 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd-shared $(1)/usr/sbin/snmpd
241 define Package/snmpd-static/install
242 $(INSTALL_DIR) $(1)/etc/snmp
243 $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/snmp/snmpd.conf
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_INSTALL_DIR)/usr/sbin/snmpd-static $(1)/usr/sbin/snmpd
252 define Package/snmp-utils/install
253 $(INSTALL_DIR) $(1)/usr/bin
254 $(CP) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
257 define Build/InstallDev
258 mkdir -p $(STAGING_DIR)/usr/bin
259 $(CP) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
260 mkdir -p $(STAGING_DIR)/usr/include
261 $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(STAGING_DIR)/usr/include/
262 mkdir -p $(STAGING_DIR)/usr/lib
263 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(STAGING_DIR)/usr/lib/
266 define Build/UninstallDev
268 $(STAGING_DIR)/usr/bin/net-snmp-config \
269 $(STAGING_DIR)/usr/include/net-snmp \
270 $(STAGING_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*}
273 $(eval $(call BuildPackage,libnetsnmp))
274 $(eval $(call BuildPackage,snmp-utils))
275 $(eval $(call BuildPackage,snmpd))
276 $(eval $(call BuildPackage,snmpd-static))