4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2022, 2023, 2024 Friedrich Kink
29 include ..
/..
/..
/make-rules
/shared-macros.mk
31 COMPONENT_NAME
= sendmail
32 COMPONENT_VERSION
= 8.18.1
34 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
35 COMPONENT_PROJECT_URL
= https
://ftp.sendmail.org
/
36 COMPONENT_ARCHIVE
= $(COMPONENT_NAME
).
$(COMPONENT_VERSION
).
tar.gz
37 COMPONENT_ARCHIVE_HASH
= sha256
:cbf1f309c38e4806f7cf3ead24260f17d1fe8fb63256d13edb3cdd1a098f0770
38 COMPONENT_ARCHIVE_URL
= $(COMPONENT_PROJECT_URL
)$(COMPONENT_ARCHIVE
)
40 include $(WS_MAKE_RULES
)/common.mk
42 # We set ARCH to match sendmail's configure-like script: on x86, it simply
43 # uses 'uname -m', but on sparc it shortens "sun4*" into "sun4".
44 ARCH
:= $(shell uname
-m
)
45 ifeq ($(findstring sun4
,$(ARCH
)),sun4
)
49 FILE_DIR
= $(COMPONENT_DIR
)/files
50 M4_ARG
= -D_NO_MAKEINFO_
51 SM_BUILD_SUB_DIR
=obj.SunOS.
$(OS_VERSION
).
$(ARCH
)
52 SM_BUILD_DIR
= $(@D
)/$(SM_BUILD_SUB_DIR
)
54 # Although we build 32_and_64, everything except libmilter just wants 64,
55 # which is why the macros just below only have values for 64. libmilter
56 # is dealt with further below.
57 PKG_PROTO_DIRS
+= $(BUILD_DIR_64
)
58 PKG_PROTO_DIRS
+= $(BUILD_DIR_64
)/obj.SunOS.
$(OS_VERSION
).
$(ARCH
)
59 PKG_PROTO_DIRS
+= $(COMPONENT_DIR
)/files
60 PKG_PROTO_DIRS
+= $(COMPONENT_DIR
)/files
/man
62 # libmilter is built 32- and 64-bit, but its Makefile installs into a common
63 # location, so we use the macro below in its manifest to distinguish between
64 # the different built objects.
65 PKG_MACROS
+= LIBMILTER_BUILD_DIR
=$(SM_BUILD_SUB_DIR
)
67 CLEAN_PATHS
+= $(FILE_DIR
)/aux
/mailq
69 # This appends "+Sun" to the version string, which we do for historical
70 # reasons. If we did this via patch, then we would have to revise the patch
71 # with every new release, since the version string changes every time.
72 COMPONENT_PREP_ACTION
= ($(GSED
) -i
-e
's/\(Version\[\] = "8\.[^"]*\)/\1+Sun/' \
73 $(COMPONENT_SRC
)/sendmail
/version.c
&& \
74 cp
$(COMPONENT_SRC
)/devtools
/M4
/depend
/X11.m4 \
75 $(COMPONENT_SRC
)/devtools
/M4
/depend
/Solaris.m4
)
77 # libmilter and sendmail must come before include, so appending to the default
78 # value of LINT_FLAGS will not work; we must redefine it here.
79 SM_DEFS
= -DSOLARIS
=$(shell echo
$(SOLARIS_VERSION
) | \
80 $(GSED
) -e
's/\.//' -e
's/$$/00/')
81 SM_INCLUDES
= -I
$(SM_BUILD_DIR
)/libmilter
-I
$(SOURCE_DIR
)/sendmail \
82 -I
$(SOURCE_DIR
)/include -I
$(SOURCE_DIR
) -I.
83 LINT_FLAGS
= -nsvx
$(SM_DEFS
) $(SM_INCLUDES
)
84 CCOPTS
.32 = -D_FILE_OFFSET_BITS
=64
85 CCOPTS
= -erroff
=E_STATEMENT_NOT_REACHED
$(CC_BITS
) $(CCOPTS.
$(BITS
))
87 LDOPTS
= $(LDOPTS.
$(BITS
))
89 COMPONENT_BUILD_ARGS
+= CC
="$(CC)"
90 COMPONENT_BUILD_ARGS
+= CCOPTS
="$(CCOPTS)"
91 COMPONENT_BUILD_ARGS
+= CCLINK
="$(CC)"
92 COMPONENT_BUILD_ARGS
+= CC_PIC
="$(CC_PIC)"
93 COMPONENT_BUILD_ARGS
+= LDOPTS
="$(CC_BITS)"
95 $(SOURCE_DIR
)/.prep
: $(SOURCE_DIR
)/devtools
/Site
/site.config.m4
97 # Sendmail looks for its build configuration in various per-OS config files
98 # in its devtools/Site sub-dir, with site.config.m4 being the fallback. So
99 # create that file as part of the 'prep' phase.
102 define SITE_CONFIG_M4
103 APPENDDEF
(`conf_sendmail_ENVDEF', `-DSUN_EXTENSIONS
')
104 APPENDDEF(`conf_sendmail_ENVDEF', `-DVENDOR_DEFAULT=VENDOR_SUN')
105 APPENDDEF(`conf_sendmail_ENVDEF
', `-DSUN_INIT_DOMAIN')
106 APPENDDEF
(`conf_sendmail_ENVDEF', `-D_FFR_LOCAL_DAEMON
')
107 APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_MAIL_MACRO')
108 APPENDDEF(`conf_sendmail_ENVDEF
', `-DIPV6_FULL=1')
109 APPENDDEF
(`confENVDEF', `-DSM_CONF_LDAP_MEMFREE
')
110 APPENDDEF(`confENVDEF', `-DTCPWRAPPERS')
111 APPENDDEF(`confENVDEF
', `-DSASL')
112 APPENDDEF
(`confENVDEF', `-DMAP_REGEX
')
113 APPENDDEF(`confENVDEF', `-DALLOW_255')
114 APPENDDEF(`confENVDEF
', `-DSTARTTLS')
115 APPENDDEF
(`confENVDEF', `-DTLS_EC
')
116 APPENDDEF(`confENVDEF', `-DUSE_EAI')
117 APPENDDEF(`confENVDEF
', `-DHASFLOCK')
118 APPENDDEF
(`confENVDEF', `-D_FFR_ALIAS_DETAIL
')
119 APPENDDEF(`confENVDEF', `-D_FFR_MTA_STS')
120 APPENDDEF(`confENVDEF
', `-D_FFR_TLSA_DANE')
121 APPENDDEF
(`confENVDEF', `-D_FFR_TLS_ALTNAMES
')
122 APPENDDEF(`confENVDEF', `-D_FFR_TLS_USE_CERTIFICATE_CHAIN_FILE')
123 APPENDDEF(`confLIBS
', `-L$(OPENSSL_PREFIX)/lib/$(MACH64) -lssl -lcrypto -lldap_r -llber -lsasl -licuuc')
124 APPENDDEF
(`conf_sendmail_LIBS', `-lsldap
')
125 APPENDDEF(`conf_sendmail_LIBS', `-lwrap')
126 APPENDDEF(`conf_sendmail_LIBS
', `-lumem')
127 APPENDDEF
(`confMAPDEF', `-DLDAPMAP
')
128 APPENDDEF(`confLIBS', `-L$(OPENSSL_PREFIX)/lib -lldap_r -llber -lsasl -licuuc')
129 define(`confDEPEND_TYPE
', `Solaris')
130 define(`confINCDIRS', `-I
$(OPENSSL_PREFIX
)/include -I
/usr
/include/openldap
-I
/usr
/include/sasl
')
131 define(`confMKDIR', `/usr/bin/mkdir')
132 define(`confMTCFLAGS
', `$(CC_PIC)')
133 define(`sendmailTARGET_LINKS', `')
135 #define(\`confOPTIMIZE', \
`-g')
137 export SITE_CONFIG_M4
139 COMPONENT_PRE_BUILD_ACTION += $(GSED) -i -e 's:/usr/perl5/bin/perl:/usr/bin/perl:' $(BUILD_DIR)/$(MACH64)/contrib/etrn.pl
141 $(SOURCE_DIR)/devtools/Site/site.config.m4: unpack
142 $(file > $@,$(SITE_CONFIG_M4))
144 # mailq's Makefile doesn't grok the 32- and 64-bit build. We just want 64.
145 # So we clean before we build, and the last build (64) wins, which is what
147 COMPONENT_POST_BUILD_ACTION = cd $(FILE_DIR)/aux ; \
148 $(GMAKE) BITS=$(BITS) clean build
150 COMPONENT_POST_INSTALL_ACTION += cd $(BUILD_DIR_$(BITS))/obj.SunOS.5.11.$(ARCH)/mail.local \
151 && $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) force-install DESTDIR=$(PROTO_DIR);
152 COMPONENT_POST_INSTALL_ACTION += cd $(FILE_DIR)/aux ; $(GMAKE) install ;
153 COMPONENT_POST_INSTALL_ACTION += $(CP) $(FILE_DIR)/cf/domain/solaris-generic.m4 $(@D)/cf/domain/ ;
154 COMPONENT_POST_INSTALL_ACTION += $(CP) $(FILE_DIR)/cf/cf/sendmail.mc $(@D)/cf/cf/ ;
156 # Without the two $(CP)s below we would pick up the version of submit.cf
157 # from under $(COMPONENT_SRC), which is not what we want because it contains
158 # information (user, hostname, date, build path) from the upstream machine
159 # where the distro was created. So we build our own version here, using
160 # $(M4_ARG), which suppresses the inclusion of all that information.
161 # Then we copy it to $(PROTO_DIR)/cf/cf instead of the more intuitive
162 # $(PROTOETCDIR)/mail/cf/cf to match the transform in the manifest that
163 # picks up everything under etc/mail/cf/ from cf/ instead.
164 COMPONENT_POST_INSTALL_ACTION += \
167 m4 $(M4_ARG) ../m4/cf.m4 submit.mc > submit.cf ; \
168 $(CP) submit.cf $(PROTOETCDIR)/mail ; \
169 $(MKDIR) $(PROTO_DIR)/cf/cf ; \
170 $(CP) submit.cf $(PROTO_DIR)/cf/cf ; \
171 m4 $(M4_ARG) ../m4/cf.m4 sendmail.mc > sendmail.cf
173 COMPONENT_TEST_ARGS += CC="$(CC)"
174 COMPONENT_TEST_ARGS += CCOPTS="$(CCOPTS)"
175 COMPONENT_TEST_ARGS += LDOPTS="$(LDOPTS)"
176 COMPONENT_TEST_ARGS += CCLINK="$(CC)"
177 COMPONENT_TEST_ARGS += CC_PIC="$(CC_PIC)"
179 COMPONENT_TEST_ENV += PATH=$(GNUBIN):$(USRBINDIR)
181 # The transforms below abstract out the 32- or 64-bit specific parts of
182 # the results, so we can use a common "all" master file.
183 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
185 COMPONENT_TEST_TRANSFORMS += -n \
188 '-e "/===========/p" '
190 # Auto-generated dependencies
191 REQUIRED_PACKAGES += $(ICU_LIBRARY_PKG)
192 REQUIRED_PACKAGES += $(OPENSSL_PKG)
193 REQUIRED_PACKAGES += SUNWcs
194 REQUIRED_PACKAGES += database/berkeleydb-5
195 REQUIRED_PACKAGES += library/openldap
196 REQUIRED_PACKAGES += runtime/perl
197 REQUIRED_PACKAGES += shell/ksh93
198 REQUIRED_PACKAGES += system/library
199 REQUIRED_PACKAGES += system/library/security/libsasl