# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0

name		HandBrake71
version		0.7.1
conflicts   HandBrake
platforms       darwin
categories	aqua multimedia
maintainers	nomaintainer
description	DVD to MPEG4 converter
long_description	HandBrake is a GPL'd multi-platform, heavily \
			multithreaded DVD to MPEG-4 converter. \
			- Can encode directly from DVDs (even encrypted ones) \
			- Outputs MP4, AVI or OGM files \
			- Outputs AAC, MP3 or Vorbis audio \
			- Supports 2-pass encoding \
			- Supports encoding of two audio tracks \
			- Includes a bitrate calculator \
			- Supports picture cropping and scaling
homepage	http://handbrake.fr/
master_sites	http://download.handbrake.fr/handbrake/old/:h \
				http://download.handbrake.fr/handbrake/contrib/:c
dist_subdir	HandBrake
distname    HandBrake-${version}
distfiles	HandBrake-${version}.tar.gz:h a52dec-0.7.4.tar.gz:c \
		ffmpeg-20060201.tar.gz:c libdvdcss-1.2.9.tar.gz:c \
		libdvdread-20050928.tar.gz:c faac-1.24.tar.gz:c \
		lame-3.96.1.tar.gz:c mpeg4ip-1.3.tar.gz:c \
		mpeg2dec-20051112.tar.gz:c libogg-1.1.2.tar.gz:c \
		libsamplerate-0.1.2.tar.gz:c libvorbis-1.1.1.tar.gz:c \
		x264-r401.tar.gz:c xvidcore-1.1.0.tar.gz:c
checksums	\
	HandBrake-0.7.1.tar.gz sha1 7b113bc09cb95877634305871c24594303b6fe19 \
	a52dec-0.7.4.tar.gz sha1 7c406b9b5351cdec56279b6d02f3f556711424d2 \
	ffmpeg-20060201.tar.gz sha1 0984667db8f6e54632af75ce8cfad616ee2ba8ac \
	libdvdcss-1.2.9.tar.gz sha1 2a9b2642bc298d315bb0b6de45a45d9cb696cfc7 \
	libdvdread-20050928.tar.gz sha1 f735156e9257ec9c863b2d63356eb386650b2991 \
	faac-1.24.tar.gz sha1 fc47715e562b980a95b8cd3b2cc516214f8ec8c4 \
	lame-3.96.1.tar.gz sha1 7efa3fe278fc4d4a16a217e973461591428c20c8 \
	mpeg4ip-1.3.tar.gz sha1 3c5987f51d0bbd49775b45f667cf46a628c4f87a \
	mpeg2dec-20051112.tar.gz sha1 f07fb2cee4bb7494d82f2b5920b53dcd3050bf7c \
	libogg-1.1.2.tar.gz sha1 fd4e2c3ce6d98dcb684ed0a09c3b2315888e4442 \
	libsamplerate-0.1.2.tar.gz sha1 677598eb121d892d04ac727cd0ec307a29cd2bc9 \
	libvorbis-1.1.1.tar.gz sha1 b29438f0bc1992000037e375277cdbe095712e2a \
	x264-r401.tar.gz sha1 c9ca8892c22e1d04d1da041c3fc969e9071af15a \
	xvidcore-1.1.0.tar.gz sha1 f935492cf32a119c411e8b649ba6ebec1cf54454

depends_build	bin:jam:jam

extract.only	HandBrake-${version}.tar.gz
set contrib		${worksrcpath}/contrib

if {${os.major} > 9} {
    # Remove conflict on HandBrake
    conflicts

    # Let this port be replaced by HandBrake.
    replaced_by HandBrake

    # No distfiles for a stub port.
    master_sites
    distfiles
    extract.only
    checksums

    # Clear dependencies.
    depends_build

    # Revbump to *really* let people upgrade to the new HandBrake port.
    revision 1

    pre-configure {
        ui_error "Please do not install this port since it has been replaced by 'HandBrake'."
        return -code error
    }

    livecheck.type none
} else {
    post-extract {
    	file copy ${distpath}/a52dec-0.7.4.tar.gz ${contrib}/a52dec.tar.gz
    	file copy ${distpath}/ffmpeg-20060201.tar.gz ${contrib}/ffmpeg.tar.gz
    	file copy ${distpath}/libdvdcss-1.2.9.tar.gz ${contrib}/libdvdcss.tar.gz
    	file copy ${distpath}/libdvdread-20050928.tar.gz ${contrib}/libdvdread.tar.gz
    	file copy ${distpath}/faac-1.24.tar.gz ${contrib}/faac.tar.gz
    	file copy ${distpath}/lame-3.96.1.tar.gz ${contrib}/lame.tar.gz
    	file copy ${distpath}/mpeg4ip-1.3.tar.gz ${contrib}/mpeg4ip.tar.gz
    	file copy ${distpath}/mpeg2dec-20051112.tar.gz ${contrib}/mpeg2dec.tar.gz
    	file copy ${distpath}/libogg-1.1.2.tar.gz ${contrib}/libogg.tar.gz
    	file copy ${distpath}/libsamplerate-0.1.2.tar.gz ${contrib}/libsamplerate.tar.gz
    	file copy ${distpath}/libvorbis-1.1.1.tar.gz ${contrib}/libvorbis.tar.gz
    	file copy ${distpath}/x264-r401.tar.gz ${contrib}/x264.tar.gz
    	file copy ${distpath}/xvidcore-1.1.0.tar.gz ${contrib}/xvidcore.tar.gz
    }

    build.cmd	jam
    build.target
    build.env	CFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib
    destroot	{
    	copy ${worksrcpath}/HandBrake.app ${destroot}${applications_dir}
    }
}
