summaryrefslogtreecommitdiff
blob: 4c134793ee6220345de4c552ce5b1dc3e2ac489c (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Collection of utilities for parsing Internet mail messages"
HOMEPAGE="https://cr.yp.to/mess822.html"
SRC_URI="
	https://cr.yp.to/software/${P}.tar.gz
	https://dev.gentoo.org/~arkamar/distfiles/${P}-modern-compilers.patch.xz
"

LICENSE="public-domain"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"

RESTRICT="test"

RDEPEND="sys-apps/sed"

PATCHES=(
	"${WORKDIR}/${P}-modern-compilers.patch"
)

src_prepare() {
	default

	echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die
	echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die
	echo "/usr" > conf-home || die

	local sed_args=(
		-e "s:ar:$(tc-getAR):"
		-e "s:ranlib:$(tc-getRANLIB):"
	)
	sed -i "${sed_args[@]}" make-makelib.sh || die "sed make-makelib.sh failed"
}

src_install() {
	dodir /etc
	dodir /usr/share

	# Now that the commands are compiled, update the conf-home file to point
	# to the installation image directory.
	echo "${ED}/usr/" > conf-home || die

	local sed_args=(
		-e "s:\"/etc\":\"${ED}/etc\":"
		-e "s:lib:$(get_libdir):"
		-e "s:man:share/man:"
	)
	sed -i "${sed_args[@]}" hier.c || die "sed hier.c failed"

	emake setup

	einstalldocs
}