Ticket #34539: ophcrack.diff

File ophcrack.diff, 2.2 KB (added by kurthindenburg (Kurt Hindenburg), 10 years ago)

2nd atttempt

  • Portfile

     
     1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
    12# $Id$
    23
    34PortSystem          1.0
     
    2324
    2425configure.args      --disable-gui --disable-graph
    2526
    26 set hasMoreThan512MBofRAM 0
    27 catch {set hasMoreThan512MBofRAM [expr [sysctl hw.memsize] >= 536870912]}
     27if {[variant_isset tables]} {
     28    set hasMoreThan512MBofRAM 0
     29    catch {set hasMoreThan512MBofRAM [expr [sysctl hw.memsize] >= 536870912]}
     30    if ${hasMoreThan512MBofRAM} {
     31        default_variants +fast_tables
     32    } else {
     33        default_variants +small_tables
     34    }
     35}
    2836
    2937post-extract {
    3038    if {[variant_isset tables]} {
    3139        set tables_dir ${destroot}${prefix}/share/${name}/tables
    3240       
    33         if ${hasMoreThan512MBofRAM} {
     41        if {[variant_isset fast_tables]} {
    3442            xinstall -m 755 -d ${tables_dir}/xp_free_fast
    3543            system "unzip ${distpath}/tables_xp_free_fast.zip -d ${tables_dir}/xp_free_fast"
    3644        } else {
     
    6472
    6573post-activate {
    6674    if {[variant_isset tables]} {
    67 
    6875        notes-append "
    6976****************************************************
    7077
     
    8390}
    8491
    8592variant tables description {Installs the free rainbow tables for Windows XP and Vista (700+ MB)} {
    86     if ${hasMoreThan512MBofRAM} {
     93    if {[variant_isset fast_tables]} {
    8794        distfiles-append tables_xp_free_fast.zip
    8895        checksums-append tables_xp_free_fast.zip sha1 141b8be045055068e8bae6542d484fffdd452641
    8996    } else {
     
    103110    }
    104111}
    105112
     113variant small_tables conflicts fast_tables description {Forces the use of the small rainbow tables (typically for use on computers with <512MB RAM)} requires tables {
     114}
     115
     116variant fast_tables conflicts small_tables description {Forces the use of the fast rainbow tables (typically for use on computers with >512MB RAM)} requires tables {
     117}
     118
    106119livecheck.type  regex
    107120livecheck.url   ${homepage}/download.php?type=ophcrack
    108121livecheck.regex The latest version of ophcrack is (\\d(\\.\\d+)*)