summaryrefslogtreecommitdiff
blob: 88eb8a464d3b67d6bde6b73fc7ca81a4da0abcba (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-tv/xawtv/xawtv-3.94-r2.ebuild,v 1.5 2005/10/09 12:29:17 zzam Exp $

inherit virtualx eutils font

IUSE="aalib alsa dv lirc mmx motif nls opengl quicktime X xv zvbi"

MY_PATCH="xaw-deinterlace-3.76-0.1.1.diff.bz2"
MY_FONT=tv-fonts-1.0
DESCRIPTION="TV application for the bttv driver"
HOMEPAGE="http://bytesex.org/xawtv/"
SRC_URI="http://dl.bytesex.org/releases/xawtv/${P}.tar.gz
	X? ( http://dl.bytesex.org/releases/tv-fonts/${MY_FONT}.tar.bz2 )
	mirror://gentoo/${MY_PATCH}"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86 ~ppc ~sparc ~alpha ~ia64 ~amd64"

DEPEND=">=sys-libs/ncurses-5.1
	>=media-libs/jpeg-6b
	media-libs/libpng
	X? ( virtual/x11 )
	motif? ( virtual/x11
		x11-libs/openmotif
		app-text/recode )
	xv? ( virtual/x11 )
	alsa? ( media-libs/alsa-lib )
	aalib? ( media-libs/aalib )
	dv? ( media-libs/libdv )
	lirc? ( app-misc/lirc )
	opengl? ( virtual/opengl )
	quicktime? ( virtual/quicktime )
	zvbi? ( media-libs/zvbi )
	sys-devel/autoconf
	sys-devel/automake
	sys-devel/libtool"

pkg_setup() {
	if use X; then
		font_pkg_setup
	fi
}

src_unpack() {
	unpack ${A}
	epatch ${FILESDIR}/${P}-allow-xlibs-in-normal-search-path.patch
	epatch ${FILESDIR}/${P}-gcc4.patch
	epatch ${FILESDIR}/${P}-no-x11.patch
	cd ${S}
	autoreconf || "reconf failed"
}

src_compile() {
	econf \
		$(use_with X x) \
		$(use_enable X xfree-ext) \
		$(use_enable xv xvideo) \
		$(use_enable dv)  \
		$(use_enable mmx) \
		$(use_enable motif) \
		$(use_enable quicktime) \
		$(use_enable alsa) \
		$(use_enable lirc) \
		$(use_enable opengl gl) \
		$(use_enable zvbi) \
		$(use_enable aalib aa) \
		|| die " xawtv configure failed"

	emake || die "Make failed"

	if use X; then
		cd ${WORKDIR}/${MY_FONT}
		DISPLAY="" Xmake || die "tvfonts failed"
	fi
}

src_install() {
	cd ${S}
	make install DESTDIR=${D} resdir=${D}/etc/X11 || die "make install failed"

	dodoc COPYING Changes README* TODO ${FILESDIR}/webcamrc
	insinto cgi-bin
	dodoc scripts/webcam.cgi

	use X || use xv || \
		rm -f ${D}/usr/share/man/man1/{pia,propwatch}.1 \
			${D}/usr/share/{man,man/fr,man/es}/man1/xawtv.1 \
			${D}/usr/share/{man,man/es}/man1/{rootv,v4lctl,xawtv-remote}.1

	use motif || \
		rm -f ${D}/usr/share/man/man1/{motv,mtt}.1

	use zvbi || \
		rm -f ${D}/usr/share/man/man1/{alevtd,mtt}.1 \
			${D}/usr/share/{man,man/es}/man1/scantv.1

	use nls || \
		rm -f ${D}/usr/share/man/fr \
			${D}/usr/share/man/es

	# The makefile seems to be fubar'd for some data
	dodir /usr/share/${PN}
	mv ${D}/usr/share/*.list ${D}/usr/share/${PN}
	mv ${D}/usr/share/Index* ${D}/usr/share/${PN}

	if use X; then
		cd ${WORKDIR}/${MY_FONT}
		insinto /usr/share/fonts/xawtv
		doins *.gz fonts.alias

		font_xfont_config
		font_xft_config
	fi
}

pkg_postinst() {
	if use X; then
		ebegin "installing teletype fonts into /usr/share/fonts/xawtv"
		cd /usr/share/fonts/xawtv
		mkfontdir
		eend
	fi
}