net-mail/b4: import 0.3.4
[gentoo.git] / net-mail / cmd5checkpw / cmd5checkpw-0.30-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit fixheadtails
7
8 MY_VER=$(ver_rs 1- "")
9
10 DESCRIPTION="A checkpassword compatible authentication program that used CRAM-MD5 authentication mode"
11 SRC_URI="https://www.fehcom.de/qmail/auth/${PN}-${MY_VER}_tgz.bin -> ${P}.tar.gz"
12 HOMEPAGE="https://www.fehcom.de/qmail/smtpauth.html"
13
14 LICENSE="public-domain RSA"
15 SLOT="0"
16 KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86"
17 IUSE=""
18
19 DEPEND="acct-user/cmd5checkpw"
20 RDEPEND="${DEPEND}"
21
22 pkg_setup() {
23         if has_version "<net-mail/cmd5checkpw-0.30"; then
24                 ewarn
25                 ewarn "this version is in NO WAY COMPATIBLE with cmd5checkpw-0.2x"
26                 ewarn "it actually receives the authentication credentials"
27                 ewarn "in a different order then the old implementation"
28                 ewarn "see bug #100693 for details"
29                 ewarn "this version IS needed by >=qmail-1.03-r16"
30                 ewarn
31         fi
32 }
33
34 PATCHES=(
35         "${FILESDIR}"/euid_${MY_VER}.diff
36         "${FILESDIR}"/reloc.diff
37 )
38
39 src_prepare() {
40         default
41
42         ht_fix_file Makefile
43 }
44
45 src_compile() {
46         emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS} -o cmd5checkpw"
47 }
48
49 src_install() {
50         insinto /etc
51         insopts -m 400 -o cmd5checkpw
52         doins "${FILESDIR}"/poppasswd
53
54         exeinto /usr/bin
55         exeopts -o cmd5checkpw -m 4755
56         doexe cmd5checkpw
57
58         doman cmd5checkpw.8
59         einstalldocs
60 }
61
62 pkg_postinst() {
63         chmod 400 "${EROOT}"/etc/poppasswd || die
64         chown cmd5checkpw "${EROOT}"/etc/poppasswd || die
65 }