2003-06-04 22:45:47 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# netsnmp
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-07-11 16:06:06 +02:00
|
|
|
NETSNMP_VERSION:=5.1.2
|
|
|
|
NETSNMP_PATCH_VERSION:=6.2
|
2005-06-09 14:15:00 +02:00
|
|
|
NETSNMP_URL:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp/
|
2007-07-11 16:06:06 +02:00
|
|
|
NETSNMP_DIR:=$(BUILD_DIR)/net-snmp-$(NETSNMP_VERSION)
|
|
|
|
NETSNMP_SOURCE:=net-snmp-$(NETSNMP_VERSION).tar.gz
|
|
|
|
NETSNMP_PATCH1:=net-snmp_$(NETSNMP_VERSION)-$(NETSNMP_PATCH_VERSION).diff.gz
|
2003-06-04 22:45:47 +02:00
|
|
|
NETSNMP_PATCH1_URL:=http://ftp.debian.org/debian/pool/main/n/net-snmp/
|
|
|
|
|
|
|
|
$(DL_DIR)/$(NETSNMP_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(NETSNMP_URL)/$(NETSNMP_SOURCE)
|
|
|
|
|
|
|
|
$(DL_DIR)/$(NETSNMP_PATCH1):
|
|
|
|
$(WGET) -P $(DL_DIR) $(NETSNMP_PATCH1_URL)/$(NETSNMP_PATCH1)
|
|
|
|
|
|
|
|
$(NETSNMP_DIR)/.unpacked: $(DL_DIR)/$(NETSNMP_SOURCE) $(DL_DIR)/$(NETSNMP_PATCH1)
|
2006-10-01 17:17:52 +02:00
|
|
|
$(ZCAT) $(DL_DIR)/$(NETSNMP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
|
|
|
$(ZCAT) $(DL_DIR)/$(NETSNMP_PATCH1) | patch -p1 -d $(NETSNMP_DIR)
|
2007-07-17 14:02:44 +02:00
|
|
|
toolchain/patch-kernel.sh $(NETSNMP_DIR) package/netsnmp/ \*.patch
|
2005-11-24 07:53:24 +01:00
|
|
|
touch $(NETSNMP_DIR)/.unpacked
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2007-04-20 13:12:50 +02:00
|
|
|
ifeq ($(BR2_ENDIAN),"BIG")
|
|
|
|
NETSNMP_ENDIAN=big
|
|
|
|
else
|
|
|
|
NETSNMP_ENDIAN=little
|
|
|
|
endif
|
|
|
|
|
2003-06-04 22:45:47 +02:00
|
|
|
# We set CAN_USE_SYSCTL to no and use /proc since the
|
|
|
|
# sysctl code in this thing is apparently intended for
|
|
|
|
# freebsd or some such thing...
|
|
|
|
$(NETSNMP_DIR)/.configured: $(NETSNMP_DIR)/.unpacked
|
2007-09-25 14:34:09 +02:00
|
|
|
(cd $(NETSNMP_DIR); rm -f config.cache; \
|
|
|
|
autoconf && \
|
2003-06-04 22:45:47 +02:00
|
|
|
ac_cv_CAN_USE_SYSCTL=no \
|
2007-06-25 17:07:25 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-06-27 14:01:27 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2003-06-04 22:45:47 +02:00
|
|
|
./configure \
|
|
|
|
--with-cc=$(TARGET_CROSS)gcc \
|
|
|
|
--with-ar=$(TARGET_CROSS)ar \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
2007-04-20 13:12:50 +02:00
|
|
|
--with-endianness=$(NETSNMP_ENDIAN) \
|
2003-06-04 22:45:47 +02:00
|
|
|
--with-persistent-directory=/var/lib/snmp \
|
|
|
|
--enable-ucd-snmp-compatibility \
|
|
|
|
--enable-shared \
|
|
|
|
--disable-static \
|
|
|
|
--with-logfile=none \
|
|
|
|
--without-rpm \
|
|
|
|
--with-openssl \
|
|
|
|
--without-dmalloc \
|
|
|
|
--without-efence \
|
|
|
|
--without-rsaref \
|
|
|
|
--with-sys-contact="root" \
|
|
|
|
--with-sys-location="Unknown" \
|
|
|
|
--with-mib-modules="host smux ucd-snmp/dlmod" \
|
|
|
|
--with-defaults \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2005-11-24 07:53:24 +01:00
|
|
|
touch $(NETSNMP_DIR)/.configured
|
2003-06-04 22:45:47 +02:00
|
|
|
|
|
|
|
$(NETSNMP_DIR)/agent/snmpd: $(NETSNMP_DIR)/.configured
|
2006-12-20 18:46:00 +01:00
|
|
|
$(MAKE1) -C $(NETSNMP_DIR)
|
2003-06-04 22:45:47 +02:00
|
|
|
|
|
|
|
$(TARGET_DIR)/usr/sbin/snmpd: $(NETSNMP_DIR)/agent/snmpd
|
|
|
|
$(MAKE) PREFIX=$(TARGET_DIR)/usr \
|
|
|
|
prefix=$(TARGET_DIR)/usr \
|
|
|
|
exec_prefix=$(TARGET_DIR)/usr \
|
|
|
|
persistentdir=$(TARGET_DIR)/var/lib/snmp \
|
|
|
|
infodir=$(TARGET_DIR)/usr/info \
|
|
|
|
mandir=$(TARGET_DIR)/usr/man \
|
2007-06-25 17:07:25 +02:00
|
|
|
includedir=$(STAGING_DIR)/usr/include/net-snmp \
|
|
|
|
ucdincludedir=$(STAGING_DIR)/usr/include/ucd-snmp \
|
2007-08-21 21:20:18 +02:00
|
|
|
-C $(NETSNMP_DIR) install
|
2003-06-04 22:45:47 +02:00
|
|
|
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
|
|
|
|
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
|
|
|
|
# Copy the .conf files.
|
|
|
|
mkdir -p $(TARGET_DIR)/etc/snmp
|
|
|
|
cp $(NETSNMP_DIR)/EXAMPLE.conf $(TARGET_DIR)/etc/snmp/snmpd.conf
|
|
|
|
cp $(NETSNMP_DIR)/EXAMPLE-trap.conf $(TARGET_DIR)/etc/snmp/snmptrapd.conf
|
|
|
|
-mv $(TARGET_DIR)/usr/share/snmp/mib2c*.conf $(TARGET_DIR)/etc/snmp
|
|
|
|
mkdir -p $(TARGET_DIR)/etc/default
|
|
|
|
cp $(NETSNMP_DIR)/debian/snmpd.default $(TARGET_DIR)/etc/default/snmpd
|
|
|
|
# Remove the unsupported snmpcheck program
|
|
|
|
rm $(TARGET_DIR)/usr/bin/snmpcheck
|
2003-06-04 23:01:33 +02:00
|
|
|
# Install the "broken" headers
|
2007-06-25 17:07:25 +02:00
|
|
|
cp $(NETSNMP_DIR)/agent/mibgroup/struct.h $(STAGING_DIR)/usr/include/net-snmp/agent
|
|
|
|
cp $(NETSNMP_DIR)/agent/mibgroup/util_funcs.h $(STAGING_DIR)/usr/include/net-snmp
|
|
|
|
cp $(NETSNMP_DIR)/agent/mibgroup/mibincl.h $(STAGING_DIR)/usr/include/net-snmp/library
|
|
|
|
cp $(NETSNMP_DIR)/agent/mibgroup/header_complex.h $(STAGING_DIR)/usr/include/net-snmp/agent
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2004-10-14 11:39:25 +02:00
|
|
|
netsnmp: openssl $(TARGET_DIR)/usr/sbin/snmpd
|
2003-06-04 22:45:47 +02:00
|
|
|
|
|
|
|
netsnmp-headers: $(TARGET_DIR)/usr/include/net-snmp/net-snmp-config.h
|
2007-06-25 17:07:25 +02:00
|
|
|
cp -a $(STAGING_DIR)/usr/include/net-snmp $(TARGET_DIR)/usr/include/net-snmp
|
|
|
|
cp -a $(STAGING_DIR)/usr/include/ucd-snmp $(TARGET_DIR)/usr/include/net-snmp
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2003-11-12 10:31:12 +01:00
|
|
|
netsnmp-source: $(DL_DIR)/$(NETSNMP_SOURCE)
|
|
|
|
|
2007-08-22 14:35:41 +02:00
|
|
|
netsnmp-clean:
|
2007-06-28 16:07:13 +02:00
|
|
|
$(MAKE) PREFIX=$(TARGET_DIR) INSTALL_PREFIX=$(TARGET_DIR) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NETSNMP_DIR) uninstall
|
2003-06-04 22:45:47 +02:00
|
|
|
$(MAKE) -C $(NETSNMP_DIR) clean
|
2006-12-20 18:46:00 +01:00
|
|
|
rm -rf $(TARGET_DIR)/etc/snmp/{snmpd{,trapd},mib2c*}.conf \
|
|
|
|
$(TARGET_DIR)/etc/default/snmpd \
|
|
|
|
$(TARGET_DIR)/usr/include/net-snmp
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2007-08-22 14:35:41 +02:00
|
|
|
netsnmp-dirclean:
|
2003-06-04 22:45:47 +02:00
|
|
|
rm -rf $(NETSNMP_DIR)
|
|
|
|
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_NETSNMP)),y)
|
|
|
|
TARGETS+=netsnmp
|
|
|
|
endif
|