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.

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