components/bind/Makefile
author Stacey Marshall <Stacey.Marshall@Oracle.COM>
Tue, 29 Mar 2016 09:21:13 +0100
changeset 5669 4935ae25fd04
parent 5668 d5f739f94514
child 5682 94c0ca64c022
permissions -rw-r--r--
22894908 BIND should be built with gssapi support

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
#
include ../../make-rules/shared-macros.mk

COMPONENT_NAME=		bind
COMPONENT_VERSION=	9.6-ESV-R11
HUMAN_VERSION=		$(COMPONENT_VERSION)-P6
IPS_COMPONENT_VERSION=	9.6.3.11.6
COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
COMPONENT_PROJECT_URL=	http://www.isc.org/software/bind/

# hash from: sha256sum $(COMPONENT_ARCHIVE) | sed 's/\(.[^ ]*\).*/sha256:\1/'
COMPONENT_ARCHIVE_HASH=	 \
    sha256:4f052195a62218c05a05033774452e6a9e329b865c01e594cc20a6adf11e0d0f
COMPONENT_ARCHIVE_URL=	\
	http://ftp.isc.org/isc/bind9/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
COMPONENT_BUGDB=	service/dns-server

TPNO=			25905

include $(WS_MAKE_RULES)/prep.mk
include $(WS_MAKE_RULES)/configure.mk
include $(WS_MAKE_RULES)/ips.mk

# Specify "configure" options and features.
# FYI, The configure options are displayed by 'named -V'.
CONFIGURE_OPTIONS +=	--enable-full-report
# - Build dynamic libraries, static libraries are not shipped.
CONFIGURE_OPTIONS +=	--with-libtool
# - Use openssl, but don't check version as that is also delivered dynamically.
CONFIGURE_OPTIONS +=	--with-openssl
CONFIGURE_OPTIONS +=	--disable-openssl-version-check
CONFIGURE_OPTIONS +=	--with-pkcs11
# - Use xml2-config found uder /usr without checking its version.
CONFIGURE_OPTIONS +=	--with-libxml2=/usr
CONFIGURE_OPTIONS +=	--enable-threads=yes
CONFIGURE_OPTIONS +=	--enable-devpoll=yes
# - Enabled fixed [order] resource-record sets for backward compatibility.
# - Requires more memory to store the sets so is not the default.
CONFIGURE_OPTIONS +=	--enable-fixed-rrset

# Override / set specific pathnames:
# - DNS libraries are in usr/lib/dns - Override settings from configure.mk
CONFIGURE_LIBDIR.32 =	$(CONFIGURE_PREFIX)/lib/dns
CONFIGURE_LIBDIR.64 =	$(CONFIGURE_PREFIX)/lib/dns/$(MACH64)
# - Traditionally all BIND executables are installed in sbin not bin.
CONFIGURE_BINDIR.32 =	$(CONFIGURE_SBINDIR.32)
CONFIGURE_BINDIR.64 =	$(CONFIGURE_SBINDIR.32)
CONFIGURE_SBINDIR.64 =	$(CONFIGURE_SBINDIR.32)
CONFIGURE_OPTIONS +=	--sysconfdir=/etc
CONFIGURE_OPTIONS +=	--localstatedir=/var
CONFIGURE_OPTIONS +=	--with-randomdev=/dev/random
CONFIGURE_OPTIONS +=	--with-gssapi=/usr

# Compiler and compiler options:
# - configure will add "-mt" to CC which is already set in CFLAGS, so override.
CONFIGURE_OPTIONS +=	CC="$(CC)"
CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"

# Enable ASLR for this component
ASLR_MODE = $(ASLR_ENABLE)

