commit:     783509647ee34bce32e2f249dfe44b2fcf1888ec
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  9 10:17:39 2016 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Wed Nov  9 10:19:56 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78350964

mail-filter/spamprobe: Fix building with giflib-5 (#574218 by André Malo)

Package-Manager: portage-2.3.2
RepoMan-Options: --force

 .../spamprobe/files/spamprobe-1.4d-giflib5.patch   | 27 +++++++++++++++++
 .../spamprobe/files/spamprobe-1.4d-libpng14.patch  |  4 +--
 ...mprobe-1.4d.ebuild => spamprobe-1.4d-r1.ebuild} | 35 +++++++++++-----------
 3 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/mail-filter/spamprobe/files/spamprobe-1.4d-giflib5.patch 
b/mail-filter/spamprobe/files/spamprobe-1.4d-giflib5.patch
new file mode 100644
index 00000000..761f58d
--- /dev/null
+++ b/mail-filter/spamprobe/files/spamprobe-1.4d-giflib5.patch
@@ -0,0 +1,27 @@
+diff -Nur spamprobe~/src/parser/GifParser.cc spamprobe/src/parser/GifParser.cc
+--- spamprobe~/src/parser/GifParser.cc
++++ spamprobe/src/parser/GifParser.cc
+@@ -81,7 +81,11 @@
+ GifParser::~GifParser()
+ {
+   if (m_gif) {
++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
++    DGifCloseFile(m_gif, NULL);
++#else
+     DGifCloseFile(m_gif);
++#endif
+   }
+ }
+ 
+@@ -99,7 +103,11 @@
+ void GifParser::openImage()
+ {
+   m_nextByteIndex = 0;
++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
++  m_gif = DGifOpen(this, readFromBuffer, NULL);
++#else
+   m_gif = DGifOpen(this, readFromBuffer);
++#endif
+   if (!m_gif) {
+     throw runtime_error("open gif failed");
+   }

diff --git a/mail-filter/spamprobe/files/spamprobe-1.4d-libpng14.patch 
b/mail-filter/spamprobe/files/spamprobe-1.4d-libpng14.patch
index c019f39..2be1b49 100644
--- a/mail-filter/spamprobe/files/spamprobe-1.4d-libpng14.patch
+++ b/mail-filter/spamprobe/files/spamprobe-1.4d-libpng14.patch
@@ -1,5 +1,5 @@
---- src/parser/PngParser.cc
-+++ src/parser/PngParser.cc
+--- a/src/parser/PngParser.cc
++++ b/src/parser/PngParser.cc
 @@ -53,9 +53,9 @@
  {
    if (m_initialized) {

diff --git a/mail-filter/spamprobe/spamprobe-1.4d.ebuild 
b/mail-filter/spamprobe/spamprobe-1.4d-r1.ebuild
similarity index 54%
rename from mail-filter/spamprobe/spamprobe-1.4d.ebuild
rename to mail-filter/spamprobe/spamprobe-1.4d-r1.ebuild
index 96dbfbe..b07fac4 100644
--- a/mail-filter/spamprobe/spamprobe-1.4d.ebuild
+++ b/mail-filter/spamprobe/spamprobe-1.4d-r1.ebuild
@@ -1,9 +1,8 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=2
-inherit eutils
+EAPI=6
 
 DESCRIPTION="Fast, intelligent, automatic spam detector using Bayesian 
analysis"
 HOMEPAGE="http://spamprobe.sourceforge.net/";
@@ -14,17 +13,21 @@ SLOT="0"
 KEYWORDS="amd64 ~ppc x86"
 IUSE="berkdb gif jpeg png"
 
-DEPEND="berkdb? ( >=sys-libs/db-3.2 )
-       gif? ( media-libs/giflib )
+RDEPEND="
+       berkdb? ( >=sys-libs/db-3.2:* )
+       gif? ( media-libs/giflib:= )
        jpeg? ( virtual/jpeg )
-       png? ( media-libs/libpng )"
-
-src_prepare() {
-       epatch "${FILESDIR}"/${PN}-1.4b-gcc43.patch \
-               "${FILESDIR}"/${P}-libpng14.patch \
-               "${FILESDIR}"/${P}+db-5.0.patch \
-               "${FILESDIR}"/${P}-gcc47.patch
-}
+       png? ( media-libs/libpng:0= )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.4b-gcc43.patch
+       "${FILESDIR}"/${P}-libpng14.patch
+       "${FILESDIR}"/${P}+db-5.0.patch
+       "${FILESDIR}"/${P}-gcc47.patch
+       "${FILESDIR}"/${P}-giflib5.patch
+)
 
 src_configure() {
        econf \
@@ -34,9 +37,7 @@ src_configure() {
 }
 
 src_install() {
-       emake DESTDIR="${D}" install || die
-       dodoc ChangeLog README.txt
-
+       default
        insinto /usr/share/${PN}/contrib
-       doins contrib/* || die
+       doins contrib/*
 }

Reply via email to