summaryrefslogtreecommitdiff
blob: 796b035999f39f6235905f8b753f5bb5324d3485 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-tv/xawtv/xawtv-3.95-r1.ebuild,v 1.21 2006/12/31 18:07:46 beandog Exp $

WANT_AUTOMAKE="latest"
WANT_AUTOCONF="latest"

inherit eutils font autotools flag-o-matic

PATCHLEVEL="4"

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

MY_FONT=tv-fonts-1.1
DESCRIPTION="Small suite of video4linux related software"
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/${PN}-patches-${PATCHLEVEL}.tar.bz2"

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

RDEPEND=">=sys-libs/ncurses-5.1
	>=media-libs/jpeg-6b
	X? ( || ( (
			x11-libs/libFS
			x11-libs/libXmu
			x11-libs/libX11
			x11-libs/libXaw
			x11-libs/libXt
			x11-libs/libXext
			x11-libs/libXrender
			xext? (
				x11-libs/libXinerama
				x11-libs/libXxf86dga
				x11-libs/libXrandr
				x11-libs/libXxf86vm
			)
			x11-apps/xset
			xv? ( x11-libs/libXv )
		) <virtual/x11-7 )
	)
	motif? ( x11-libs/openmotif
		app-text/recode )
	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
		media-libs/libpng )"

DEPEND="${RDEPEND}
	X? ( || ( (
				x11-apps/xset
				x11-apps/bdftopcf
				x11-proto/videoproto
				xext? ( x11-proto/xineramaproto )
			) <virtual/x11-7 )
		)"

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

src_unpack() {
	unpack ${A}
	if use X; then
		cd "${WORKDIR}/${MY_FONT}"
		epatch "${WORKDIR}/patches/extra/${MY_FONT}-nox.patch"
	fi
	cd "${S}"

	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
	epatch "${FILESDIR}/${P}-libquicktime-compat.patch"
	eautoreconf
}

src_compile() {
	# It tries to include FSlib.h directly, but this seems to have moved.
	use X && has_version x11-libs/libFS && append-flags -I/usr/include/X11/fonts

	econf \
		$(use_with X x) \
		$(use_enable xext 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 BINDNOW_FLAGS=$(bindnow-flags) verbose=yes || die "Make failed"

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

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

	# v4lctl is only installed automatically if the X USE flag is enabled
	use X || \
		dobin x11/v4lctl

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

	use X || \
		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.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
}