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
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
)
51 ifeq ($(BR2_PACKAGE_DOVECOT
),y
)
52 EXIM_DEPENDENCIES
+= dovecot
53 define EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT
54 $(call exim-config-change
,AUTH_DOVECOT
,yes
)
58 ifeq ($(BR2_PACKAGE_CLAMAV
),y
)
59 EXIM_DEPENDENCIES
+= clamav
60 define EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV
61 $(call exim-config-change
,WITH_CONTENT_SCAN
,yes
)
65 # this specific toolchain lacks libnsl
66 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_SYNOPSYS_ARC_2014_12
),y
)
67 define EXIM_REMOVE_LIBNSL_FROM_MAKEFILE
68 $(SED
) 's/-lnsl//g' $(@D
)/OS
/Makefile-Linux
72 define EXIM_CONFIGURE_TOOLCHAIN
73 $(call exim-config-add
,CC
,$(TARGET_CC
))
74 $(call exim-config-add
,CFLAGS
,$(TARGET_CFLAGS
))
75 $(call exim-config-add
,AR
,$(TARGET_AR
) cq
)
76 $(call exim-config-add
,RANLIB
,$(TARGET_RANLIB
))
77 $(call exim-config-add
,HOSTCC
,$(HOSTCC
))
78 $(call exim-config-add
,HOSTCFLAGS
,$(HOSTCFLAGS
))
79 $(EXIM_REMOVE_LIBNSL_FROM_MAKEFILE
)
82 ifneq ($(call qstrip
,$(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE
)),)
83 define EXIM_CONFIGURE_CMDS
84 $(EXIM_USE_CUSTOM_CONFIG_FILE
)
85 $(EXIM_CONFIGURE_TOOLCHAIN
)
88 define EXIM_CONFIGURE_CMDS
89 $(EXIM_USE_DEFAULT_CONFIG_FILE
)
90 $(EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT
)
91 $(EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV
)
92 $(EXIM_CONFIGURE_TOOLCHAIN
)
96 # exim needs a bit of love to build statically
97 ifeq ($(BR2_STATIC_LIBS
),y
)
98 EXIM_STATIC_FLAGS
= LFLAGS
="-pthread --static"
101 # "The -j (parallel) flag must not be used with make"
102 # (http://www.exim.org/exim-html-current/doc/html/spec_html/ch04.html)
103 define EXIM_BUILD_CMDS
104 build
=br
$(MAKE1
) -C
$(@D
) $(EXIM_STATIC_FLAGS
)
107 # Need to replicate the LFLAGS in install, as exim still wants to build
108 # something when installing...
109 define EXIM_INSTALL_TARGET_CMDS
110 DESTDIR
=$(TARGET_DIR
) INSTALL_ARG
="-no_chown -no_symlink" build
=br \
111 $(MAKE1
) -C
$(@D
) $(EXIM_STATIC_FLAGS
) install
112 chmod u
+s
$(TARGET_DIR
)/usr
/sbin
/exim
116 exim
88 mail
8 * - - - exim
119 define EXIM_INSTALL_INIT_SYSV
120 $(INSTALL
) -D
-m
755 package
/exim
/S86exim \
121 $(TARGET_DIR
)/etc
/init.d
/S86exim
124 $(eval
$(generic-package
))