diff options
author | prlw1 <prlw1@pkgsrc.org> | 2016-06-23 15:17:28 +0000 |
---|---|---|
committer | prlw1 <prlw1@pkgsrc.org> | 2016-06-23 15:17:28 +0000 |
commit | c747117676eec927c17bd5a7d5e2aa1361498572 (patch) | |
tree | a926150c19ac3c5245c3a20f049e3b5b681e261d /security | |
parent | c1d312254d6c1e84917a983407bfeea20ff59126 (diff) | |
download | pkgsrc-c747117676eec927c17bd5a7d5e2aa1361498572.tar.gz |
Update ecap_clamav_adapter to use C++11 in line with libecap (and squid3).
Diffstat (limited to 'security')
7 files changed, 148 insertions, 2 deletions
diff --git a/security/ecap_clamav_adapter/Makefile b/security/ecap_clamav_adapter/Makefile index 3529f2a4d06..51104fd9a61 100644 --- a/security/ecap_clamav_adapter/Makefile +++ b/security/ecap_clamav_adapter/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.1 2016/06/18 10:18:57 prlw1 Exp $ +# $NetBSD: Makefile,v 1.2 2016/06/23 15:17:28 prlw1 Exp $ DISTNAME= ecap_clamav_adapter-2.0.0 +PKGREVISION= 1 CATEGORIES= security MASTER_SITES= http://www.measurement-factory.com/tmp/ecap/ @@ -14,6 +15,8 @@ USE_LANGUAGES= c c++ USE_LIBTOOL= yes USE_TOOLS+= pkg-config +CXXFLAGS+= -std=c++11 + .include "../../security/clamav/buildlink3.mk" .include "../../www/libecap/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/security/ecap_clamav_adapter/distinfo b/security/ecap_clamav_adapter/distinfo index 867b4f31501..af3d5e341cc 100644 --- a/security/ecap_clamav_adapter/distinfo +++ b/security/ecap_clamav_adapter/distinfo @@ -1,6 +1,11 @@ -$NetBSD: distinfo,v 1.1 2016/06/18 10:18:57 prlw1 Exp $ +$NetBSD: distinfo,v 1.2 2016/06/23 15:17:28 prlw1 Exp $ SHA1 (ecap_clamav_adapter-2.0.0.tar.gz) = 2aaf6c970db3622d1380d353c4c38b21b6aab769 RMD160 (ecap_clamav_adapter-2.0.0.tar.gz) = 1869b60b4de16ef0202fd86c47c053413948674d SHA512 (ecap_clamav_adapter-2.0.0.tar.gz) = 882e66ad566220f68e59d41ea5c199af2745eaaa96610cdb7fe475811dbf87b01b5a6a97e6c9a729aecbf470aaae7082dbe502830aa88e86d32ae0d1acabde4b Size (ecap_clamav_adapter-2.0.0.tar.gz) = 383682 bytes +SHA1 (patch-src_Pointers.h) = 9e9b562c12af401de15aeeddb595a9134d31e1d6 +SHA1 (patch-src_Service.cc) = e14a4b29539c25f679b4f207cdd659ae752c0fac +SHA1 (patch-src_Service.h) = 5b4997278e7b67aa7ee4813ba5a7753e154cb2ae +SHA1 (patch-src_Xaction.cc) = bca8f15a1985b952f10c94a8c0c9953c91e4e310 +SHA1 (patch-src_Xaction.h) = 59348fcc787fda5d0b80021526561faef44e285d diff --git a/security/ecap_clamav_adapter/patches/patch-src_Pointers.h b/security/ecap_clamav_adapter/patches/patch-src_Pointers.h new file mode 100644 index 00000000000..fd96c19ee73 --- /dev/null +++ b/security/ecap_clamav_adapter/patches/patch-src_Pointers.h @@ -0,0 +1,25 @@ +$NetBSD: patch-src_Pointers.h,v 1.1 2016/06/23 15:17:28 prlw1 Exp $ + +https://bugs.launchpad.net/bugs/1595562 + +--- src/Pointers.h.orig 2015-11-08 18:07:35.000000000 +0000 ++++ src/Pointers.h +@@ -5,15 +5,14 @@ + #ifndef ECAP_CLAMAV_ADAPTER_POINTERS_H + #define ECAP_CLAMAV_ADAPTER_POINTERS_H + +-#include <libecap/common/forward.h> +-#include <libecap/common/memory.h> ++#include <memory> + + namespace Adapter { + + class Xaction; + +- typedef libecap::shared_ptr<Xaction> SharedXactionPointer; +- typedef libecap::weak_ptr<Xaction> XactionPointer; ++ typedef std::shared_ptr<Xaction> SharedXactionPointer; ++ typedef std::weak_ptr<Xaction> XactionPointer; + + } // namespace Adapter + diff --git a/security/ecap_clamav_adapter/patches/patch-src_Service.cc b/security/ecap_clamav_adapter/patches/patch-src_Service.cc new file mode 100644 index 00000000000..c85de2e3dca --- /dev/null +++ b/security/ecap_clamav_adapter/patches/patch-src_Service.cc @@ -0,0 +1,33 @@ +$NetBSD: patch-src_Service.cc,v 1.1 2016/06/23 15:17:28 prlw1 Exp $ + +https://bugs.launchpad.net/bugs/1595562 + +--- src/Service.cc.orig 2015-11-09 01:12:46.000000000 +0000 ++++ src/Service.cc +@@ -177,7 +177,7 @@ void Adapter::Service::setAll(const Opti + tmpFileNameTemplate = TmpFileNameTemplateDefault; + + // TODO: convert to std::unique_ptr when we require C++11. +- const std::auto_ptr<TricklingConfig> oldTricklingConfig(tricklingConfig_); ++ const std::unique_ptr<TricklingConfig> oldTricklingConfig(tricklingConfig_); + tricklingConfig_ = new TricklingConfig(); + + Cfgtor cfgtor(*this); +@@ -339,7 +339,7 @@ Adapter::Service::MadeXactionPointer + Adapter::Service::makeXaction(libecap::host::Xaction *hostx) + { + checkpoint(); +- const libecap::shared_ptr<Service> s = std::tr1::static_pointer_cast<Service>(self); ++ const std::shared_ptr<Service> s = std::static_pointer_cast<Service>(self); + SharedXactionPointer x(new Xaction(s, hostx)); + x->self = x; + x->serviceRegistration = new Xactions::iterator(xactions->insert(xactions->end(), x)); +@@ -385,7 +385,7 @@ Adapter::Service::tricklingConfig() + return *tricklingConfig_; + } + +-void Adapter::Service::finalizeTricklingConfig(const std::auto_ptr<TricklingConfig> &oldConfig) ++void Adapter::Service::finalizeTricklingConfig(const std::unique_ptr<TricklingConfig> &oldConfig) + { + if (!tricklingConfig_->dropSize) { + // TODO: Warn if at least one other trickling option was explicitly configured. diff --git a/security/ecap_clamav_adapter/patches/patch-src_Service.h b/security/ecap_clamav_adapter/patches/patch-src_Service.h new file mode 100644 index 00000000000..58813f3780f --- /dev/null +++ b/security/ecap_clamav_adapter/patches/patch-src_Service.h @@ -0,0 +1,15 @@ +$NetBSD: patch-src_Service.h,v 1.1 2016/06/23 15:17:28 prlw1 Exp $ + +https://bugs.launchpad.net/bugs/1595562 + +--- src/Service.h.orig 2015-11-09 01:19:35.000000000 +0000 ++++ src/Service.h +@@ -96,7 +96,7 @@ protected: + + private: + void notifyTimeouts(); +- void finalizeTricklingConfig(const std::auto_ptr<TricklingConfig> &oldConfig); ++ void finalizeTricklingConfig(const std::unique_ptr<TricklingConfig> &oldConfig); + void printTricklingConfig() const; + + // either sets how long we can wait for resume() or returns false diff --git a/security/ecap_clamav_adapter/patches/patch-src_Xaction.cc b/security/ecap_clamav_adapter/patches/patch-src_Xaction.cc new file mode 100644 index 00000000000..6f5911d586a --- /dev/null +++ b/security/ecap_clamav_adapter/patches/patch-src_Xaction.cc @@ -0,0 +1,33 @@ +$NetBSD: patch-src_Xaction.cc,v 1.1 2016/06/23 15:17:28 prlw1 Exp $ + +https://bugs.launchpad.net/bugs/1595562 + +--- src/Xaction.cc.orig 2015-11-09 01:33:00.000000000 +0000 ++++ src/Xaction.cc +@@ -89,7 +89,7 @@ void Adapter::MyAnswer::deliver() + DebugFun(flXaction) << "exiting " << this + + +-Adapter::Xaction::Xaction(libecap::shared_ptr<Service> aService, ++Adapter::Xaction::Xaction(std::shared_ptr<Service> aService, + libecap::host::Xaction *aHostX): + serviceRegistration(0), + service(aService), +@@ -347,7 +347,7 @@ void Adapter::Xaction::noteVbContentDone + + vbFile->flush(); + +- libecap::shared_ptr<Antivirus> scanner = service->scanner; ++ std::shared_ptr<Antivirus> scanner = service->scanner; + Must(scanner); + + if (service->makesAsyncXactions()) { +@@ -411,7 +411,7 @@ void Adapter::Xaction::useVirgin() + + void Adapter::Xaction::useStored() + { +- libecap::shared_ptr<libecap::Message> adapted = hostx().virgin().clone(); ++ std::shared_ptr<libecap::Message> adapted = hostx().virgin().clone(); + Must(adapted != 0); + + Must(adapted->body()); diff --git a/security/ecap_clamav_adapter/patches/patch-src_Xaction.h b/security/ecap_clamav_adapter/patches/patch-src_Xaction.h new file mode 100644 index 00000000000..91dc9c39932 --- /dev/null +++ b/security/ecap_clamav_adapter/patches/patch-src_Xaction.h @@ -0,0 +1,32 @@ +$NetBSD: patch-src_Xaction.h,v 1.1 2016/06/23 15:17:28 prlw1 Exp $ + +https://bugs.launchpad.net/bugs/1595562 + +--- src/Xaction.h.orig 2015-11-09 01:18:50.000000000 +0000 ++++ src/Xaction.h +@@ -13,7 +13,6 @@ + #include <libecap/adapter/xaction.h> + #include <libecap/host/host.h> + #include <libecap/host/xaction.h> +-#include <libecap/common/memory.h> + #include <libecap/common/message.h> + #include <libecap/common/header.h> + #include <libecap/common/names.h> +@@ -47,7 +46,7 @@ private: + class Xaction: public libecap::adapter::Xaction, public Antivirus::User + { + public: +- Xaction(libecap::shared_ptr<Service> aService, libecap::host::Xaction *aHostX); ++ Xaction(std::shared_ptr<Service> aService, libecap::host::Xaction *aHostX); + virtual ~Xaction(); + + // meta-information for the host transaction +@@ -166,7 +165,7 @@ private: + + void disconnect(); // expect no more notifications from Service or Host + +- libecap::shared_ptr<const Service> service; // configuration access ++ std::shared_ptr<const Service> service; // configuration access + libecap::host::Xaction *hostx_; // host transaction representative + libecap::Area uri; // Request-URI from headers, for logging + |