3649N/A#
3649N/A# CDDL HEADER START
3649N/A#
3649N/A# The contents of this file are subject to the terms of the
3649N/A# Common Development and Distribution License (the "License").
3649N/A# You may not use this file except in compliance with the License.
3649N/A#
3649N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3649N/A# or http://www.opensolaris.org/os/licensing.
3649N/A# See the License for the specific language governing permissions
3649N/A# and limitations under the License.
3649N/A#
3649N/A# When distributing Covered Code, include this CDDL HEADER in each
3649N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3649N/A# If applicable, add the following below this CDDL HEADER, with the
3649N/A# fields enclosed by brackets "[]" replaced with your own identifying
3649N/A# information: Portions Copyright [yyyy] [name of copyright owner]
3649N/A#
3649N/A# CDDL HEADER END
3649N/A#
5680N/A
5680N/A#
5590N/A# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
3649N/A#
5680N/ABUILD_BITS= 64_and_32
3649N/Ainclude ../../make-rules/shared-macros.mk
3649N/A
3649N/ACOMPONENT_NAME= sendmail
4767N/ACOMPONENT_VERSION= 8.15.2
3649N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
3649N/ACOMPONENT_PROJECT_URL= ftp://ftp.sendmail.org/pub/sendmail/
3649N/ACOMPONENT_ARCHIVE= $(COMPONENT_NAME).$(COMPONENT_VERSION).tar.gz
3649N/ACOMPONENT_ARCHIVE_HASH= \
4767N/A sha256:24f94b5fd76705f15897a78932a5f2439a32b1a2fdc35769bb1a5f5d9b4db439
3649N/ACOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
3649N/ACOMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).sig
3649N/A
4767N/ATPNO= 23958
3649N/A
7243N/A# Enable adiheap and adistack security extensions
7243N/AADIHEAP_MODE = $(ADIHEAP_ENABLE)
7243N/AADISTACK_MODE = $(ADISTACK_ENABLE)
7243N/A
5051N/A# Mostly but not completely migrated from ON in S12.
5051N/Aifeq ($(BUILD_TYPE), evaluation)
5597N/ABUILD_32_and_64=
5597N/AINSTALL_32_and_64=
5051N/APUBLISH_STAMP=
5051N/Aendif
5051N/A
5680N/ABUILD_STYLE= justmake
5680N/AINSTALL_TARGET=
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
3649N/A
3651N/A# Although we build 32_and_64, everything except libmilter just wants 64,
3651N/A# which is why the macros just below only have values for 64. libmilter
3651N/A# is dealt with further below.
3651N/APKG_PROTO_DIRS += $(BUILD_DIR_64)
3651N/APKG_PROTO_DIRS += $(BUILD_DIR_64)/obj.SunOS.$(OS_VERSION).$(ARCH)
3649N/APKG_PROTO_DIRS += $(COMPONENT_DIR)/files/man
3649N/A
3649N/A# Userland default includes -mt which links with libthread which we don't need.
3649N/Astudio_MT =
3649N/A
3649N/A# We set ARCH to match sendmail's configure-like script: on x86, it simply
3649N/A# uses 'uname -m', but on sparc it shortens "sun4*" into "sun4".
3649N/AARCH := $(shell uname -m)
3649N/Aifeq ($(findstring sun4,$(ARCH)),sun4)
3649N/AARCH = sun4
3649N/Aendif
3649N/AFILE_DIR=$(COMPONENT_DIR)/files
4767N/AM4_ARG=-D_NO_MAKEINFO_
3649N/ASM_BUILD_SUB_DIR=obj.SunOS.$(OS_VERSION).$(ARCH)
3649N/ASM_BUILD_DIR=$(@D)/$(SM_BUILD_SUB_DIR)
3649N/A
3651N/A# libmilter is built 32- and 64-bit, but its Makefile installs into a common
3651N/A# location, so we use the macro below in its manifest to distinguish between
3651N/A# the different built objects.
3651N/APKG_MACROS += LIBMILTER_BUILD_DIR=$(SM_BUILD_SUB_DIR)
3651N/A
3649N/ACLEAN_PATHS += $(FILE_DIR)/aux/mailq
3649N/A
3649N/A# This appends "+Sun" to the version string, which we do for historical
3649N/A# reasons. If we did this via patch, then we would have to revise the patch
3649N/A# with every new release, since the version string changes every time.
3649N/ACOMPONENT_PREP_ACTION = $(GSED) -i -e 's/\(Version\[\] = "8\.[^"]*\)/\1+Sun/' \
3649N/A $(COMPONENT_SRC)/sendmail/version.c
3649N/A
3649N/A# libmilter and sendmail must come before include, so appending to the default
3649N/A# value of LINT_FLAGS will not work; we must redefine it here.
4954N/ASM_DEFS= -DSOLARIS=$(shell echo $(SOLARIS_VERSION) | \
4954N/A $(GSED) -e 's/\.//' -e 's/$$/00/')
3649N/ASM_INCLUDES= -I$(SM_BUILD_DIR)/libmilter -I$(SOURCE_DIR)/sendmail \
3649N/A -I$(SOURCE_DIR)/include -I$(SOURCE_DIR) -I.
3649N/ALINT_FLAGS = -nsvx $(SM_DEFS) $(SM_INCLUDES)
3649N/ACCOPTS = -erroff=E_STATEMENT_NOT_REACHED $(CC_BITS)
3649N/A
3649N/ACOMPONENT_BUILD_ARGS += CC="$(CC)"
3649N/ACOMPONENT_BUILD_ARGS += CCOPTS="$(CCOPTS)"
3651N/ACOMPONENT_BUILD_ARGS += CCLINK="$(CC)"
3651N/ACOMPONENT_BUILD_ARGS += CC_PIC="$(CC_PIC)"
3649N/ACOMPONENT_BUILD_ARGS += LDOPTS="$(CC_BITS)"
3649N/A
5590N/A$(SOURCE_DIR)/.prep: $(SOURCE_DIR)/devtools/Site/site.config.m4
5590N/A
5590N/A# Sendmail looks for its build configuration in various per-OS config files
5590N/A# in its devtools/Site sub-dir, with site.config.m4 being the fallback. So
5590N/A# create that file as part of the 'prep' phase.
5590N/A#
5590N/A# To build debug:
5590N/A# * Uncomment the following line:
5590N/A# COMPONENT_BUILD_ENV += studio_OPT=""
5590N/A# * Uncomment the 'confOPTIMIZE' line in the recipe below, and move it
5590N/A# before the 'endef' line:
5590N/A
5590N/Adefine SITE_CONFIG_M4
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-DSUN_EXTENSIONS')
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-DVENDOR_DEFAULT=VENDOR_SUN')
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-DSUN_INIT_DOMAIN')
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-DSUN_SIMPLIFIED_LDAP')
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-DTCPWRAPPERS')
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_LOCAL_DAEMON')
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_MAIL_MACRO')
5590N/AAPPENDDEF(`conf_sendmail_ENVDEF', `-DIPV6_FULL=0')
5590N/AAPPENDDEF(`conf_sendmail_LIBS', `-lsldap')
5590N/AAPPENDDEF(`conf_sendmail_LIBS', `-lwrap')
5590N/AAPPENDDEF(`conf_sendmail_LIBS', `-lumem')
5590N/AAPPENDDEF(`conf_sendmail_LIBS', `-lssl')
5590N/AAPPENDDEF(`conf_sendmail_LIBS', `-lcrypto')
5590N/AAPPENDDEF(`confMAPDEF', `-DLDAPMAP')
5590N/AAPPENDDEF(`confLIBS', `-lldap_r-2.4 -llber-2.4 -lc')
5590N/Adefine(`confDEPEND_TYPE', `Solaris')
5590N/Adefine(`confINCDIRS', `-I/usr/include/openldap')
5590N/Adefine(`confMKDIR', `/usr/bin/mkdir')
5590N/Adefine(`confMTCFLAGS', `$(CC_PIC)')
5590N/Adefine(`sendmailTARGET_LINKS', `')
5590N/Aendef
5590N/A#define(\`confOPTIMIZE', \`-g')
5590N/A
5590N/Aexport SITE_CONFIG_M4
5590N/A
5590N/A$(SOURCE_DIR)/devtools/Site/site.config.m4: unpack
5590N/A $(file > $@,$(SITE_CONFIG_M4))
5590N/A
3651N/A# mailq's Makefile doesn't grok the 32- and 64-bit build. We just want 64.
3651N/A# So we clean before we build, and the last build (64) wins, which is what
3651N/A# we want.
3651N/ACOMPONENT_POST_BUILD_ACTION = cd $(FILE_DIR)/aux ; \
3651N/A $(GMAKE) BITS=$(BITS) clean build
3649N/A
3649N/ACOMPONENT_POST_INSTALL_ACTION += cd $(FILE_DIR)/aux ; $(GMAKE) install ;
3649N/ACOMPONENT_POST_INSTALL_ACTION += \
3649N/A $(CP) $(FILE_DIR)/cf/domain/solaris-generic.m4 $(@D)/cf/domain/ ;
3649N/ACOMPONENT_POST_INSTALL_ACTION += \
3649N/A $(CP) $(FILE_DIR)/cf/cf/sendmail.mc $(@D)/cf/cf/ ;
3916N/A# Without the two $(CP)s below we would pick up the version of submit.cf
3916N/A# from under $(COMPONENT_SRC), which is not what we want because it contains
3916N/A# information (user, hostname, date, build path) from the upstream machine
3916N/A# where the distro was created. So we build our own version here, using
3916N/A# $(M4_ARG), which suppresses the inclusion of all that information.
3916N/A# Then we copy it to $(PROTO_DIR)/cf/cf instead of the more intuitive
3916N/A# $(PROTOETCDIR)/mail/cf/cf to match the transform in the manifest that
3916N/A# picks up everything under etc/mail/cf/ from cf/ instead.
3649N/ACOMPONENT_POST_INSTALL_ACTION += \
3649N/A cd $(@D)/cf/cf ; \
3649N/A $(RM) submit.cf ; \
3649N/A m4 $(M4_ARG) ../m4/cf.m4 submit.mc > submit.cf ; \
3916N/A $(CP) submit.cf $(PROTOETCDIR)/mail ; \
3916N/A $(MKDIR) $(PROTO_DIR)/cf/cf ; \
3916N/A $(CP) submit.cf $(PROTO_DIR)/cf/cf ; \
3649N/A m4 $(M4_ARG) ../m4/cf.m4 sendmail.mc > sendmail.cf
3649N/A
3649N/ACOMPONENT_TEST_ARGS += CC="$(CC)"
3649N/ACOMPONENT_TEST_ARGS += CCOPTS="$(CCOPTS)"
3651N/ACOMPONENT_TEST_ARGS += CCLINK="$(CC)"
3651N/ACOMPONENT_TEST_ARGS += CC_PIC="$(CC_PIC)"
3649N/ACOMPONENT_TEST_ARGS += LDOPTS="$(CC_BITS)"
3649N/A
5680N/ACOMPONENT_TEST_ENV += PATH=$(GNUBIN):$(USRBINDIR)
3649N/A
3651N/A# The transforms below abstract out the 32- or 64-bit specific parts of
3651N/A# the results, so we can use a common "all" master file.
3651N/ACOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
3651N/A
3649N/ACOMPONENT_TEST_TRANSFORMS += \
3649N/A '-e "s|$(SM_BUILD_SUB_DIR)|\\$$(SM_BUILD_SUB_DIR)|g" ' \
3649N/A '-e "s|$(OS_VERSION)|\\$$(OS_VERSION)|g" ' \
3649N/A '-e "s|$(ARCH)|\\$$(ARCH)|g" ' \
3850N/A '-e "s|^$(CC).*$$|XXX_CC_XXX|g" ' \
3850N/A '-e "/^XXX_CC_XXX\\$$/d" '
3649N/A
3651N/AINSTALL_64=
3649N/A
3649N/A# common targets
3651N/Ainstall: $(INSTALL_32_and_64)
3649N/A
3817N/AREQUIRED_PACKAGES += database/berkeleydb-5
3817N/AREQUIRED_PACKAGES += library/libmilter
3817N/AREQUIRED_PACKAGES += library/openldap
3817N/AREQUIRED_PACKAGES += library/security/openssl
5795N/AREQUIRED_PACKAGES += $(PERL_PKG)
3817N/AREQUIRED_PACKAGES += shell/ksh93
3817N/AREQUIRED_PACKAGES += system/core-os
3817N/AREQUIRED_PACKAGES += system/network
6021N/AREQUIRED_PACKAGES += system/network/ldap/openldap