blob: e6e81f63e4eb11bf883cbede156492b51c1c7b19 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
2# Copyright (C) 2006-2014 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=emailrelay
11PKG_VERSION:=2.1
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz
15PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)
16PKG_HASH:=dcb1fc0cbb3d5407554685616e7ef691f30f733b4484979be0794c9d5f563762
17
18PKG_MAINTAINER:=Federico Di Marco <fededim@gmail.com>
19PKG_LICENSE:=GPL-3.0-or-later
20PKG_LICENSE_FILES:=COPYING
21
22PKG_CONFIG_DEPENDS:=CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG CONFIG_EMAILRELAY_SSL
23
24include $(INCLUDE_DIR)/package.mk
25
26define Package/emailrelay
27 SECTION:=mail
28 CATEGORY:=Mail
29 DEPENDS:=+EMAILRELAY_SSL:libopenssl +libstdcpp
30 TITLE:=A simple SMTP proxy and MTA
31 URL:=http://emailrelay.sourceforge.net/
32 MENU:=1
33endef
34
35
36define Package/emailrelay/config
37config EMAILRELAY_SUPPORT_VERBOSE_DBG
38 bool "Enable support for extended logging"
39 depends on PACKAGE_emailrelay
40 default n
41 help
42 Enables support for extended logging (must also be explicitely enabled by using command line switch --debug when starting emailrelay)
43
44config EMAILRELAY_SSL
45 bool "Enable support for OpenSSL"
46 depends on PACKAGE_emailrelay
47 default y
48 select PACKAGE_libopenssl
49 help
50 Builds the package with OpenSSL support (SSMTP is supported).
51endef
52
53
54
55define Package/emailrelay/description
56 Emailrelay is a simple SMTP proxy and store-and-forward message transfer agent (MTA).
57
58 When running as a proxy all e-mail messages can be passed through
59 a user-defined program, such as a spam filter, which can drop,
60 re-address or edit messages as they pass through. When running
61 as a store-and-forward MTA incoming messages are stored in a
62 local spool directory, and then forwarded to the next SMTP
63 server on request.
64endef
65
66
67define Package/emailrelay/conffiles
68/etc/config/emailrelay
69/etc/emailrelay.auth
70endef
71
72
73CONFIGURE_ARGS += \
74 --without-doxygen \
75 --without-man2html \
76 --without-mbedtls \
77 --without-pam \
78 --disable-bsd \
79 --disable-gui \
80 --disable-mac \
81 --disable-testing \
82 --disable-windows
83
84ifeq ($(CONFIG_EMAILRELAY_SSL),y)
85 CONFIGURE_ARGS += \
86 --with-openssl
87else
88 CONFIGURE_ARGS += \
89 --without-openssl
90endif
91
92ifeq ($(CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG),y)
93 CONFIGURE_ARGS += \
94 --enable-debug=yes
95endif
96
97TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto
98TARGET_CXXFLAGS += -Wl,--gc-sections,--as-needed
99
100define Package/emailrelay/install
101 $(INSTALL_DIR) $(1)/usr/bin
102 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay $(1)/usr/bin/
103 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-filter-copy $(1)/usr/bin/
104 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-passwd $(1)/usr/bin/
105 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-submit $(1)/usr/bin/
106 $(INSTALL_DIR) $(1)/etc
107 $(INSTALL_DATA) files/$(PKG_NAME).auth $(1)/etc/
108 $(INSTALL_DIR) $(1)/etc/config
109 $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
110 $(INSTALL_DIR) $(1)/etc/init.d
111 $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
112endef
113
114
115$(eval $(call BuildPackage,emailrelay))