blob: 80ad2d706c92e94985bf3f28952d92b901971a2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools edo
DESCRIPTION="Grep for mbox files"
HOMEPAGE="https://mboxgrep.org/"
SRC_URI="https://github.com/dspiljar/mboxgrep/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="amd64 ~ppc x86"
IUSE="+pcre"
RDEPEND="
app-arch/bzip2
virtual/zlib:=
pcre? ( dev-libs/libpcre2:=[pcre32] )
"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-0.7.13-rm_getopt.patch
# PR merged https://github.com/dspiljar/mboxgrep/pull/6.patch
# (except commit for getopt)
"${FILESDIR}"/${P}-fix_c23.patch
)
DOCS=( AUTHORS.md NEWS.md README.md TODO.md )
src_prepare() {
default
# Remove old getopt part. It just works with getopt.h from glibc or musl.
rm src/getopt.h || die
eautoreconf
}
src_configure() {
econf $(usev !pcre --without-pcre2)
}
src_test() {
# create a mail
cat > "${T}"/mailtest <<-_EOF_ || die
From fake@example.com Mon Sep 17 00:00:00 2001
From: FAKE USER <fake@example.com>
Date: Mon, 28 Jul 2025 00:00:00 +0200
Subject: [TEST] Basic
To: test@example.com
Bla
_EOF_
# delete the content if it matches
edo ./src/mboxgrep --debug --mailbox-format=mbox --delete \
'^To:\s([a-z]{4})\@\w+\.([a-z]{3})$' "${T}"/mailtest
[[ -s "${T}"/mailtest ]] && die "Test failed. ${T}/mailtest should be empty."
}
|