Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 494910
Collapse All | Expand All

(-)oclhashcat-plus-bin-0.15.ebuild (-35 / +27 lines)
Lines 1-6 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
1
# Copyright 1999-2014 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/app-crypt/oclhashcat-plus-bin/oclhashcat-plus-bin-0.15.ebuild,v 1.1 2013/08/25 05:08:17 zerochaos Exp $
3
# $Header: $
4
4
5
EAPI=5
5
EAPI=5
6
6
Lines 9-15 Link Here
9
DESCRIPTION="An opencl multihash cracker"
9
DESCRIPTION="An opencl multihash cracker"
10
HOMEPAGE="http://hashcat.net/oclhashcat-plus/"
10
HOMEPAGE="http://hashcat.net/oclhashcat-plus/"
11
11
12
MY_P="oclHashcat-plus-${PV}"
12
MY_P="oclHashcat-${PV}"
13
SRC_URI="http://hashcat.net/files/${MY_P}.7z"
13
SRC_URI="http://hashcat.net/files/${MY_P}.7z"
14
14
15
LICENSE="hashcat"
15
LICENSE="hashcat"
Lines 19-25 Link Here
19
IUSE_VIDEO_CARDS="video_cards_fglrx
19
IUSE_VIDEO_CARDS="video_cards_fglrx
20
	video_cards_nvidia"
20
	video_cards_nvidia"
21
21
22
IUSE="virtualcl ${IUSE_VIDEO_CARDS}"
22
IUSE="${IUSE_VIDEO_CARDS}"
23
23
24
RDEPEND="sys-libs/zlib
24
RDEPEND="sys-libs/zlib
25
	video_cards_nvidia? ( >=x11-drivers/nvidia-drivers-319.37 )
25
	video_cards_nvidia? ( >=x11-drivers/nvidia-drivers-319.37 )
