* Made a rev for old pyrit before messing around

This commit is contained in:
grimmlin 2009-02-24 18:12:41 +00:00
parent 4662280b95
commit 7459d32ab5
4 changed files with 173 additions and 0 deletions

View file

@ -1,3 +1,6 @@
AUX gentoo-64.patch 1846 RMD160 aa1e258f8a0d5d6354c9b211ec6214719a0ea781 SHA1 0cdd7ee6fc67e02cb55f633f514eb0944af5f5e6 SHA256 f9ebca6aafc6c1c20e0a80b72b8e91ba03478cf8179ab5dc68ace7cd7759e872
AUX gentoo.patch 1834 RMD160 91769f58483d059fa9ca1223c3f314a44241033f SHA1 1c51b1e4518f5f969fa50b8956ecc3645fbe66a7 SHA256 54b80b091c732b9aedc166870554e9628fe1315622918dfa8de88fdd6db468c2
AUX pyrit-0.1-64.patch 1846 RMD160 aa1e258f8a0d5d6354c9b211ec6214719a0ea781 SHA1 0cdd7ee6fc67e02cb55f633f514eb0944af5f5e6 SHA256 f9ebca6aafc6c1c20e0a80b72b8e91ba03478cf8179ab5dc68ace7cd7759e872
AUX pyrit-0.1.patch 1834 RMD160 91769f58483d059fa9ca1223c3f314a44241033f SHA1 1c51b1e4518f5f969fa50b8956ecc3645fbe66a7 SHA256 54b80b091c732b9aedc166870554e9628fe1315622918dfa8de88fdd6db468c2
EBUILD pyrit-0.1.ebuild 2897 RMD160 afad2d595d50a304278ae2fac9fbd2ec5ee7b2e4 SHA1 60066ca960464b36922440866b74d2af0085540f SHA256 85567c2496c616d0a28c330dda23fe4bc8976460aa31d8c0119f71eb56c3cbd4
EBUILD pyrit-9999.ebuild 2888 RMD160 ebb11cccfe7f5c62aebaa1efb767ee72c845a5de SHA1 d28bbc4f91c5885c9fb494f8511f193305c7279e SHA256 714f2e77c783a2e963239b300111b0deef8ee45f7f2624f42ca97fbeca0f02b1

View file

@ -0,0 +1,35 @@
Index: cpyrit/setup.py
===================================================================
--- cpyrit/setup.py (revision 65)
+++ cpyrit/setup.py (working copy)
@@ -20,8 +20,8 @@
print "... done."
libraries.extend(['cuda', 'cudart'])
extra_compile_args.append('-DHAVE_CUDA')
- include_dirs.append('/usr/local/cuda/include')
- library_dirs.append('/usr/local/cuda/lib')
+ include_dirs.append('/opt/cuda/include')
+ library_dirs.append('/opt/cuda/lib')
extra_objects.append('cpyrit_cuda.o')
if 'HAVE_PADLOCK' in sys.argv:
sys.argv.remove('HAVE_PADLOCK')
@@ -38,14 +38,14 @@
f.write(re.sub("W\[(.+?)\]", replace_eval, s))
f.close()
subprocess.check_call('mkdir -p brook',shell=True);
- subprocess.check_call('/usr/local/amdbrook/sdk/bin/brcc -p cal -r -o brook/cpyrit cpyrit_stream_pp.br', shell=True);
+ subprocess.check_call('brcc -p cal -r -o brook/cpyrit cpyrit_stream_pp.br', shell=True);
print "... done."
- subprocess.check_call('g++ -O2 -I/usr/local/amdbrook/sdk/include/ -Ibrook -o brook/cpyrit.o -c brook/cpyrit.cpp',shell=True);
- subprocess.check_call('g++ -O2 -I/usr/local/amdbrook/sdk/include/ -Ibrook -c cpyrit_stream.cpp',shell=True);
+ subprocess.check_call('g++ -fpic -O2 -I/opt/amdbrook/include/ -Ibrook -o brook/cpyrit.o -c brook/cpyrit.cpp',shell=True);
+ subprocess.check_call('g++ -fpic -O2 -I/opt/amdbrook/include/ -Ibrook -c cpyrit_stream.cpp',shell=True);
libraries.extend(['brook'])
extra_compile_args.append('-DHAVE_STREAM')
- include_dirs.append('/usr/local/amdbrook/sdk/include')
- library_dirs.append('/usr/local/amdbrook/sdk/lib')
+ include_dirs.append('/opt/amdbrook/include')
+ library_dirs.append('/opt/amdbrook/lib')
extra_objects.append('cpyrit_stream.o')
extra_objects.append('brook/cpyrit.o')

View file

