# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem              1.0
PortGroup               xcode 1.0

name                    Freecell
version                 2.1
categories              aqua games
platforms               darwin
maintainers             nomaintainer

description             classic solitaire game
long_description        The imaginatively-titled “Freecell” is a Mac OS X \
                        version of the classic solitaire game.

homepage                http://randomoracle.com/freecell/
master_sites            macports
use_bzip2               yes

checksums               md5 05c41aa87c3a6c390f83c12db7c4ff3d \
                        sha1 2e609fe0548f44a316f77f15db39581aad7a587f \
                        rmd160 0dbb3cbb23730654244091f4683c51a590a373ab

variant universal {
    post-patch {
        reinplace -E "/OTHER_CFLAGS/s|\"\"|\"${configure.universal_cflags}\"|" \
            ${worksrcpath}/Freecell.pbproj/project.pbxproj
        reinplace -E "/OTHER_LDFLAGS/s|\"\"|\"${configure.universal_ldflags}\"|" \
            ${worksrcpath}/Freecell.pbproj/project.pbxproj
    }
}

post-destroot {
    fs-traverse dir ${worksrcpath}/build {
        if {[file isdirectory ${dir}]} {
            file attributes ${dir} -permissions u+w
        }
    }
    xinstall -d ${destroot}${applications_dir}
    copy ${worksrcpath}/build/UninstalledProducts/Freecell.app \
        ${destroot}${applications_dir}
}

livecheck.type          regex
livecheck.regex         "${name} (\\d+(?:\\.\\d+)*)"
