commit:     8c4407a0939ac072040c56f2f00b60fdc7e11176
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun May 17 12:05:59 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun May 17 12:10:20 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c4407a0

net-mail/mboxgrep: Fix building with CFLAGS=-fno-common

Also:
- Add missing dependencies
- EAPI=7
- New HOMEPAGE
- Use _DEFAULT_SOURCE to suppress compiler warning

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Closes: https://bugs.gentoo.org/707224
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 .../files/mboxgrep-0.7.9-_DEFAULT_SOURCE.patch     | 11 ++++++
 .../mboxgrep/files/mboxgrep-0.7.9-fno-common.patch | 20 +++++++++++
 net-mail/mboxgrep/mboxgrep-0.7.9-r2.ebuild         | 42 ++++++++++++++++++++++
 net-mail/mboxgrep/metadata.xml                     |  3 ++
 4 files changed, 76 insertions(+)

diff --git a/net-mail/mboxgrep/files/mboxgrep-0.7.9-_DEFAULT_SOURCE.patch 
b/net-mail/mboxgrep/files/mboxgrep-0.7.9-_DEFAULT_SOURCE.patch
new file mode 100644
index 00000000000..fe7ffec2d57
--- /dev/null
+++ b/net-mail/mboxgrep/files/mboxgrep-0.7.9-_DEFAULT_SOURCE.patch
@@ -0,0 +1,11 @@
+--- a/src/misc.c
++++ b/src/misc.c
+@@ -19,7 +19,7 @@
+   $Id: misc.c,v 1.13 2003/04/06 21:01:49 dspiljar Exp $ */
+ 
+ #define _XOPEN_SOURCE  /* Pull in strptime(3) from time.h */
+-#define _BSD_SOURCE    /* Compensate for _XOPEN_SOURCE to pull in strdup(3)
++#define _DEFAULT_SOURCE    /* Compensate for _XOPEN_SOURCE to pull in 
strdup(3)
+                         * from string.h. */
+ 
+ #include <config.h>

diff --git a/net-mail/mboxgrep/files/mboxgrep-0.7.9-fno-common.patch 
b/net-mail/mboxgrep/files/mboxgrep-0.7.9-fno-common.patch
new file mode 100644
index 00000000000..09c8388998c
--- /dev/null
+++ b/net-mail/mboxgrep/files/mboxgrep-0.7.9-fno-common.patch
@@ -0,0 +1,20 @@
+--- a/src/mboxgrep.h
++++ b/src/mboxgrep.h
+@@ -129,6 +129,6 @@
+ }
+ option_t;
+ 
+-option_t config;
++extern option_t config;
+ 
+ #endif /* MBOXGREP_H */
+--- a/src/main.c
++++ b/src/main.c
+@@ -57,6 +57,7 @@
+ int count = 0;
+ void *tmpp;
+ checksum_t *cs;
++option_t config;
+ 
+ int
+ main (int argc, char **argv)

diff --git a/net-mail/mboxgrep/mboxgrep-0.7.9-r2.ebuild 
b/net-mail/mboxgrep/mboxgrep-0.7.9-r2.ebuild
new file mode 100644
index 00000000000..5e42763bd88
--- /dev/null
+++ b/net-mail/mboxgrep/mboxgrep-0.7.9-r2.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="Grep for mbox files"
+SRC_URI="mirror://sourceforge/mboxgrep/${P}.tar.gz"
+HOMEPAGE="https://datatipp.se/mboxgrep/";
+
+SLOT="0"
+LICENSE="GPL-2+"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="dmalloc"
+
+RDEPEND="
+       app-arch/bzip2
+       dev-libs/libpcre
+       sys-libs/zlib
+       dmalloc? ( dev-libs/dmalloc )
+"
+DEPEND="
+       ${RDEPEND}
+"
+PATCHES=(
+       "${FILESDIR}"/${P}-_DEFAULT_SOURCE.patch
+       "${FILESDIR}"/${P}-fno-common.patch
+       "${FILESDIR}"/${P}-ldflags.patch
+)
+
+src_configure() {
+       econf \
+               $(use_with dmalloc no yes)
+}
+
+src_install() {
+       emake \
+               prefix="${D}"/usr \
+               mandir="${D}"/usr/share/man \
+               infodir="${D}"/usr/share/info \
+               install
+       dodoc ChangeLog NEWS TODO README
+}

diff --git a/net-mail/mboxgrep/metadata.xml b/net-mail/mboxgrep/metadata.xml
index dff8618ac7e..63436f59f91 100644
--- a/net-mail/mboxgrep/metadata.xml
+++ b/net-mail/mboxgrep/metadata.xml
@@ -2,6 +2,9 @@
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
        <!-- maintainer-needed -->
+<use>
+<flag name='dmalloc'>Enable debugging using <pkg>dev-libs/dmalloc</pkg></flag>
+</use>
        <upstream>
                <remote-id type="sourceforge">mboxgrep</remote-id>
        </upstream>

Reply via email to