# $Id: Portfile 57386 2009-09-10 11:02:25Z toby@macports.org $
# -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
#
# Inspired by the Portfile of CocoaDialog

PortSystem    1.0
PortGroup     xcode 1.0

name          SSHKeychain
version       0.8.2
categories    aqua sysutils
maintainers   nomaintainer
description   SSHKeychain is a graphical front-end to ssh-add
long_description    \
    SSHKeychain is a graphical front-end to ssh-agent and \
    also allows the creation of ssh tunnels. It automatically \
    loads keys when needed, integrates with Apple Keychain \
    and offers key-management.

homepage      http://www.sshkeychain.org/
platforms     macosx

# unfortunately there are no tarballs...
fetch.type    svn
# ... but the upstream developer uses tags, so that's a good thing...
svn.url       http://svn.sshkeychain.org/repos/tags/0.8.2
# ... and we make it airtight with the revision number
svn.revision  122

# needed to prevent helper apps from getting installed
patchfiles    patch-SSHKeychain_xcodeproj__project_pbxproj.diff

worksrcdir    ${version}
xcode.target  ${name}

# Dummy configure to enable +universal.
use_configure yes
configure     {}

# Determine for what architecture to build
# (if +universal, the project already does the right thing...)
if {! [variant_isset universal]} {
    set arch ${os.arch}
    if {! [string compare ${os.arch} powerpc]} {
        set arch ppc
    }

    xcode.build.settings-append     ARCHS=${arch}
    xcode.destroot.settings-append  ARCHS=${arch}
}

post-destroot {
    fs-traverse dir ${destroot} {
        if {[file isdirectory ${dir}]} {
            file attributes ${dir} -permissions u+w
        }
    }
}
