Hello, I have written a port for ophcrack, a windows password cracker. See http://trac.macports.org/projects/macports/ticket/11114 Ophcrack doesn't work on powerpc machines, I think it's because of endianness issues. I have written a post-main (see http:// trac.macports.org/projects/macports/attachment/ticket/11114/Portfile) that checks for intel processor and exits with an error if it fails. Is it a good idea ? Is there a better/standard way to deal with port supporting only specific architectures ? Regards. Cédric Luthi
On Dec 7, 2006, at 4:36 AM, Cédric Luthi wrote:
I have written a port for ophcrack, a windows password cracker. See http://trac.macports.org/projects/macports/ticket/11114
Ophcrack doesn't work on powerpc machines, I think it's because of endianness issues. I have written a post-main (see http:// trac.macports.org/projects/macports/attachment/ticket/11114/ Portfile) that checks for intel processor and exits with an error if it fails. Is it a good idea ? Is there a better/standard way to deal with port supporting only specific architectures ?
You can use the platform variants: platform powerpc { stuff that only gets run on PPC machines } platform i386 { stuff that only gets run on i386 machines } Macports (base) will automatically run the variant that matches the machine it's running on. -- Daniel J. Luke +========================================================+ | *---------------- dluke@geeklair.net ----------------* | | *-------------- http://www.geeklair.net -------------* | +========================================================+ | Opinions expressed are mine and do not necessarily | | reflect the opinions of my employer. | +========================================================+
I checked why it doesn't work on powerpc and it turns out it's actually an endianness problem. So I think the best way is to detect endianness with post-main { if { [string compare ${os.endian} "little"] != 0 } { ui_error "${name} only runs on little-endian machines." exit 1 } } I don't exactly know how many different platforms the port system is supposed to work on so I think it's preferable to check it this way rather than listing all the platforms. Still, I haven't found a single port using post-main, but I haven't found a port that only work on a specific endianness, so the question remains: is it acceptable to test compatibility with this post-main script ? Anyway, I have posted an updated portfile: http://trac.macports.org/ projects/macports/attachment/ticket/11114/Portfile_v2 Cédric
Updated clean port with two new ports (bkhive and samdump2) that are runtime dependencies for loading hashes directly from a Windows file system. Ticket: http://trac.macports.org/projects/macports/ticket/11114 Portfiles: http://trac.macports.org/projects/macports/attachment/ ticket/11114/ophcrack-port_v2.zip?format=raw If someone cares to commit, that'd be nice. Regards. Cédric Luthi
participants (2)
-
Cédric Luthi
-
Daniel J. Luke