From 57589398313a19cbe0999e72ce1fc57786f7c5c7 Mon Sep 17 00:00:00 2001 From: Rupan Date: Sun, 18 Sep 2016 15:32:24 +0200 Subject: [PATCH] emailrelay: added configuration options - moved from net to mail category - removed no-ssl package and added ssl support as configuration option (default enabled) - added configuration option to support extended logging (default disabled) - disabled build of test tools - added LEDE compatibility (support for openssl without SSL3) Signed-off-by: Federico Di Marco --- {net => mail}/emailrelay/Makefile | 82 +++++++++---------- .../emailrelay/files/emailrelay.auth | 0 .../emailrelay/files/emailrelay.init | 0 mail/emailrelay/patches/010-ssl3-fix.patch | 13 +++ 4 files changed, 53 insertions(+), 42 deletions(-) rename {net => mail}/emailrelay/Makefile (66%) rename {net => mail}/emailrelay/files/emailrelay.auth (100%) rename {net => mail}/emailrelay/files/emailrelay.init (100%) create mode 100644 mail/emailrelay/patches/010-ssl3-fix.patch diff --git a/net/emailrelay/Makefile b/mail/emailrelay/Makefile similarity index 66% rename from net/emailrelay/Makefile rename to mail/emailrelay/Makefile index 4f352d032e..e672c9ad18 100644 --- a/net/emailrelay/Makefile +++ b/mail/emailrelay/Makefile @@ -9,45 +9,51 @@ include $(TOPDIR)/rules.mk PKG_NAME:=emailrelay PKG_VERSION:=1.9 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION) PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_CONFIG_DEPENDS:=CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG CONFIG_EMAILRELAY_SSL include $(INCLUDE_DIR)/uclibc++.mk include $(INCLUDE_DIR)/package.mk -define Package/emailrelay/Default - SECTION:=net - SUBMENU:=Web Servers/Proxies - CATEGORY:=Network - DEPENDS:=$(CXX_DEPENDS) +define Package/emailrelay + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=$(CXX_DEPENDS) +EMAILRELAY_SSL:libopenssl TITLE:=A simple SMTP proxy and MTA URL:=http://emailrelay.sourceforge.net/ MAINTAINER:=Federico Di Marco + MENU:=1 endef -define Package/emailrelay -$(call Package/emailrelay/Default) - TITLE+= (with OpenSSL support) - DEPENDS+=+libopenssl - VARIANT:=ssl -endef - -define Package/emailrelay-nossl -$(call Package/emailrelay/Default) - TITLE+= (no SSL support) - VARIANT:=nossl +define Package/emailrelay/config +config EMAILRELAY_SUPPORT_VERBOSE_DBG + bool "Enable support for extended logging" + depends on PACKAGE_emailrelay + default n + help + Enables support for extended logging (must also be explicitely enabled by using command line switch --debug when starting emailrelay) + +config EMAILRELAY_SSL + bool "Enable support for OpenSSL" + depends on PACKAGE_emailrelay + default y + select PACKAGE_libopenssl + help + Builds the package with OpenSSL support (SSMTP is supported). endef -define Package/emailrelay/Default/description +define Package/emailrelay/description Emailrelay is a simple SMTP proxy and store-and-forward message transfer agent (MTA). When running as a proxy all e-mail messages can be passed through @@ -59,41 +65,36 @@ define Package/emailrelay/Default/description endef -define Package/emailrelay/description -$(call Package/emailrelay/Default/description) - - This package is built with OpenSSL support (SSMTP is supported). -endef - -define Package/emailrelay-nossl/description -$(call Package/emailrelay/Default/description) - - This package is built without SSL support (no SSMTP) -endef - - define Package/emailrelay/conffiles /etc/emailrelay.auth endef -define Package/emailrelay-nossl/conffiles -/etc/emailrelay.auth -endef CONFIGURE_ARGS += \ - --with-pam=no + --with-pam=no \ + --enable-testing=no CONFIGURE_VARS += \ CXXFLAGS="$$$$CXXFLAGS -fno-rtti" -ifeq ($(BUILD_VARIANT),ssl) + +ifeq ($(CONFIG_EMAILRELAY_SSL),y) CONFIGURE_ARGS += \ --with-openssl +else + CONFIGURE_ARGS += \ + --with-openssl=no endif -ifeq ($(BUILD_VARIANT),nossl) + +ifeq ($(CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG),y) CONFIGURE_ARGS += \ - --with-openssl=no + --enable-debug=yes +endif + +ifeq ($(CONFIG_OPENSSL_WITH_SSL3),y) + CONFIGURE_VARS += \ + CXXFLAGS="$$$$CXXFLAGS -DSSL3_SUPPORT" endif define Package/emailrelay/install @@ -109,8 +110,5 @@ define Package/emailrelay/install $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) endef -Package/emailrelay-nossl/install = $(Package/emailrelay/install) - $(eval $(call BuildPackage,emailrelay)) -$(eval $(call BuildPackage,emailrelay-nossl)) diff --git a/net/emailrelay/files/emailrelay.auth b/mail/emailrelay/files/emailrelay.auth similarity index 100% rename from net/emailrelay/files/emailrelay.auth rename to mail/emailrelay/files/emailrelay.auth diff --git a/net/emailrelay/files/emailrelay.init b/mail/emailrelay/files/emailrelay.init similarity index 100% rename from net/emailrelay/files/emailrelay.init rename to mail/emailrelay/files/emailrelay.init diff --git a/mail/emailrelay/patches/010-ssl3-fix.patch b/mail/emailrelay/patches/010-ssl3-fix.patch new file mode 100644 index 0000000000..d0e82f5187 --- /dev/null +++ b/mail/emailrelay/patches/010-ssl3-fix.patch @@ -0,0 +1,13 @@ +--- a/src/gssl/gssl_openssl.cpp ++++ b/src/gssl/gssl_openssl.cpp +@@ -292,8 +292,10 @@ GSsl::Context::Context( const std::strin + { + if( (flags&3U) == 2U ) + m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ; ++#ifdef SSL3_SUPPORT + else if( (flags&3U) == 3U ) + m_ssl_ctx = SSL_CTX_new(SSLv3_method()) ; ++#endif + else + m_ssl_ctx = SSL_CTX_new(TLSv1_method()) ; + -- 2.30.2