98156824665fb5f8670a5a635abee5f65e4f21d8
[gentoo.git] / app-crypt / chntpw / chntpw-140201.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 toolchain-funcs
7
8 DESCRIPTION="Offline Windows NT Password & Registry Editor"
9 HOMEPAGE="http://pogostick.net/~pnh/ntpasswd/"
10 SRC_URI="http://pogostick.net/~pnh/ntpasswd/${PN}-source-${PV}.zip"
11
12 LICENSE="GPL-2 LGPL-2.1"
13 SLOT="0"
14 KEYWORDS="amd64 ~ppc ~x86"
15 IUSE="libressl static"
16
17 RDEPEND="!libressl? ( dev-libs/openssl:0= )
18         libressl? ( dev-libs/libressl:0= )"
19 DEPEND="${RDEPEND}
20         app-arch/unzip
21         static? ( dev-libs/openssl:0[static-libs] )"
22
23 DOCS=(
24         HISTORY.txt
25         README.txt
26         WinReg.txt
27         regedit.txt
28 )
29
30 src_prepare() {
31         default
32         sed -i -e '/-o/s:$(CC):$(CC) $(LDFLAGS):' Makefile || die
33
34         if ! use static ; then
35                 sed -i -e "/^all:/s/ \(chntpw\|reged\).static//g" Makefile || die
36         fi
37
38         emake clean
39 }
40
41 src_compile() {
42         emake \
43                 CC="$(tc-getCC)" \
44                 CFLAGS="${CFLAGS} -DUSEOPENSSL -Wall" \
45                 LIBS="-lcrypto"
46 }
47
48 src_install() {
49         einstalldocs
50         dobin chntpw cpnt reged
51
52         if use static; then
53                 dobin {chntpw,reged}.static
54         fi
55 }