# $Id: Portfile 38619 2008-07-26 05:32:56Z ryandesign@macports.org $

PortSystem              1.0

name                    isightcapture
version                 1.1
set version2            [strsed ${version} {g/[.]/_/}]
categories              sysutils graphics
platforms               macosx
use_parallel_build      no
maintainers             ryandesign
homepage                http://www.intergalactic.de/pages/iSight.html
master_sites            http://www.intergalactic.de/pages/iSight_files/
distname                ${name}${version2}
extract.suffix          .dmg

description \
	captures a frame from an iSight camera and saves it to a file

long_description \
	iSightCapture captures a single frame from an attached iSight camera \
	and saves it to a file. It works even when no graphical user is logged \
	in, unlike many other applications. iSightCapture has only been tested \
	with Mac OS X Tiger and iSight.

checksums \
	md5 b0adf800e285ca0bc46f20d2450d45fa \
	sha1 038cc8852641c4ca10f4960eb30d508a0e9b99c1 \
	rmd160 fcbfc6bf0dd08d3b8a4a268378a57b54a5bfd82e

set dmg_mount /tmp/${name}-${version}

extract {
	file mkdir ${dmg_mount}
	system "hdiutil attach ${distpath}/${distname}${extract.suffix} -private -nobrowse -mountpoint ${dmg_mount}"
}

use_configure no

build {}

destroot {
	xinstall -m 755 ${dmg_mount}/${name} ${destroot}${prefix}/bin
}

post-destroot {
	system "hdiutil detach ${dmg_mount}"
	file delete -force ${dmg_mount}
}

default_variants +universal
variant universal {}
pre-fetch {
	if {![variant_isset universal]} {
		return -code error "${name} is only available in a universal version"
	}
}

livecheck.check     regex
livecheck.version   ${version2}
livecheck.regex     ${name}(\[0-9._\]+)\\.dmg
