summaryrefslogtreecommitdiff
blob: 2e7529e8db1c08f50552c8f7f58f9a7e04a075e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-video/motiontrack/motiontrack-0.1.0.ebuild,v 1.3 2004/07/23 23:39:21 mr_bones_ Exp $


DESCRIPTION="A set of tools that detect motion between two images"
SRC_URI="http://gemia.de/motion/${P}.tar.gz"
HOMEPAGE="http://motiontrack.sourceforge.net"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86 ~ppc ~ppc64 ~sparc ~mips ~alpha ~hppa ~amd64"

IUSE="libgd imagemagick debug"

DEPEND="virtual/libc
	debug? (
		libgd? (
			imagemagick? ( >=media-gfx/imagemagick-5.5.7 )
			!imagemagick? ( media-libs/gd )
		)
		!libgd? ( >=media-gfx/imagemagick-5.5.7 )
	)
	!debug? (
		imagemagick? (
			gd? ( media-libs/gd )
			!gd? ( >=media-gfx/imagemagick-5.5.7 )
		)
		!imagemagick? ( media-libs/gd )
	)"

src_compile() {

	local myconf

	if use libgd; then
		if use imagemagick; then
			einfo "motiontrack can only use one of libgd or imagemagick, not both."
			einfo "default is libgd when debug is unset, imagemagick otherwise."
			einfo "please unset one of these use flags if you have other intentions."
		fi
	fi
	if use debug; then
		#default to imagemagick for providing better features
		#for debugging
		myconf="--enable-debug"
		if use libgd; then
			if use imagemagick; then
				myconf="${myconf} --enable-magick --disable-gd";
			else
				myconf="${myconf} --disable-magick --enable-gd";
			fi
		else
			myconf="${myconf} --enable-magick --disable-gd";
		fi
	else
		#default to libgd for being faster
		myconf="--disable-debug"
		if use imagemagick; then
			if use libgd; then
				myconf="${myconf} --disable-magick --enable-gd";
			else
				myconf="${myconf} --enable-magick --disable-gd";
		fi
		else
			myconf="${myconf} --disable-magick --enable-gd";
		fi
	fi

	econf $myconf || die "configure failed"
	emake || die "make failed"

}

src_install() {
	make DESTDIR=${D} install || die "install failed"
	dodoc README src/TheCode.txt
}