# -*- 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
# $Id: Portfile 80748 2011-07-16 20:22:20Z jmr@macports.org $

PortSystem 1.0
PortGroup python26 1.0

name                    py26-psyco
version                 1.6
platforms               darwin
supported_archs         i386
license                 MIT
maintainers             jmr openmaintainer
description             a python specializing compiler
long_description        Psyco is a Python extension module which can \
                        massively speed up the execution of any Python code.

homepage                http://psyco.sourceforge.net/
master_sites            sourceforge:project/psyco/psyco/${version}/
distname                psyco-${version}-src
checksums               md5 8816fca8ba521e05d18dde3e1a11b0bd \
                        sha1 3c1ffa70b1a37bd855454d41d41a830e9ea82e7d \
                        rmd160 472669a7a3714aae63710fd9bc5322b4b5214944
worksrcdir              psyco-${version}

extract.post_args       "| tar -xf - --exclude '.cvsignore'"

pre-fetch {
	if {${os.arch} != "i386"} {
		return -code error "psyco only works on Intel machines"
	}
}

post-destroot {
        xinstall -m 644 -W ${worksrcpath} README.txt \
                 ${destroot}${prefix}/share/doc/${name}
        file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}/
}

if {$build_arch == "x86_64"} {
    notes "Since MacPorts is configured to build for the x86_64 architecture where
possible and psyco can only be built for i386, you will probably need
to run python like this to use psyco:
arch -i386 ${python.prefix}/Resources/Python.app/Contents/MacOS/Python"
}