Lines 30-54 Link Here
30
S="${WORKDIR}/${MY_P}"
30
S="${WORKDIR}/${MY_P}"
31
31
32
RESTRICT="strip"
32
RESTRICT="strip"
33
QA_PREBUILT="*Hashcat-plus*.bin
33
QA_PREBUILT="*Hashcat*.bin
34
	    opt/${PN}/kernels/4098/*.llvmir"
34
	    opt/${PN}/kernels/4098/*.llvmir"
35
35
36
src_prepare() {
36
src_prepare() {
37
	use x86 && rm *Hashcat-plus64*
37
	use x86 && rm *Hashcat64*
38
	use amd64 && rm *Hashcat-plus32*
38
	use amd64 && rm *Hashcat32*
39
	use virtualcl || rm vclHashcat-plus*
40
39
41
	if ! use video_cards_fglrx; then
40
	if ! use video_cards_fglrx; then
42
		rm -r kernels/4098 || die
41
		rm -r kernels/4098 || die
43
		rm oclHashcat-plus*.bin || die
42
		rm ocl* || die
44
	fi
43
	fi
45
	if ! use video_cards_nvidia; then
44
	if ! use video_cards_nvidia; then
46
		rm -r kernels/4318 || die
45
		rm -r kernels/4318 || die
47
		rm cudaHashcat-plus*.bin || die
46
		rm cuda* || die
48
	fi
47
	fi
49
48
50
	#paxmark goes here so test and install works
49
	#paxmark goes here so test and install works
51
	pax-mark r *Hashcat-plus*.bin
50
	pax-mark r *Hashcat*.bin
52
}
51
}
53
52
54
src_test() {
53
src_test() {
Lines 61-80 Link Here
61
			einfo "Please run \"gpasswd -a portage video\" if the tests will fail"
60
			einfo "Please run \"gpasswd -a portage video\" if the tests will fail"
62
		fi
61
		fi
63
		if use amd64; then
62
		if use amd64; then
64
			./cudaHashcat-plus64.bin -a 3 -m 1500 nQCk49SiErOgk || die
63
			./cudaHashcat64.bin -a 3 -m 1500 nQCk49SiErOgk || die
65
		elif use x86; then
64
		elif use x86; then
66
			./cudaHashcat-plus32.bin -a 3 -m 1500 nQCk49SiErOgk || die
65
			./cudaHashcat32.bin -a 3 -m 1500 nQCk49SiErOgk || die
67
		fi
66
		fi
68
	fi
67
	fi
69
	if use video_cards_fglrx; then
68
	if use video_cards_fglrx; then
70
		addwrite /dev/ati
69
		addwrite /dev/ati
71
		if use amd64; then
70
		if use amd64; then
72
			./oclHashcat-plus64.bin -a 3 -m 1500 nQCk49SiErOgk || die
71
			./oclHashcat64.bin -a 3 -m 1500 nQCk49SiErOgk || die
73
		elif use x86; then
72
		elif use x86; then
74
			./oclHashcat-plus32.bin -a 3 -m 1500 nQCk49SiErOgk || die
73
			./oclHashcat32.bin -a 3 -m 1500 nQCk49SiErOgk || die
75
		fi
74
		fi
76
	fi
75
	fi
77
	rm eula.accepted hashcat.pot hashcat.dictstat
78
}
76
}
79
77
80
src_install() {
78
src_install() {
Lines 86-119 Link Here
86
84
87
	dodir /opt/bin
85
	dodir /opt/bin
88
86
89
	cat <<-EOF > "${ED}"/opt/bin/oclhashcat-plus
87
	cat <<-EOF > "${ED}"/opt/bin/oclhashcat
90
		#! /bin/sh
88
		#! /bin/sh
91
		echo "oclHashcat-plus and all related files have been installed in /opt/${PN}"
89
		echo "oclHashcat and all related files have been installed in /opt/${PN}"
92
		echo "Please run one of the following binaries to use gpu accelerated hashcat:"
90
		echo "Please run one of the following binaries to use gpu accelerated hashcat:"
93
	EOF
91
	EOF
94
92
95
	for x in oclHashcat-plus64.bin oclHashcat-plus32.bin cudaHashcat-plus64.bin cudaHashcat-plus32.bin vclHashcat-plus64.bin vclHashcat-plus32.bin
93
	for x in oclHashcat64.bin oclHashcat32.bin cudaHashcat64.bin cudaHashcat32.bin
96
	do
94
	do
97
		if [ -f "${ED}"/opt/${PN}/${x} ]
95
		if [ -f "${ED}"/opt/${PN}/${x} ]
98
		then
96
		then
99
			case "${x}" in
97
			case "${x}" in
100
				oclHashcat-plus64.bin)
98
				oclHashcat64.bin)
101
					echo "echo '64 bit ATI accelerated \"oclHashcat-plus64.bin\"'" >> "${ED}"/opt/bin/oclhashcat-plus
99
					echo "echo '64 bit ATI accelerated \"oclHashcat64.bin\"'" >> "${ED}"/opt/bin/oclhashcat
102
					;;
100
					;;
103
				oclHashcat-plus32.bin)
101
				oclHashcat32.bin)
104
					echo "echo '32 bit ATI accelerated \"oclHashcat-plus32.bin\"'" >> "${ED}"/opt/bin/oclhashcat-plus
102
					echo "echo '32 bit ATI accelerated \"oclHashcat32.bin\"'" >> "${ED}"/opt/bin/oclhashcat
105
					;;
103
					;;
106
				cudaHashcat-plus64.bin)
104
				cudaHashcat64.bin)
107
					echo "echo '64 bit NVIDIA accelerated \"cudaHashcat-plus64.bin\"'" >> "${ED}"/opt/bin/oclhashcat-plus
105
					echo "echo '64 bit NVIDIA accelerated \"cudaHashcat64.bin\"'" >> "${ED}"/opt/bin/oclhashcat
108
					;;
106
					;;
109
				cudaHashcat-plus32.bin)
107
				cudaHashcat32.bin)
110
					echo "echo '32 bit NVIDIA accelerated \"cudaHashcat-plus32.bin\"'" >> "${ED}"/opt/bin/oclhashcat-plus
108
					echo "echo '32 bit NVIDIA accelerated \"cudaHashcat32.bin\"'" >> "${ED}"/opt/bin/oclhashcat
111
					;;
112
				vclHashcat-plus64.bin)
113
					echo "echo '64 bit VirtualCL Cluster support \"vclHashcat-plus64.bin\"'" >> "${ED}"/opt/bin/oclhashcat-plus
114
					;;
115
				vclHashcat-plus32.bin)
116
					echo "echo '32 bit VirtualCL Cluster support \"vclHashcat-plus32.bin\"'" >> "${ED}"/opt/bin/oclhashcat-plus
117
					;;
109
					;;
118
			esac
110
			esac
119
111
Lines 131-140 Link Here
131
		fi
123
		fi
132
	done
124
	done
133
125
134
	fperms +x /opt/bin/oclhashcat-plus
126
	fperms +x /opt/bin/oclhashcat
135
	fowners -R root:video /opt/${PN}
127
	fowners -R root:video /opt/${PN}
136
	fperms g+w /opt/${PN}
128
	fperms g+w /opt/${PN}
137
	einfo "oclhashcat-plus can be run as user if you are in the video group"
129
	einfo "oclhashcat can be run as user if you are in the video group"
138
}
130
}
139
131
140
pkg_preinst() {
132
pkg_preinst() {

Return to bug 494910