You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.1 KiB

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