@ -0,0 +1,35 @@
Index: cpyrit/setup.py
===================================================================
--- cpyrit/setup.py (revision 66)
+++ cpyrit/setup.py (working copy)
@@ -20,8 +20,8 @@
print "... done."
libraries.extend(['cuda', 'cudart'])
extra_compile_args.append('-DHAVE_CUDA')
- include_dirs.append('/usr/local/cuda/include')
- library_dirs.append('/usr/local/cuda/lib')
+ include_dirs.append('/opt/cuda/include')
+ library_dirs.append('/opt/cuda/lib')
extra_objects.append('cpyrit_cuda.o')
if 'HAVE_PADLOCK' in sys.argv:
sys.argv.remove('HAVE_PADLOCK')
@@ -38,14 +38,14 @@
f.write(re.sub("W\[(.+?)\]", replace_eval, s))
f.close()
subprocess.check_call('mkdir -p brook',shell=True);
- subprocess.check_call('/usr/local/amdbrook/sdk/bin/brcc -p cal -r -o brook/cpyrit cpyrit_stream_pp.br', shell=True);
+ subprocess.check_call('brcc -p cal -r -o brook/cpyrit cpyrit_stream_pp.br', shell=True);
print "... done."
- subprocess.check_call('g++ -O2 -I/usr/local/amdbrook/sdk/include/ -Ibrook -o brook/cpyrit.o -c brook/cpyrit.cpp',shell=True);
- subprocess.check_call('g++ -O2 -I/usr/local/amdbrook/sdk/include/ -Ibrook -c cpyrit_stream.cpp',shell=True);
+ subprocess.check_call('g++ -O2 -I/opt/amdbrook/include/ -Ibrook -o brook/cpyrit.o -c brook/cpyrit.cpp',shell=True);
+ subprocess.check_call('g++ -O2 -I/opt/amdbrook/include/ -Ibrook -c cpyrit_stream.cpp',shell=True);
libraries.extend(['brook'])
extra_compile_args.append('-DHAVE_STREAM')
- include_dirs.append('/usr/local/amdbrook/sdk/include')
- library_dirs.append('/usr/local/amdbrook/sdk/lib')
+ include_dirs.append('/opt/amdbrook/include')
+ library_dirs.append('/opt/amdbrook/lib')
extra_objects.append('cpyrit_stream.o')
extra_objects.append('brook/cpyrit.o')

View file

@ -0,0 +1,100 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils python distutils subversion
DESCRIPTION="A GPU-based WPA-PSK and WPA2-PSK cracking tool"
HOMEPAGE="http://code.google.com/p/pyrit/"
ESVN_REPO_URI="http://pyrit.googlecode.com/svn/trunk/@66"
LICENSE="GPL-3"
KEYWORDS="-*"
IUSE="cuda padlock stream"
SLOT="0"
DEPEND="stream? ( dev-util/amd-stream-sdk-bin )
cuda? ( dev-util/nvidia-cuda-sdk )"
RDEPEND="${DEPEND}"
src_compile() {
MYOPTS=""
if use amd64; then
epatch "${FILESDIR}/pyrit-0.1-64.patch"
MY_ARCH="x86_64"
else
epatch "${FILESDIR}/pyrit-0.1.patch"
MY_ARCH="i686"
fi
cd cpyrit
python setup.py build || die "Build cpu failed"
python setup.py clean
mv build/lib.linux-"${MY_ARCH}"-2.5 build/cpu
if use padlock; then
sed -e 's/_cpyrit.*(/_cpyrit_padlock(/g' -i cpyrit.c
sed -e 's/_cpyrit.*\"/_cpyrit_padlock\"/g' -i cpyrit.c
sed -e '/import/ s/_cpyrit.*/_cpyrit_padlock as _cpyrit/' -i cpyrit.py
python setup.py HAVE_PADLOCK build || die "Build padlock failed"
python setup.py clean
mv build/lib.linux-"${MY_ARCH}"-2.5 build/padlock
fi
if use cuda; then
sed -e 's/_cpyrit.*(/_cpyrit_cuda(/g' -i cpyrit.c
sed -e 's/_cpyrit.*\"/_cpyrit_cuda\"/g' -i cpyrit.c
sed -e '/import/ s/_cpyrit.*/_cpyrit_cuda as _cpyrit/' -i cpyrit.py
python setup.py HAVE_CUDA build || die "Build cuda failed"
python setup.py clean
rm cpyrit_cuda.linkinfo
mv build/lib.linux-"${MY_ARCH}"-2.5 build/cuda
fi
if use stream; then
sed -e 's/_cpyrit.*(/_cpyrit_stream(/g' -i cpyrit.c
sed -e 's/_cpyrit.*\"/_cpyrit_stream\"/g' -i cpyrit.c
sed -e '/import/ s/_cpyrit.*/_cpyrit_stream as _cpyrit/' -i cpyrit.py
python setup.py HAVE_STREAM build || die "Build stream failed"
python setup.py clean
mv build/lib.linux-"${MY_ARCH}"-2.5 build/stream
fi
}
src_install() {
python_version
insinto /usr/lib/python"${PYVER}"/site-packages/
cd "${S}"/cpyrit/build/cpu
doins _cpyrit.so
doins cpyrit.py
cd "${S}"
dosbin pyrit.py
if use padlock; then
cd "${S}"/cpyrit/build/padlock
newins _cpyrit.so _cpyrit_padlock.so
newins cpyrit.py cpyrit_padlock.py
cd "${S}"
sed -e '/import/ s/cpyrit.*/cpyrit_padlock as cpyrit/' -i pyrit.py
newsbin pyrit.py pyrit-padlock.py
fi
if use cuda; then
cd "${S}"/cpyrit/build/cuda
newins _cpyrit.so _cpyrit_cuda.so
newins cpyrit.py cpyrit_cuda.py
cd "${S}"
sed -e '/import/ s/cpyrit.*/cpyrit_cuda as cpyrit/' -i pyrit.py
newsbin pyrit.py pyrit-cuda.py
fi
if use stream; then
cd "${S}"/cpyrit/build/stream
newins _cpyrit.so _cpyrit_stream.so
newins cpyrit.py cpyrit_stream.py
cd "${S}"
sed -e '/import/ s/cpyrit.*/cpyrit_stream as cpyrit/' -i pyrit.py
newsbin pyrit.py pyrit-stream.py
fi
dosbin "${S}/contrib/create_hashdb.py"
}
pkg_postinst() {
python_mod_optimize
}
pkg_postrm() {
python_mod_cleanup
}