summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirkjan Ochtman <djc@gentoo.org>2016-05-14 18:15:34 +0200
committerDirkjan Ochtman <djc@gentoo.org>2016-05-14 18:15:34 +0200
commitb7ed97a4ffac16ca1c76a55c9afd49da03261f05 (patch)
tree7fb0d68ce8ed53bb0b736ccfa8e9e2dad2fbf9d8 /mail-filter
parentnet-misc/stunnel: stable for ppc and ppc64, bug #578938 (diff)
downloadgentoo-b7ed97a4ffac16ca1c76a55c9afd49da03261f05.tar.gz
gentoo-b7ed97a4ffac16ca1c76a55c9afd49da03261f05.tar.bz2
gentoo-b7ed97a4ffac16ca1c76a55c9afd49da03261f05.zip
mail-filter/rmilter: version bump to 1.8.4, add memcached USE flag (fixes bug 581574)
Package-Manager: portage-2.2.28
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/rmilter/Manifest1
-rw-r--r--mail-filter/rmilter/files/1.8.4-optional-memcached.patch176
-rw-r--r--mail-filter/rmilter/metadata.xml3
-rw-r--r--mail-filter/rmilter/rmilter-1.8.4.ebuild45
4 files changed, 225 insertions, 0 deletions
diff --git a/mail-filter/rmilter/Manifest b/mail-filter/rmilter/Manifest
index ea10dce81de..b1e55f7f5db 100644
--- a/mail-filter/rmilter/Manifest
+++ b/mail-filter/rmilter/Manifest
@@ -2,3 +2,4 @@ DIST rmilter-1.7.2.tar.gz 159934 SHA256 3033c190667276f1d716784cb6b485971a3249ab
DIST rmilter-1.7.3.tar.gz 160323 SHA256 515e0f69af9f702cc36fd565e30c9f715bff819df250679d0a24e4f07ba5f081 SHA512 4e65dbcccd7f378eb1dd93ffca1983614df19edf62b531483a59c636eb4564dbb531da2ecce3ea789c038913c8623e78db8636eff64f574eb5abc709cf8fc0e1 WHIRLPOOL 6ae75ec8190f58893b3c33e66cf07dee5ac9326056c3da23005d4c2dcad5a8760c1db08701226ece96b6e3bb12f15337ff686d2eafc6e6323abc299d289de456
DIST rmilter-1.7.4.tar.gz 162081 SHA256 ad32c2efe23c8b49f6b52a5b78b80943b93082d30c799e3de05f9df1c02b83fb SHA512 189f792664e30a0d60c618b902c393a4af570bea38810001aa759acae27fbb625389576eb3923678fddaca806b946e99e0444738b24aa3124e988bbc2ab1552b WHIRLPOOL 10e549b9d3461252c6213a35145a2f158d67613733bf89b9c939d3eac7b77080b6886a3386e9a6358f31ad6ffe4e0c35ed9cfc025294392aeff5f4b9e15d987c
DIST rmilter-1.7.5.tar.gz 162698 SHA256 34cf0b6c38dac9b11d6aacd0d093fdf3544d76543cd1aad2b1342e1024768e27 SHA512 4cf76e330e55e5f8542c7a27d18cd593ad2b2f1c0bd45bf3787bce7b1cbfe77752bcff7b6558b89105d034a7f2e31f7805fe2b4bf5b1bb408b18c10646ad0aa8 WHIRLPOOL 61bad9244f9e45be35fe0cc6d3199d431066fdaeb61065077e069e320d71f80696db1d62f6ca7a9acb45cef4c4ddeda9719bf206a124c9c7f4f01e32839ae0d0
+DIST rmilter-1.8.4.tar.gz 261800 SHA256 af7ad32d3fa8f41ec135a43468b98cc1c46128b30fe58700e9434fcdc3ce3f6a SHA512 7c1f9afc1cd489ff052ead5e1876fe334252766213cf8c30a394be7aa7b308896a9fb0b57391b37c5727f76707403d432c5fc1f56b78c996432c7524e4049803 WHIRLPOOL 296b8d7fd5db60b6b7b642907e5dc108019c6f61ed585769f81e68b51d11844e16ecacaab5d70416bcae45799df6c5fbd7f5495d58053c66bd237cb935f583b0
diff --git a/mail-filter/rmilter/files/1.8.4-optional-memcached.patch b/mail-filter/rmilter/files/1.8.4-optional-memcached.patch
new file mode 100644
index 00000000000..23617aa4a2e
--- /dev/null
+++ b/mail-filter/rmilter/files/1.8.4-optional-memcached.patch
@@ -0,0 +1,176 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e12aad4..910ba55 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -39,6 +39,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+ OPTION(ENABLE_DEBUG "Enable debug output [default: OFF]" OFF)
+ OPTION(ENABLE_OPTIMIZATION "Enable optimization [default: OFF]" OFF)
+ OPTION(ENABLE_DKIM "Enable dkim signatures [default: ON]" ON)
++OPTION(ENABLE_MEMCACHED "Enable memcached storage [default: ON]" ON)
+ OPTION(WANT_SYSTEMD_UNITS "Install systemd unit files on Linux [default: OFF]" OFF)
+
+ ############################# INCLUDE SECTION #############################################
+@@ -121,8 +122,8 @@ MACRO(ProcessPackage PKG_NAME)
+ PATH_SUFFIXES ${PKG_LIB_SUFFIXES} lib64 lib
+ PATHS ${RMILTER_DEFAULT_LIBRARY_PATHS})
+ IF(NOT _lib)
+- IF(OPTIONAL)
+- MESSAGE("Cannot find library ${PKG_LIBRARY} for package ${PKG_NAME}")
++ IF(PKG_OPTIONAL)
++ MESSAGE(STATUS "Cannot find library ${PKG_LIBRARY} for package ${PKG_NAME}")
+ ELSE()
+ MESSAGE(FATAL_ERROR "Cannot find library ${PKG_LIBRARY} for package ${PKG_NAME}")
+ ENDIF()
+@@ -133,8 +134,8 @@ MACRO(ProcessPackage PKG_NAME)
+ PATH_SUFFIXES ${PKG_INCLUDE_SUFFIXES} "include"
+ PATHS ${RMILTER_DEFAULT_INCLUDE_PATHS})
+ IF(NOT _incl)
+- IF(OPTIONAL)
+- MESSAGE("Cannot find header ${PKG_INCLUDE} for package ${PKG_NAME}")
++ IF(PKG_OPTIONAL)
++ MESSAGE(STATUS "Cannot find header ${PKG_INCLUDE} for package ${PKG_NAME}")
+ ELSE()
+ MESSAGE(FATAL_ERROR "Cannot find header ${PKG_INCLUDE} for package ${PKG_NAME}")
+ ENDIF()
+@@ -362,8 +363,6 @@ ProcessPackage(PCRE LIBRARY pcre INCLUDE pcre.h INCLUDE_SUFFIXES include/pcre
+ ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3)
+ ProcessPackage(LIBMILTER LIBRARY milter INCLUDE mfapi.h INCLUDE_SUFFIXES include/libmilter
+ LIB_SUFFIXES lib/libmilter ROOT ${LIBMILTER_ROOT_DIR} MODULES libmilter)
+-ProcessPackage(LIBMEMCACHED LIBRARY memcached INCLUDE memcached.h INCLUDE_SUFFIXES include/libmemcached
+- LIB_SUFFIXES lib/libmemcached ROOT ${LIBMEMCACHED_ROOT_DIR} MODULES libmemcached)
+
+ IF(ENABLE_DKIM MATCHES "ON")
+ SET(WITH_DKIM 1)
+@@ -373,6 +372,14 @@ IF(ENABLE_DKIM MATCHES "ON")
+ ROOT ${OPENDKIM_ROOT_DIR} MODULES opendkim)
+ ENDIF()
+
++IF(ENABLE_MEMCACHED MATCHES "ON")
++ SET(WITH_MEMCACHED 1)
++ ProcessPackage(LIBMEMCACHED LIBRARY memcached
++ INCLUDE memcached.h INCLUDE_SUFFIXES include/libmemcached
++ LIB_SUFFIXES lib/libmemcached ROOT ${LIBMEMCACHED_ROOT_DIR}
++ MODULES libmemcached)
++ENDIF()
++
+ ################################ SOURCES SECTION ###########################
+ ADD_SUBDIRECTORY(hiredis)
+ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/hiredis")
+diff --git a/config.h.in b/config.h.in
+index b90d422..0ab2725 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -159,6 +159,8 @@
+
+ #cmakedefine WITH_SPF 1
+
++#cmakedefine WITH_MEMCACHED 1
++
+ #cmakedefine HAVE_SENDFILE 1
+ #cmakedefine HAVE_SYS_SENDFILE_H 1
+
+diff --git a/src/cache.c b/src/cache.c
+index d83b6e3..c84cafc 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -23,7 +23,9 @@
+ */
+
+ #include "config.h"
++#ifdef WITH_MEMCACHED
+ #include "libmemcached/memcached.h"
++#endif
+ #include "cfg_file.h"
+ #include "cache.h"
+ #include "hiredis.h"
+@@ -33,6 +35,7 @@
+
+ #define DEFAULT_REDIS_PORT 6379
+
++#ifdef WITH_MEMCACHED
+ static inline bool compat_memcached_success(int rc)
+ {
+ return (rc == MEMCACHED_BUFFERED ||
+@@ -60,6 +63,7 @@ static inline bool compat_memcached_fatal(int rc)
+ rc != MEMCACHED_SUCCESS &&
+ rc != MEMCACHED_VALUE);
+ }
++#endif
+
+ static struct cache_server *
+ rmilter_get_server (struct config_file *cfg, enum rmilter_query_type type,
+@@ -110,6 +114,7 @@ rmilter_get_server (struct config_file *cfg, enum rmilter_query_type type,
+ return serv;
+ }
+
++#ifdef WITH_MEMCACHED
+ static void
+ rmilter_format_libmemcached_config (struct config_file *cfg,
+ struct cache_server *serv,
+@@ -128,6 +133,7 @@ rmilter_format_libmemcached_config (struct config_file *cfg,
+ memcached_behavior_set (ctx, MEMCACHED_BEHAVIOR_POLL_TIMEOUT,
+ cfg->memcached_connect_timeout);
+ }
++#endif
+
+ bool
+ rmilter_query_cache (struct config_file *cfg, enum rmilter_query_type type,
+@@ -211,6 +217,7 @@ rmilter_query_cache (struct config_file *cfg, enum rmilter_query_type type,
+ }
+ }
+ else {
++#ifdef WITH_MEMCACHED
+ char *kval;
+ size_t value_len = 0;
+ uint32_t mflags;
+@@ -254,6 +261,10 @@ rmilter_query_cache (struct config_file *cfg, enum rmilter_query_type type,
+ }
+
+ memcached_free (mctx);
++#else
++ msg_err ("memcached query requested when memcached support is"
++ " not compiled");
++#endif
+ }
+ }
+
+@@ -340,6 +351,7 @@ rmilter_set_cache (struct config_file *cfg, enum rmilter_query_type type ,
+ }
+ }
+ else {
++#ifdef WITH_MEMCACHED
+ char *kval;
+ size_t value_len = 0;
+ uint32_t mflags;
+@@ -373,6 +385,10 @@ rmilter_set_cache (struct config_file *cfg, enum rmilter_query_type type ,
+ }
+
+ memcached_free (mctx);
++#else
++ msg_err ("memcached query requested when memcached support is"
++ " not compiled");
++#endif
+ }
+ }
+
+@@ -448,6 +464,7 @@ rmilter_delete_cache (struct config_file *cfg, enum rmilter_query_type type ,
+ }
+ }
+ else {
++#ifdef WITH_MEMCACHED
+ char *kval;
+ size_t value_len = 0;
+ uint32_t mflags;
+@@ -480,7 +497,12 @@ rmilter_delete_cache (struct config_file *cfg, enum rmilter_query_type type ,
+
+ upstream_ok (&serv->up, time (NULL));
+ memcached_free (mctx);
++#else
++ msg_err ("memcached query requested when memcached support is"
++ " not compiled");
++#endif
+ }
++
+ }
+
+ return true;
diff --git a/mail-filter/rmilter/metadata.xml b/mail-filter/rmilter/metadata.xml
index 09e261fd9b1..df4bd7ba25b 100644
--- a/mail-filter/rmilter/metadata.xml
+++ b/mail-filter/rmilter/metadata.xml
@@ -5,6 +5,9 @@
<email>djc@gentoo.org</email>
<name>Dirkjan Ochtman</name>
</maintainer>
+ <use>
+ <flag name="memcached">Enable support for memcached</flag>
+ </use>
<upstream>
<remote-id type="github">vstakhov/rmilter</remote-id>
</upstream>
diff --git a/mail-filter/rmilter/rmilter-1.8.4.ebuild b/mail-filter/rmilter/rmilter-1.8.4.ebuild
new file mode 100644
index 00000000000..920a78a32be
--- /dev/null
+++ b/mail-filter/rmilter/rmilter-1.8.4.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils user
+
+DESCRIPTION="Another sendmail milter for different mail checks"
+SRC_URI="https://github.com/vstakhov/rmilter/archive/${PV}.tar.gz -> ${P}.tar.gz"
+HOMEPAGE="https://github.com/vstakhov/rmilter"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+memcached"
+
+RDEPEND="dev-libs/libpcre
+ dev-libs/openssl:0
+ mail-filter/libmilter
+ mail-filter/opendkim
+ memcached? ( dev-libs/libmemcached )"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}/${PV}-optional-memcached.patch" )
+
+pkg_setup() {
+ enewgroup rmilter
+ enewuser rmilter -1 -1 /var/run/rmilter rmilter
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_MEMCACHED=$(usex memcached ON OFF)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}/rmilter.initd" rmilter
+ insinto /etc/rmilter
+ newins rmilter.conf.sample rmilter.conf.sample
+ newins rmilter-grey.conf rmilter-grey.conf
+}