2 # Copyright (C) 2006-2007 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_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@SF
/net-snmp
17 PKG_MD5SUM
:=8080555ab3f90011f25d5122042d9a8d
19 include $(INCLUDE_DIR
)/package.mk
21 define Package
/net-snmp
/Default
24 URL
:=http
://www.net-snmp.org
/
27 define Package
/net-snmp
/Default
/description
28 Simple Network Management Protocol
(SNMP
) is a widely used protocol for
29 monitoring the health and welfare of network equipment
(eg. routers
),
30 computer equipment and even devices like UPSs. Net-SNMP is a suite of
31 applications used to implement SNMP v1
, SNMP v2c and SNMP v3 using both
36 define Package
/libnetsnmp
37 $(call Package
/net-snmp
/Default
)
41 TITLE
:=Open source SNMP implementation
(librairies
)
44 define Package
/libnetsnmp
/description
45 $(call Package
/net-snmp
/Default
/description
)
47 This package contains shared libraries
, needed by other programs.
51 define Package
/snmp-utils
52 $(call Package
/net-snmp
/Default
)
54 TITLE
:=Open source SNMP implementation
(utilities
)
57 define Package
/snmp-utils
/description
58 $(call Package
/net-snmp
/Default
/description
)
60 This package contains SNMP client utilities.
65 $(call Package
/net-snmp
/Default
)
67 TITLE
:=Open source SNMP implementation
(daemon
)
70 define Package
/snmpd
/description
71 $(call Package
/net-snmp
/Default
/description
)
73 This package contains the SNMP agent
, dynamically linked.
77 define Package
/snmpd-static
78 $(call Package
/net-snmp
/Default
)
79 TITLE
:=Open source SNMP implementation
(daemon
)
82 define Package
/snmpd-static
/description
83 $(call Package
/net-snmp
/Default
/description
)
85 This package contains the SNMP agent
, statically linked.
89 SNMP_MIB_MODULES_INCLUDED
= \
110 snmpv3
/snmpMPDStats \
117 ucd-snmp
/extensible \
126 SNMP_MIB_MODULES_EXCLUDED
= \
138 SNMP_TRANSPORTS_INCLUDED
= Callback UDP
140 SNMP_TRANSPORTS_EXCLUDED
= TCP TCPv6 UDPv6 Unix
145 --with-endianness
=little \
146 --with-logfile
=/var
/log
/snmpd.log \
147 --with-persistent-directory
=/usr
/lib
/snmp
/ \
148 --with-default-snmp-version
=1 \
149 --with-sys-contact
=root@localhost \
150 --with-sys-location
=Unknown \
151 --enable-applications \
152 --disable-debugging \
157 --with-out-mib-modules
="$(SNMP_MIB_MODULES_EXCLUDED)" \
158 --with-mib-modules
="$(SNMP_MIB_MODULES_INCLUDED)" \
159 --with-out-transports
="$(SNMP_TRANSPORTS_EXCLUDED)" \
160 --with-transports
="$(SNMP_TRANSPORTS_INCLUDED)" \
167 rm -rf
$(PKG_INSTALL_DIR
)
168 mkdir
-p
$(PKG_INSTALL_DIR
)
169 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
170 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
172 ( cd
$(PKG_INSTALL_DIR
); mv .
/usr
/sbin
/snmpd .
/usr
/sbin
/snmpd-shared
; )
173 #ifneq ($(CONFIG_PACKAGE_snmpd-static),)
174 ( cd
$(PKG_BUILD_DIR
); rm -f agent
/snmpd
; )
175 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
176 LDFLAGS
="$(TARGET_LDFLAGS) -static" \
177 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
179 ( cd
$(PKG_INSTALL_DIR
); mv .
/usr
/sbin
/snmpd .
/usr
/sbin
/snmpd-static
; )
183 define Build
/InstallDev
184 mkdir
-p
$(1)/usr
/bin
185 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/net-snmp-config
$(1)/usr
/bin
/
186 mkdir
-p
$(1)/usr
/include
187 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/net-snmp
$(1)/usr
/include/
188 mkdir
-p
$(1)/usr
/lib
189 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*} $(1)/usr
/lib
/
190 $(SED
) 's,-I/usr/include,,g' $(1)/usr
/bin
/net-snmp-config
191 $(SED
) 's,-L/usr/lib,,g' $(1)/usr
/bin
/net-snmp-config
194 define Build
/UninstallDev
195 rm -rf
$(STAGING_DIR
)/usr
/bin
/net-snmp-config \
196 $(STAGING_DIR
)/usr
/include/net-snmp \
197 $(STAGING_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.
{a
,so
*}
200 define Package
/libnetsnmp
/install
201 $(INSTALL_DIR
) $(1)/usr
/lib
202 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libnetsnmp
{,agent
,helpers
,mibs
}.so.
* $(1)/usr
/lib
/
205 define Package
/snmpd
/conffiles
210 define Package
/snmpd
/install
211 $(INSTALL_DIR
) $(1)/etc
/snmp
212 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/snmp
/snmpd.conf
213 $(INSTALL_DIR
) $(1)/etc
/default
214 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
215 $(INSTALL_DIR
) $(1)/etc
/init.d
216 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
217 $(INSTALL_DIR
) $(1)/usr
/sbin
218 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd-shared
$(1)/usr
/sbin
/snmpd
221 define Package
/snmpd-static
/conffiles
226 define Package
/snmpd-static
/install
227 $(INSTALL_DIR
) $(1)/etc
/snmp
228 $(INSTALL_DATA
) .
/files
/snmpd.conf
$(1)/etc
/snmp
/snmpd.conf
229 $(INSTALL_DIR
) $(1)/etc
/default
230 $(INSTALL_DATA
) .
/files
/snmpd.default
$(1)/etc
/default
/snmpd
231 $(INSTALL_DIR
) $(1)/etc
/init.d
232 $(INSTALL_BIN
) .
/files
/snmpd.init
$(1)/etc
/init.d
/snmpd
233 $(INSTALL_DIR
) $(1)/usr
/sbin
234 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/snmpd-static
$(1)/usr
/sbin
/snmpd
237 define Package
/snmp-utils
/install
238 $(INSTALL_DIR
) $(1)/usr
/bin
239 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/snmp
{get,set
,status
,test,trap
,walk
} $(1)/usr
/bin
/
242 $(eval
$(call BuildPackage
,libnetsnmp
))
243 $(eval
$(call BuildPackage
,snmp-utils
))
244 $(eval
$(call BuildPackage
,snmpd
))
245 $(eval
$(call BuildPackage
,snmpd-static
))