402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# CDDL HEADER START
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# The contents of this file are subject to the terms of the
a898afa0c41d5bdca1134dce14666fef3cfed666Andrew Forrest# Common Development and Distribution License (the "License").
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# You may not use this file except in compliance with the License.
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# See the License for the specific language governing permissions
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# and limitations under the License.
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# When distributing Covered Code, include this CDDL HEADER in each
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# If applicable, add the following below this CDDL HEADER, with the
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# fields enclosed by brackets "[]" replaced with your own identifying
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# information: Portions Copyright [yyyy] [name of copyright owner]
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# CDDL HEADER END
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCOMPONENT_PROJECT_URL= http://www.net-snmp.org/
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest sha256:0ea976722c993c87dede8eb6348e6feb059e3851bbef2de824bf18ac97cdb565
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest#COMPONENT_ARCHIVE_URL= http://ftp.ntua.gr/mirror/net-snmp/net-snmp/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCOMPONENT_ARCHIVE_URL= http://ftp.ntua.gr/mirror/net-snmp/OldFiles/net-snmp-5.4.x/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCOMPONENT_BUGDB= service/net-snmp utility/net-snmp library/net-snmp
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# After Python 2.6 goes away, the COMPONENT_POST_{CONFIGURE,INSTALL}_ACTIONs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# below can go away as well (for INSTALL_ACTION, 32-bit goes away; 64-bit
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-default-snmp-version=3
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-sys-contact="root@localhost"
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-sys-location=Unknown
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-logfile=/var/log/snmpd.log
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-persistent-directory=/var/net-snmp
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-mibdirs=/etc/net-snmp/snmp/mibs
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --enable-agentx-dom-sock-only
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --enable-ucd-snmp-compatibility
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-transports="UDP TCP UDPIPv6 TCPIPv6"
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --sysconfdir=/etc/net-snmp
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# Which MIB modules do we want to build
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestMIB_MODULES = host disman/event-mib ucd-snmp/diskio udp-mib tcp-mib if-mib
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-mib-modules="$(MIB_MODULES)"
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# Python bindings support.
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS += --with-python-modules="$(PYTHON_ARGS)"
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# Only build 32 bit Perl support
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPERL_ARGS = DESTDIR=$(PROTO_DIR) INSTALLDIRS=vendor
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS.32 += --with-perl-modules="$(PERL_ARGS)"
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS.32 += --disable-perl-cc-checks
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS.64 += --disable-embedded-perl
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCONFIGURE_OPTIONS.64 += --without-perl-modules
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest ($(CLONEY) $(SOURCE_DIR) $(@D); $(CLONEY) $(COMPONENT_DIR)/sun $(@D)/sun)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# After we have configured, make a copy of the python bits so we
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# can build separate python 2.7 support.
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCOMPONENT_POST_CONFIGURE_ACTION = (cd $(@D) ; cp -rp python python2.7)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# for the goofy definition of ARCH in the extra Makefiles
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCCSMAKE_ARGS = CC="$(CC)" CFGPREFIX=/usr CFGLIB64=/usr/lib/$(MACH64)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestCCSMAKE_ARGS += CFGLIB=/usr/lib ARCH=$(ARCH) ROOT=$(PROTO_DIR)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest (cd $(BUILD_DIR)/$(MACH32)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest (cd $(BUILD_DIR)/$(MACH64)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest$(INSTALL_32): COMPONENT_INSTALL_ARGS += PYTHON_VENDOR_PACKAGES=$(PYTHON_VENDOR_PACKAGES)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest$(INSTALL_32): COMPONENT_POST_INSTALL_ACTION= \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest ($(MKDIR) -p $(BUILD_DIR)/prototype/$(MACH)/etc/net-snmp/snmp/mibs; \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest cd $(BUILD_DIR)/$(MACH32)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS) install) ; \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest (cd $(@D)/python2.7 ; env PYTHON=$(PYTHON.2.7.$(BITS)) \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest$(INSTALL_64): COMPONENT_POST_INSTALL_ACTION= \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest ($(MKDIR) -p $(BUILD_DIR)/prototype/$(MACH64)/etc/net-snmp/snmp/mibs; \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest cd $(BUILD_DIR)/$(MACH64)/sun ; ls agent; $(CCSMAKE) -e $(CCSMAKE_ARGS) install)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# common targets
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestbuild: $(BUILD_32_and_64) $(BUILD_DIR_32)/.docs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest$(INSTALL_64): COMPONENT_INSTALL_ARGS += DESTDIR=$(BUILD_DIR)/prototype/$(MACH64)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(KSH93) ./run-tests $(BUILD_DIR) $(MACH32) $(MACH64)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# build the docs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest (cd $(@D) ; $(ENV) srcdir=$(@D) $(DOXYGEN) -u $(@D)/doxygen.conf ; \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(ENV) srcdir=$(@D) $(DOXYGEN) $(@D)/doxygen.conf)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestREQUIRED_PACKAGES += system/library/security/pkcs11