summaryrefslogtreecommitdiff
blob: 7aa8dc27595fff375d32ac06ff60f9e9f2a045f5 (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
62
63
64
65
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit fixheadtails

MY_VER=$(ver_rs 1- "")

DESCRIPTION="A checkpassword compatible authentication program using CRAM-MD5"
SRC_URI="https://www.fehcom.de/qmail/auth/${PN}-${MY_VER}_tgz.bin -> ${P}.tar.gz"
HOMEPAGE="https://www.fehcom.de/qmail/smtpauth.html"

LICENSE="public-domain RSA"
SLOT="0"
KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
IUSE=""

DEPEND="acct-user/cmd5checkpw"
RDEPEND="${DEPEND}"

pkg_setup() {
	if has_version "<net-mail/cmd5checkpw-0.30"; then
		ewarn
		ewarn "this version is in NO WAY COMPATIBLE with cmd5checkpw-0.2x"
		ewarn "it actually receives the authentication credentials"
		ewarn "in a different order then the old implementation"
		ewarn "see bug #100693 for details"
		ewarn "this version IS needed by >=qmail-1.03-r16"
		ewarn
	fi
}

PATCHES=(
	"${FILESDIR}"/euid_${MY_VER}.diff
	"${FILESDIR}"/reloc.diff
)

src_prepare() {
	default

	ht_fix_file Makefile
}

src_compile() {
	emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS} -o cmd5checkpw"
}

src_install() {
	insinto /etc
	insopts -m 400 -o cmd5checkpw
	doins "${FILESDIR}"/poppasswd

	exeinto /usr/bin
	exeopts -o cmd5checkpw -m 4755
	doexe cmd5checkpw

	doman cmd5checkpw.8
	einstalldocs
}

pkg_postinst() {
	chmod 400 "${EROOT}"/etc/poppasswd || die
	chown cmd5checkpw "${EROOT}"/etc/poppasswd || die
}