Ticket #20650: Portfile

File Portfile, 3.6 KB (added by 0xced (Cédric Luthi), 15 years ago)

ophcrack 3.3.1 Portfile

Line 
1# $Id$
2
3PortSystem          1.0
4
5name                ophcrack
6version             3.3.1
7categories          security
8maintainers         gmail.com:cedric.luthi
9description         Microsoft Windows password cracker
10long_description    Ophcrack is a free Windows password cracker based on \
11                    rainbow tables. It is a very efficient implementation \
12                    of rainbow tables done by the inventors of the method.
13
14homepage            http://ophcrack.sourceforge.net
15platforms           darwin
16master_sites        sourceforge
17
18use_bzip2           yes
19checksums           ${distname}${extract.suffix} md5 740eef54e9082f26851e15c1cb4ef55c \
20                    ${distname}${extract.suffix} sha1 65982407f0b7738940d5444530492ce1d81899f9 \
21                    ${distname}${extract.suffix} rmd160 3a4562e861eb90030c68b067a02cc41271ee8c66
22
23configure.args      --disable-gui --disable-graph
24
25set hasMoreThan512MBofRAM [expr [gets [open "|sysctl -n hw.memsize"]] >= 536870912]
26
27post-extract {
28    if {[variant_isset tables]} {
29        set tables_dir ${destroot}${prefix}/share/${name}/tables
30       
31        if ${hasMoreThan512MBofRAM} {
32            xinstall -m 755 -d ${tables_dir}/xp_free_fast
33            system "unzip ${distpath}/tables_xp_free_fast.zip -d ${tables_dir}/xp_free_fast"
34        } else {
35            xinstall -m 755 -d ${tables_dir}/xp_free_small
36            system "unzip ${distpath}/tables_xp_free_small.zip -d ${tables_dir}/xp_free_small"
37        }
38       
39        xinstall -m 755 -d ${tables_dir}/vista_free
40        system "unzip ${distpath}/tables_vista_free.zip -d ${tables_dir}/vista_free"
41    }
42}
43
44pre-build {
45    if {[variant_isset tables]} {
46        reinplace "s|QString()|QString(\"${prefix}/share/${name}/tables\")|g" ${worksrcpath}/src/gui/tabledialog.cpp
47    }
48}
49
50destroot {
51    if {[variant_isset gui]} {
52        xinstall -m 755 -d ${destroot}${applications_dir}
53        copy ${worksrcpath}/src/${name}.app ${destroot}${applications_dir}
54    } else {
55        xinstall -m 755 -d ${destroot}${prefix}/bin
56        copy ${worksrcpath}/src/${name} ${destroot}${prefix}/bin
57    }
58}
59
60post-activate {
61    if {[variant_isset tables]} {
62        ui_msg "****************************************************"
63        ui_msg ""
64        ui_msg "  Free rainbow tables have been installed into"
65        ui_msg "  ${prefix}/share/${name}/tables"
66        ui_msg ""
67        ui_msg "  Visit http://ophcrack.sourceforge.net/tables.php"
68        ui_msg "  to get more (non-free) rainbow tables."
69        ui_msg ""
70        ui_msg "****************************************************"
71    }
72}
73
74variant gui description {Builds the GUI version instead of the CLI version, requires the qt4-mac port} {
75    depends_lib-append port:qt4-mac
76   
77    configure.args-delete --disable-gui
78    configure.args-append --with-libqt4=${prefix}/libexec/qt4-mac
79}
80
81variant tables description {Installs the free rainbow tables for Windows XP and Vista (700+ MB)} {
82    if ${hasMoreThan512MBofRAM} {
83        distfiles-append tables_xp_free_fast.zip
84        checksums-append tables_xp_free_fast.zip sha1 141b8be045055068e8bae6542d484fffdd452641
85    } else {
86        distfiles-append tables_xp_free_small.zip
87        checksums-append tables_xp_free_small.zip sha1 2933bc9e483f79966ee02569d3d91b4d0ecc5a8d
88    }
89   
90    distfiles-append tables_vista_free.zip
91    checksums-append tables_vista_free.zip sha1 31425c6b35679df53ba67cb1cc3807501eec3ced
92   
93    extract.only ${distname}${extract.suffix}
94}
95
96livecheck.check regex
97livecheck.url   ${homepage}/download.php?type=ophcrack
98livecheck.regex The latest version of ophcrack is (\\d(\\.\\d+)*)