# Test configuration / helper targets:
COMPONENT_TEST_MASTER = \
	$(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master

# Run BIND testing without test interfaces configured (limited testing).
COMPONENT_TEST_TARGETS = force-test

# Normalise results for comparison:
# Remove Date and time from Start and End lines.
COMPONENT_TEST_TRANSFORMS += '-e "s|\(^[SE]:[^:]*:\).*|\1|"'
# Remove task Information lines as order of that output has been seen to change.
COMPONENT_TEST_TRANSFORMS += '-e "/^I:/d"'

# Uncomment to display summary of tests at completion.
# COMPONENT_POST_TEST_ACTION = $(NAWK) $(summarize) $(COMPONENT_TEST_OUTPUT)

.PHONY: test-named-version test-summary test-clean
# summarize is a nawk script:
# consumes the output generated by ISC's make target and provides an
# abridged summary.  It works by looking for key elements:
# /^T:/ = Start of a test.
# /^I:/ = Info from a test;  collected for possible use later.
# /^A:/ = About: summary of the test - not used here.
# /^S:/ = Start: pathname and date time - not used here.
# /^E:/ = End: pathname and date time - not used here.
# /^R:/ = Result:
#         When 'PASS' and report=1 (from command line) the result and
#         test name are displayed.
#         For all other results (failures) the result, test name and
#         other collected info is displayed.
#         Known issues may be accounted for by adding tests, for example:
#           /^R:UNTESTED/ && name ~ /^T:dst:2:A/ {known++;}\
#           /^R:UNRESOLVED/ && name ~ /^T:dst:1:A/ {known++;}\
#         Though with USERLAND automated test comparison the known
#         case is kind of obsolete now.
# @ EOF = Display count of RESULTS:
# i.e. R:PASS=124 R:UNTESTED=26 Total=150 if not 100% pass rate and
# issue is not accounted for (known) the test 'issues!' is appended to
# resulting output.
#
summarize=	'\
		/^T:/ {name=$$0;info="";}\
		/^I:/ {info=sprintf("%s%s\n", info, $$0);}\
		/^R:/ {test++; result[$$1]++;}\
		/^R:PASS/ { if (report) printf("%s: %s\n", $$1, name); next}\
		/^R:UNRESOLVED/ && name ~ /^T:dst:2:A/ {known++;}\
		/^R:/ {printf("%s: %s\n%s\n", $$1, name, info);}\
		END{for (item in result)\
				printf("%s=%d ", item, result[item]);\
			printf("(known=%d) Total=%d%s\n", known, test, \
				((result["R:PASS"] + known) < test)? \
				" issues!" : "");\
		}'

#
# COMPONENT_TEST_OUTPUT is dependent on BITS which is set depending on
# the active build target and PYTHON_VERS!, so it's overridden here too for test-summary:
test-summary: BITS=64
test-summary:
	@echo Summary of $(COMPONENT_TEST_OUTPUT)
	@$(NAWK) $(summarize) $(COMPONENT_TEST_OUTPUT)

test-named-version: install
	@if [ -e $(PROTO_DIR)$(CONFIGURE_SBINDIR.64)/named ]; then \
		echo '64bit version:'; \
		file $(PROTO_DIR)$(CONFIGURE_SBINDIR.64)/named; \
		LD_LIBRARY_PATH=$(PROTO_DIR)$(CONFIGURE_LIBDIR.64) \
			$(PROTO_DIR)$(CONFIGURE_SBINDIR.64)/named -V; \
	 else \
		echo '64bit version not found.'; \
	 fi;
	@if [ -e $(PROTO_DIR)$(CONFIGURE_SBINDIR.32)/named ]; then \
		echo '32bit version:'; \
		file $(PROTO_DIR)$(CONFIGURE_SBINDIR.32)/named; \
		LD_LIBRARY_PATH=$(PROTO_DIR)$(CONFIGURE_LIBDIR.32) \
			$(PROTO_DIR)$(CONFIGURE_SBINDIR.32)/named -V; \
	 else \
		echo '32bit version not found.'; \
	 fi;

test-clean:
	$(RM) $(TEST_32_and_64)

# Common Command line targets
.PHONY: configure build install test system-test

configure:	$(CONFIGURE_64)

build:		$(BUILD_64)

install:	$(INSTALL_64)

test:		$(TEST_64)

system-test:	$(SYSTEM_TESTS_NOT_IMPLEMENTED)

# Package dependencies
# Created by 'gmake REQUIRED_PACKAGES', manually verified.
REQUIRED_PACKAGES += library/libxml2
REQUIRED_PACKAGES += library/security/openssl
REQUIRED_PACKAGES += library/security/openssl/openssl-fips-140
REQUIRED_PACKAGES += network/dns/bind
REQUIRED_PACKAGES += service/security/kerberos-5
REQUIRED_PACKAGES += shell/ksh93
REQUIRED_PACKAGES += system/core-os
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/security/gss