# $Id: Portfile 59971 2009-10-28 06:56:05Z pguyot@kallisys.net $

PortSystem 1.0
PortGroup xcode 1.0
name            twain-sane
version         2.5
revision        1
categories      graphics
maintainers     nomaintainer
description     TWAIN datasource for SANE
homepage        http://www.ellert.se/twain-sane/

long_description \
                                This is a TWAIN datasource for Mac OS X that aquires images \
                                using the SANE backend libraries. The SANE backend libraries \
                                provide access to a large range of scanners connected through \
                                SCSI or USB. For a complete list see the documentation on the \
                                SANE project homepage. It works with my HP SCSI scanner, and \
                                many people have reported success with a large number of \
                                different scanners. The feedback from users have helped the \
                                SANE developers to fix problems with various backends, so with \
                                each release of the SANE backends more of the Mac OS X specific \
                                problems have been solved.
distname                TWAIN-SANE-Interface-${version}
master_sites    http://www.ellert.se/PKGS/${distname}/src/

checksums       md5     e304b16596b52f663ab4818d0517e93e \
                sha1    b27b611790e4fe5526423dd5d4d969a82b756715 \
                rmd160  142d3ff548680816a9dec816ada2bf473a042cf3

depends_lib     lib:libiconv:libiconv \
                                lib:libintl:gettext \
                                lib:libusb-compat:libusb-compat \
                                lib:libsane:sane-backends

pre-build {
        # Generate Info.plist
        system "cd ${worksrcpath}/src && ./Info.sh > Info.plist"
}

xcode.project                   SANE.ds.xcodeproj
xcode.destroot.path             /Library/Image Capture/TWAIN Data Sources
xcode.build.settings    LIBRARY_SEARCH_PATHS=${prefix}/lib \
                                                HEADER_SEARCH_PATHS=${prefix}/include
xcode.destroot.settings LIBRARY_SEARCH_PATHS=${prefix}/lib \
                                                HEADER_SEARCH_PATHS=${prefix}/include
build.dir "${worksrcpath}/src"

livecheck.type  regex
livecheck.regex {<td><a href="../PKGS/TWAIN-SANE-Interface-(.*)/src/TWAIN-SANE-Interface-\1.tar.gz"><img src="../gz.png"></a></td>}
