2014-04-30 21:34:56 +02:00
|
|
|
################################################################################
|
2014-03-06 17:54:50 +01:00
|
|
|
#
|
|
|
|
# exim
|
|
|
|
#
|
2014-04-30 21:34:56 +02:00
|
|
|
################################################################################
|
2014-03-06 17:54:50 +01:00
|
|
|
|
2021-11-07 10:04:24 +01:00
|
|
|
EXIM_VERSION = 4.95
|
2017-12-08 20:39:01 +01:00
|
|
|
EXIM_SOURCE = exim-$(EXIM_VERSION).tar.xz
|
2020-07-16 21:40:11 +02:00
|
|
|
EXIM_SITE = https://ftp.exim.org/pub/exim/exim4
|
2017-03-30 15:43:32 +02:00
|
|
|
EXIM_LICENSE = GPL-2.0+
|
2014-03-06 17:54:50 +01:00
|
|
|
EXIM_LICENSE_FILES = LICENCE
|
2021-01-17 19:21:40 +01:00
|
|
|
EXIM_CPE_ID_VENDOR = exim
|
2021-07-30 22:43:08 +02:00
|
|
|
EXIM_SELINUX_MODULES = exim mta
|
2019-07-28 10:50:47 +02:00
|
|
|
EXIM_DEPENDENCIES = host-berkeleydb host-pcre pcre berkeleydb host-pkgconf
|
2014-03-06 17:54:50 +01:00
|
|
|
|
2014-04-06 22:29:17 +02:00
|
|
|
# Modify a variable value. It must already exist in the file, either
|
|
|
|
# commented or not.
|
|
|
|
define exim-config-change # variable-name, variable-value
|
|
|
|
$(SED) 's,^[#[:space:]]*$1[[:space:]]*=.*$$,$1=$2,' \
|
|
|
|
$(@D)/Local/Makefile
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Comment-out a variable. Has no effect if it does not exits.
|
|
|
|
define exim-config-unset # variable-name
|
|
|
|
$(SED) 's,^\([[:space:]]*$1[[:space:]]*=.*$$\),# \1,' \
|
|
|
|
$(@D)/Local/Makefile
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Add a variable definition. It must not already exist in the file,
|
|
|
|
# otherwise it would be defined twice with potentially different values.
|
|
|
|
define exim-config-add # variable-name, variable-value
|
|
|
|
echo "$1=$2" >>$(@D)/Local/Makefile
|
|
|
|
endef
|
|
|
|
|
2014-07-04 17:56:24 +02:00
|
|
|
define EXIM_USE_CUSTOM_CONFIG_FILE
|
|
|
|
$(INSTALL) -m 0644 $(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE) \
|
|
|
|
$(@D)/Local/Makefile
|
|
|
|
endef
|
|
|
|
|
|
|
|
define EXIM_USE_DEFAULT_CONFIG_FILE
|
2014-04-06 22:29:17 +02:00
|
|
|
$(INSTALL) -m 0644 $(@D)/src/EDITME $(@D)/Local/Makefile
|
|
|
|
$(call exim-config-change,BIN_DIRECTORY,/usr/sbin)
|
|
|
|
$(call exim-config-change,CONFIGURE_FILE,/etc/exim/configure)
|
2020-03-02 11:19:02 +01:00
|
|
|
$(call exim-config-change,LOG_FILE_PATH,/var/log/exim/exim_%slog)
|
|
|
|
$(call exim-config-change,PID_FILE_PATH,/var/run/exim/exim.pid)
|
2014-04-06 22:29:17 +02:00
|
|
|
$(call exim-config-change,EXIM_USER,ref:exim)
|
|
|
|
$(call exim-config-change,EXIM_GROUP,mail)
|
|
|
|
$(call exim-config-change,TRANSPORT_LMTP,yes)
|
|
|
|
$(call exim-config-change,PCRE_LIBS,-lpcre)
|
|
|
|
$(call exim-config-change,PCRE_CONFIG,no)
|
|
|
|
$(call exim-config-change,HAVE_ICONV,no)
|
|
|
|
$(call exim-config-unset,EXIM_MONITOR)
|
2015-05-17 17:58:21 +02:00
|
|
|
$(call exim-config-change,AUTH_PLAINTEXT,yes)
|
|
|
|
$(call exim-config-change,AUTH_CRAM_MD5,yes)
|
2020-01-04 15:38:13 +01:00
|
|
|
$(call exim-config-unset,SUPPORT_DANE)
|
2014-07-04 17:56:24 +02:00
|
|
|
endef
|
|
|
|
|
2014-10-29 21:14:06 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_DOVECOT),y)
|
|
|
|
EXIM_DEPENDENCIES += dovecot
|
|
|
|
define EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT
|
|
|
|
$(call exim-config-change,AUTH_DOVECOT,yes)
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2014-10-31 22:15:20 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_CLAMAV),y)
|
|
|
|
EXIM_DEPENDENCIES += clamav
|
|
|
|
define EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV
|
|
|
|
$(call exim-config-change,WITH_CONTENT_SCAN,yes)
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2015-04-12 13:25:42 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
2019-07-28 10:50:47 +02:00
|
|
|
EXIM_DEPENDENCIES += host-openssl openssl
|
2015-04-12 13:25:42 +02:00
|
|
|
define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL
|
2020-01-04 15:38:13 +01:00
|
|
|
$(call exim-config-change,USE_OPENSSL,yes)
|
2015-04-12 13:25:42 +02:00
|
|
|
$(call exim-config-change,USE_OPENSSL_PC,openssl)
|
|
|
|
endef
|
2020-01-04 15:38:13 +01:00
|
|
|
else
|
|
|
|
define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL
|
|
|
|
$(call exim-config-change,DISABLE_TLS,yes)
|
|
|
|
endef
|
2015-04-12 13:25:42 +02:00
|
|
|
endif
|
|
|
|
|
2015-07-25 15:36:55 +02:00
|
|
|
# musl does not provide struct ip_options nor struct ip_opts (but it is
|
|
|
|
# available with both glibc and uClibc)
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
|
|
|
|
define EXIM_FIX_IP_OPTIONS_FOR_MUSL
|
|
|
|
$(SED) 's/#define GLIBC_IP_OPTIONS/#define DARWIN_IP_OPTIONS/' \
|
|
|
|
$(@D)/OS/os.h-Linux
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2014-07-04 17:56:24 +02:00
|
|
|
define EXIM_CONFIGURE_TOOLCHAIN
|
2014-04-06 22:29:17 +02:00
|
|
|
$(call exim-config-add,CC,$(TARGET_CC))
|
|
|
|
$(call exim-config-add,CFLAGS,$(TARGET_CFLAGS))
|
|
|
|
$(call exim-config-add,AR,$(TARGET_AR) cq)
|
|
|
|
$(call exim-config-add,RANLIB,$(TARGET_RANLIB))
|
|
|
|
$(call exim-config-add,HOSTCC,$(HOSTCC))
|
|
|
|
$(call exim-config-add,HOSTCFLAGS,$(HOSTCFLAGS))
|
2015-07-25 15:36:55 +02:00
|
|
|
$(EXIM_FIX_IP_OPTIONS_FOR_MUSL)
|
2014-03-06 17:54:50 +01:00
|
|
|
endef
|
|
|
|
|
2014-07-16 18:11:55 +02:00
|
|
|
ifneq ($(call qstrip,$(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE)),)
|
2014-07-04 17:56:24 +02:00
|
|
|
define EXIM_CONFIGURE_CMDS
|
|
|
|
$(EXIM_USE_CUSTOM_CONFIG_FILE)
|
|
|
|
$(EXIM_CONFIGURE_TOOLCHAIN)
|
|
|
|
endef
|
|
|
|
else # CUSTOM_CONFIG
|
|
|
|
define EXIM_CONFIGURE_CMDS
|
|
|
|
$(EXIM_USE_DEFAULT_CONFIG_FILE)
|
2014-10-29 21:14:06 +01:00
|
|
|
$(EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT)
|
2014-10-31 22:15:20 +01:00
|
|
|
$(EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV)
|
2015-04-12 13:25:42 +02:00
|
|
|
$(EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL)
|
2014-07-04 17:56:24 +02:00
|
|
|
$(EXIM_CONFIGURE_TOOLCHAIN)
|
|
|
|
endef
|
|
|
|
endif # CUSTOM_CONFIG
|
|
|
|
|
2014-05-28 09:47:54 +02:00
|
|
|
# exim needs a bit of love to build statically
|
2014-12-03 22:41:29 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2014-05-28 09:47:54 +02:00
|
|
|
EXIM_STATIC_FLAGS = LFLAGS="-pthread --static"
|
|
|
|
endif
|
|
|
|
|
2019-07-28 10:50:47 +02:00
|
|
|
# We need the host version of macro_predef during the build, before
|
|
|
|
# building it we need to prepare the makefile.
|
2014-03-06 17:54:50 +01:00
|
|
|
define EXIM_BUILD_CMDS
|
2020-04-20 18:36:45 +02:00
|
|
|
$(TARGET_MAKE_ENV) build=br $(MAKE) -C $(@D) makefile
|
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/build-br macro_predef \
|
2020-07-19 12:29:46 +02:00
|
|
|
CC="$(HOSTCC)" \
|
|
|
|
LNCC="$(HOSTCC)" \
|
2020-01-04 22:34:59 +01:00
|
|
|
CFLAGS="-std=c99 $(HOST_CFLAGS)" \
|
2019-07-28 10:50:47 +02:00
|
|
|
LFLAGS="-fPIC $(HOST_LDFLAGS)"
|
2020-04-20 18:36:45 +02:00
|
|
|
$(TARGET_MAKE_ENV) build=br $(MAKE) -C $(@D) $(EXIM_STATIC_FLAGS) \
|
2020-02-10 22:48:38 +01:00
|
|
|
CFLAGS="-std=c99 $(TARGET_CFLAGS)"
|
2014-03-06 17:54:50 +01:00
|
|
|
endef
|
|
|
|
|
2014-05-28 09:47:54 +02:00
|
|
|
# Need to replicate the LFLAGS in install, as exim still wants to build
|
|
|
|
# something when installing...
|
2014-03-06 17:54:50 +01:00
|
|
|
define EXIM_INSTALL_TARGET_CMDS
|
|
|
|
DESTDIR=$(TARGET_DIR) INSTALL_ARG="-no_chown -no_symlink" build=br \
|
2020-04-20 18:36:45 +02:00
|
|
|
$(MAKE) -C $(@D) $(EXIM_STATIC_FLAGS) \
|
2020-02-10 22:48:40 +01:00
|
|
|
CFLAGS="-std=c99 $(TARGET_CFLAGS)" \
|
|
|
|
install
|
2014-03-06 17:54:50 +01:00
|
|
|
chmod u+s $(TARGET_DIR)/usr/sbin/exim
|
|
|
|
endef
|
|
|
|
|
|
|
|
define EXIM_USERS
|
2014-11-03 00:39:51 +01:00
|
|
|
exim 88 mail 8 * - - - exim
|
2014-03-06 17:54:50 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define EXIM_INSTALL_INIT_SYSV
|
|
|
|
$(INSTALL) -D -m 755 package/exim/S86exim \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S86exim
|
|
|
|
endef
|
|
|
|
|
2015-05-23 12:03:27 +02:00
|
|
|
define EXIM_INSTALL_INIT_SYSTEMD
|
|
|
|
$(INSTALL) -D -m 644 package/exim/exim.service \
|
|
|
|
$(TARGET_DIR)/usr/lib/systemd/system/exim.service
|
|
|
|
endef
|
|
|
|
|
2014-03-06 17:54:50 +01:00
|
|
|
$(eval $(generic-package))
|