1 ################################################################################
5 ################################################################################
8 EXIM_SOURCE = exim-$(EXIM_VERSION).tar.bz2
9 EXIM_SITE = ftp://ftp.exim.org/pub/exim/exim4
11 EXIM_LICENSE_FILES = LICENCE
12 EXIM_DEPENDENCIES = pcre berkeleydb host-pkgconf
14 # Modify a variable value. It must already exist in the file, either
16 define exim-config-change # variable-name, variable-value
17 $(SED) 's,^[#[:space:]]*$1[[:space:]]*=.*$$,$1=$2,' \
21 # Comment-out a variable. Has no effect if it does not exits.
22 define exim-config-unset # variable-name
23 $(SED) 's,^\([[:space:]]*$1[[:space:]]*=.*$$\),# \1,' \
27 # Add a variable definition. It must not already exist in the file,
28 # otherwise it would be defined twice with potentially different values.
29 define exim-config-add # variable-name, variable-value
30 echo "$1=$2" >>$(@D)/Local/Makefile
33 define EXIM_USE_CUSTOM_CONFIG_FILE
34 $(INSTALL) -m 0644 $(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE) \
38 define EXIM_USE_DEFAULT_CONFIG_FILE
39 $(INSTALL) -m 0644 $(@D)/src/EDITME $(@D)/Local/Makefile
40 $(call exim-config-change,BIN_DIRECTORY,/usr/sbin)
41 $(call exim-config-change,CONFIGURE_FILE,/etc/exim/configure)
42 $(call exim-config-change,EXIM_USER,ref:exim)
43 $(call exim-config-change,EXIM_GROUP,mail)
44 $(call exim-config-change,TRANSPORT_LMTP,yes)
45 $(call exim-config-change,PCRE_LIBS,-lpcre)
46 $(call exim-config-change,PCRE_CONFIG,no)
47 $(call exim-config-change,HAVE_ICONV,no)
48 $(call exim-config-unset,EXIM_MONITOR)
49 $(call exim-config-change,AUTH_PLAINTEXT,yes)
50 $(call exim-config-change,AUTH_CRAM_MD5,yes)
53 ifeq ($(BR2_PACKAGE_DOVECOT),y)
54 EXIM_DEPENDENCIES += dovecot
55 define EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT
56 $(call exim-config-change,AUTH_DOVECOT,yes)
60 ifeq ($(BR2_PACKAGE_CLAMAV),y)
61 EXIM_DEPENDENCIES += clamav
62 define EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV
63 $(call exim-config-change,WITH_CONTENT_SCAN,yes)
67 ifeq ($(BR2_PACKAGE_OPENSSL),y)
68 EXIM_DEPENDENCIES += openssl
69 define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL
70 $(call exim-config-change,SUPPORT_TLS,yes)
71 $(call exim-config-change,USE_OPENSSL_PC,openssl)
75 define EXIM_CONFIGURE_TOOLCHAIN
76 $(call exim-config-add,CC,$(TARGET_CC))
77 $(call exim-config-add,CFLAGS,$(TARGET_CFLAGS))
78 $(call exim-config-add,AR,$(TARGET_AR) cq)
79 $(call exim-config-add,RANLIB,$(TARGET_RANLIB))
80 $(call exim-config-add,HOSTCC,$(HOSTCC))
81 $(call exim-config-add,HOSTCFLAGS,$(HOSTCFLAGS))
82 $(EXIM_REMOVE_LIBNSL_FROM_MAKEFILE)
85 ifneq ($(call qstrip,$(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE)),)
86 define EXIM_CONFIGURE_CMDS
87 $(EXIM_USE_CUSTOM_CONFIG_FILE)
88 $(EXIM_CONFIGURE_TOOLCHAIN)
91 define EXIM_CONFIGURE_CMDS
92 $(EXIM_USE_DEFAULT_CONFIG_FILE)
93 $(EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT)
94 $(EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV)
95 $(EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL)
96 $(EXIM_CONFIGURE_TOOLCHAIN)
100 # exim needs a bit of love to build statically
101 ifeq ($(BR2_STATIC_LIBS),y)
102 EXIM_STATIC_FLAGS = LFLAGS="-pthread --static"
105 # "The -j (parallel) flag must not be used with make"
106 # (http://www.exim.org/exim-html-current/doc/html/spec_html/ch04.html)
107 define EXIM_BUILD_CMDS
108 $(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS)
111 # Need to replicate the LFLAGS in install, as exim still wants to build
112 # something when installing...
113 define EXIM_INSTALL_TARGET_CMDS
114 DESTDIR=$(TARGET_DIR) INSTALL_ARG="-no_chown -no_symlink" build=br \
115 $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS) install
116 chmod u+s $(TARGET_DIR)/usr/sbin/exim
120 exim 88 mail 8 * - - - exim
123 define EXIM_INSTALL_INIT_SYSV
124 $(INSTALL) -D -m 755 package/exim/S86exim \
125 $(TARGET_DIR)/etc/init.d/S86exim
128 $(eval $(generic-package))