# -*- coding: utf-8; 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
# $Id: Portfile 41979 2008-11-13 01:19:35Z nox@macports.org $

PortSystem      1.0
PortGroup       xcode 1.0

name            AquaLess
version         1.6
categories      aqua sysutils
maintainers     nox openmaintainer
description     Cocoa pager similar to less

long_description \
    AquaLess is a text pager for Mac OS X. It allows you to browse plain \
    text files and -- more importantly -- text output from Unix command \
    line tools. AquaLess is a Cocoa replacement for the less command, which \
    is constrained to the terminal window. AquaLess opens a separate window \
    for each text, so you can keep working in the terminal while you read.

homepage        http://aqualess.sourceforge.net/
master_sites    sourceforge:aqualess
distname        ${name}-${version}-src

xcode.target            ${name}
xcode.destroot.settings INSTALL_PATH=${destroot}Applications

checksums       md5     0d20fbda422538480abd18f4b298b7e0 \
                sha1    29fd0a76e38f01d55fb46f00bb9b81af8b8f60a8 \
                rmd160  8b4e727b415b0024c8ebbfcc469557fd458c8ef5

post-patch {
    reinplace -E /@/s|/usr/bin/aless|$prefix/bin/aless| \
        ${worksrcpath}/ToolInstaller.m
}
if {! [variant_isset universal]} {
    set arch ${os.arch}
    if {! [string compare ${arch} powerpc]} {
        set arch ppc
    }

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

post-destroot {
    set builddir $worksrcpath/build/UninstalledProducts
    xinstall -d $destroot/Applications/MacPorts
    xinstall $builddir/aless $destroot$prefix/bin
    copy $builddir/AquaLess.app $destroot/Applications/MacPorts
}

variant universal {}

livecheck.distname  ${name}
