]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blobdiff - package/netsnmp/netsnmp.mk
Rename BR2_PREFER_STATIC_LIB to BR2_STATIC_LIBS
[coffee/buildroot.git] / package / netsnmp / netsnmp.mk
index 05d8db74f410402f642a509cdd5ef2332a193fec..91afffe11d8cf785cea9ea404902a0eccf0ac600 100644 (file)
@@ -1,51 +1,62 @@
-#############################################################
+################################################################################
 #
 # netsnmp
 #
-#############################################################
+################################################################################
 
-NETSNMP_VERSION = 5.6.1.1
-NETSNMP_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp
+NETSNMP_VERSION = 5.7.3
+NETSNMP_SITE = http://downloads.sourceforge.net/project/net-snmp/net-snmp/$(NETSNMP_VERSION)
 NETSNMP_SOURCE = net-snmp-$(NETSNMP_VERSION).tar.gz
+NETSNMP_LICENSE = Various BSD-like
+NETSNMP_LICENSE_FILES = COPYING
 NETSNMP_INSTALL_STAGING = YES
 NETSNMP_CONF_ENV = ac_cv_NETSNMP_CAN_USE_SYSCTL=yes
-NETSNMP_CONF_OPT = --with-persistent-directory=/var/lib/snmp --disable-static \
+NETSNMP_CONF_OPTS = --with-persistent-directory=/var/lib/snmp \
                --with-defaults --enable-mini-agent --without-rpm \
                --with-logfile=none --without-kmem-usage $(DISABLE_IPV6) \
-               --enable-as-needed --disable-debugging --without-perl-modules \
+               --enable-as-needed --without-perl-modules \
                --disable-embedded-perl --disable-perl-cc-checks \
                --disable-scripts --with-default-snmp-version="1" \
                --enable-silent-libtool --enable-mfd-rewrites \
                --with-sys-contact="root@localhost" \
                --with-sys-location="Unknown" \
-               --with-mib-modules="host ucd-snmp/dlmod" \
-               --with-out-mib-modules="disman/event disman/schedule utilities" \
-               --with-out-transports="Unix"
+               --with-mib-modules="$(call qstrip,$(BR2_PACKAGE_NETSNMP_WITH_MIB_MODULES))" \
+               --with-out-mib-modules="$(call qstrip,$(BR2_PACKAGE_NETSNMP_WITHOUT_MIB_MODULES))" \
+               --with-out-transports="Unix" \
+               --disable-manuals
+NETSNMP_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) LIB_LDCONFIG_CMD=true install
+NETSNMP_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) LIB_LDCONFIG_CMD=true install
+NETSNMP_MAKE = $(MAKE1)
+NETSNMP_CONFIG_SCRIPTS = net-snmp-config
+
 NETSNMP_BLOAT_MIBS = BRIDGE DISMAN-EVENT DISMAN-SCHEDULE DISMAN-SCRIPT EtherLike RFC-1215 RFC1155-SMI RFC1213 SCTP SMUX
 
 ifeq ($(BR2_ENDIAN),"BIG")
-       NETSNMP_CONF_OPT += --with-endianness=big
+       NETSNMP_CONF_OPTS += --with-endianness=big
 else
-       NETSNMP_CONF_OPT += --with-endianness=little
+       NETSNMP_CONF_OPTS += --with-endianness=little
 endif
 
 # OpenSSL
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
        NETSNMP_DEPENDENCIES += openssl
-       NETSNMP_CONF_OPT += \
+       NETSNMP_CONF_OPTS += \
                --with-openssl=$(STAGING_DIR)/usr/include/openssl
+ifeq ($(BR2_STATIC_LIBS),y)
+       # openssl uses zlib, so we need to explicitly link with it when static
+       NETSNMP_CONF_ENV += LIBS=-lz
+endif
 else
-       NETSNMP_CONF_OPT += --without-openssl
+       NETSNMP_CONF_OPTS += --without-openssl
 endif
 
-# Docs
-ifneq ($(BR2_HAVE_DOCUMENTATION),y)
-       NETSNMP_CONF_OPT += --disable-manuals
+ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIBS),y)
+       NETSNMP_CONF_OPTS += --disable-mib-loading
+       NETSNMP_CONF_OPTS += --disable-mibs
 endif
 
-ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIBS),y)
-       NETSNMP_CONF_OPT += --disable-mib-loading
-       NETSNMP_CONF_OPT += --disable-mibs
+ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING),y)
+       NETSNMP_CONF_OPTS += --disable-debugging
 endif
 
 # Remove IPv6 MIBs if there's no IPv6
@@ -53,34 +64,29 @@ ifneq ($(BR2_INET_IPV6),y)
 define NETSNMP_REMOVE_MIBS_IPV6
        rm -f $(TARGET_DIR)/usr/share/snmp/mibs/IPV6*
 endef
+
+NETSNMP_POST_INSTALL_TARGET_HOOKS += NETSNMP_REMOVE_MIBS_IPV6
 endif
 
-define NETSNMP_INSTALL_TARGET_CMDS
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
-               DESTDIR=$(TARGET_DIR) install
-       $(INSTALL) -D -m 0755 package/netsnmp/S59snmpd \
-               $(TARGET_DIR)/etc/init.d/S59snmpd
+define NETSNMP_REMOVE_BLOAT_MIBS
        for mib in $(NETSNMP_BLOAT_MIBS); do \
                rm -f $(TARGET_DIR)/usr/share/snmp/mibs/$$mib-MIB.txt; \
        done
-       $(NETSNMP_REMOVE_MIBS_IPV6)
 endef
 
-define NETSNMP_UNINSTALL_TARGET_CMDS
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
-               DESTDIR=$(TARGET_DIR) uninstall
-       rm -f $(TARGET_DIR)/etc/init.d/S59snmpd
-       rm -f $(TARGET_DIR)/usr/lib/libnetsnmp*
+NETSNMP_POST_INSTALL_TARGET_HOOKS += NETSNMP_REMOVE_BLOAT_MIBS
+
+define NETSNMP_INSTALL_INIT_SYSV
+       $(INSTALL) -D -m 0755 package/netsnmp/S59snmpd \
+               $(TARGET_DIR)/etc/init.d/S59snmpd
 endef
 
 define NETSNMP_STAGING_NETSNMP_CONFIG_FIXUP
-       $(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" \
-               -e "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" \
-               -e "s,^includedir=.*,includedir=\'$(STAGING_DIR)/usr/include\',g" \
+       $(SED)  "s,^includedir=.*,includedir=\'$(STAGING_DIR)/usr/include\',g" \
                -e "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" \
                $(STAGING_DIR)/usr/bin/net-snmp-config
 endef
 
 NETSNMP_POST_INSTALL_STAGING_HOOKS += NETSNMP_STAGING_NETSNMP_CONFIG_FIXUP
 
-$(eval $(call AUTOTARGETS,package,netsnmp))
+$(eval $(autotools-package))