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

EAPI=7

inherit fixheadtails toolchain-funcs

DESCRIPTION="A uniform password checking interface for root applications"
HOMEPAGE="https://cr.yp.to/checkpwd.html"
SRC_URI="https://cr.yp.to/checkpwd/${P}.tar.gz"

LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
IUSE="static"
RESTRICT="mirror bindist"

PATCHES=(
	"${FILESDIR}"/${P}-errno.patch
	"${FILESDIR}"/${P}-exit.patch
	"${FILESDIR}"/${P}-headers.patch
)

src_prepare() {
	default

	ht_fix_file Makefile print-cc.sh

	use static && append-ldflags -static

	echo "$(tc-getCC) ${CFLAGS} ${CPPFLAGS}" > ./conf-cc || die 'Patching conf-cc failed.'
	echo "$(tc-getCC) ${LDFLAGS}" > ./conf-ld || die 'Patching conf-ld failed.'
}

src_install() {
	dobin checkpassword
	einstalldocs
}