summaryrefslogtreecommitdiff
blob: ac7b57998058cc367062436fd3d90cecece9c366 (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
162
163
164
165
166
167
168
169
170
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-tv/xmltv/xmltv-0.5.34.ebuild,v 1.10 2005/05/25 14:43:54 mcummings Exp $

inherit perl-module

DESCRIPTION="Set of utilities to manage TV listings stored in the XMLTV format."
HOMEPAGE="http://membled.com/work/apps/xmltv/"
SRC_URI="mirror://sourceforge/xmltv/${P}.tar.bz2"
IUSE=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 amd64 ~ppc"

# NOTE: you can customize the xmltv installation by
#       defining a XMLTV_OPTS variable which contains
#       a space-separated list of optional features.
#       If this variable is unspecified or has an
#       empty value, everything will be *enabled*.
#
#  tv_grab_huro        Alternate Hungarian and Romania grabber		
#  tv_grab_uk_rt:      Alternate Britain listings grabber
#  tv_grab_it:         Italy listings grabber
#  tv_grab_na_icons:   Downloads icons from Zap2IT
#  tv_grab_na_dd:      Alternate American listings grabber
#  tv_grab_nz:         New Zealand listings grabber
#  tv_grab_fi:         Finland listings grabber
#  tv_grab_es:         Spain listings grabber
#  tv_grab_es_digital: Spain digital satellite listings grabber
#  tv_grab_nl:         Netherlands listings grabber
#  tv_grab_nl_wolf:    Alternate Netherlands listings grabber
#  tv_grab_dk:         Denmark listings grabber
#  tv_grab_jp:         Japan listings grabber
#  tv_grab_de_tvtoday: Germany listings grabber
#  tv_grab_se:         Sweden listings grabber
#  tv_grab_fr:         France listings grabber
#  tv_check:           Graphical front-end for listings data
#  tv_pick_cgi:        CGI front-end for listings data

# EXAMPLES:
# enable just North American grabber
#   XMLTV_OPTS="tv_grab_na"
#
# enable graphical front-end, Italy grabber
#   XMLTV_OPTS="tv_check tv_grab_it"

RDEPEND=">=dev-perl/libwww-perl-5.65
	>=dev-perl/XML-Parser-2.34
	>=dev-perl/XML-Twig-3.10
	>=dev-perl/DateManip-5.42
	>=dev-perl/XML-Writer-0.4.6
	perl-core/Memoize
	perl-core/Storable
	dev-perl/Lingua-EN-Numbers-Ordinate
	>=dev-perl/Lingua-Preferred-0.2.4
	>=dev-perl/Term-ProgressBar-2.03
	dev-perl/Compress-Zlib
	dev-perl/Unicode-String
	>=dev-lang/perl-5.6.1"

DEPEND="${RDEPEND}
	>=sys-apps/portage-2.0.50-r1
	>=sys-apps/sed-4"

[ -z "${XMLTV_OPTS}" ] || has tv_grab_uk_rt ${XMLTV_OPTS} \
	&& newdepend \>=dev-perl/HTML-Parser-3.34
[ -z "${XMLTV_OPTS}" ] || has tv_grab_na_dd ${XMLTV_OPTS} \
	&& newdepend dev-perl/SOAP-Lite dev-perl/TermReadKey
[ -z "${XMLTV_OPTS}" ] || has tv_grab_na_icons ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-TableExtract \>=dev-perl/WWW-Mechanize-1.02
[ -z "${XMLTV_OPTS}" ] || has tv_grab_fi ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_es ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_es_digital ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_nl ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_nl_wolf ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_huro ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_dk ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_jp ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree dev-perl/Text-Kakasi
[ -z "${XMLTV_OPTS}" ] || has tv_grab_de_tvtoday ${XMLTV_OPTS} \
	&& newdepend \>=dev-perl/HTML-Parser-3.34 dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_se ${XMLTV_OPTS} \
	&& newdepend dev-perl/XML-LibXML
[ -z "${XMLTV_OPTS}" ] || has tv_grab_fr ${XMLTV_OPTS} \
	&& newdepend \>=dev-perl/HTML-Parser-3.34 dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_grab_no ${XMLTV_OPTS} \
	&& newdepend \>=dev-perl/HTML-Parser-3.34 dev-perl/HTML-TableExtract dev-perl/HTML-LinkExtractor
[ -z "${XMLTV_OPTS}" ] || has tv_grab_pt ${XMLTV_OPTS} \
	&& newdepend dev-perl/HTML-Tree
[ -z "${XMLTV_OPTS}" ] || has tv_check ${XMLTV_OPTS} \
	&& newdepend dev-perl/perl-tk dev-perl/Tk-TableMatrix
[ -z "${XMLTV_OPTS}" ] || has tv_pick_cgi ${XMLTV_OPTS} \
	&& newdepend perl-core/CGI

make_config() {
	if [ -z "${XMLTV_OPTS}" ] ; then
		# No customization needed, build everything (default)
		echo "yes"
		return
	else
		# Need to specify custom settings, do not accept defaults
		echo "no"
	fi

	# Enable Alternate Brittain
	has tv_grab_uk_rt ${XMLTV_OPTS}      >&/dev/null && echo "yes" || echo "no"
	# Enable Italy
	has tv_grab_it ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable North America using DataDirect
	has tv_grab_na_dd ${XMLTV_OPTS}      >&/dev/null && echo "yes" || echo "no"
	# Enable North America channel icons
	has tv_grab_na_icons ${XMLTV_OPTS}   >&/dev/null && echo "yes" || echo "no"
	# Enable Finland
	has tv_grab_fi ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable Spain
	has tv_grab_es ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable Spain Digital
	has tv_grab_es_digital ${XMLTV_OPTS} >&/dev/null && echo "yes" || echo "no"
	# Enable Netherlands
	has tv_grab_nl ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable Alternate Netherlands
	has tv_grab_nl_wolf ${XMLTV_OPTS}    >&/dev/null && echo "yes" || echo "no"
	# Enable Hungary and Romania
	has tv_grab_huro ${XMLTV_OPTS}       >&/dev/null && echo "yes" || echo "no"
	# Enable Denmark
	has tv_grab_dk ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable Japan
	has tv_grab_jp ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable Germany
	has tv_grab_de_tvtoday ${XMLTV_OPTS} >&/dev/null && echo "yes" || echo "no"
	# Enable Sweden
	has tv_grab_se ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable France
	has tv_grab_fr ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable Norway
	has tv_grab_no ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable Portugal
	has tv_grab_pt ${XMLTV_OPTS}         >&/dev/null && echo "yes" || echo "no"
	# Enable GUI checking.
	has tv_check ${XMLTV_OPTS}           >&/dev/null && echo "yes" || echo "no"
	# Enable CGI support
	has tv_pick_cgi ${XMLTV_OPTS}        >&/dev/null && echo "yes" || echo "no"
}

src_compile() {
	make_config | perl-module_src_compile
}

src_install() {
	perl-module_src_install

	for i in `grep -rl "${D}" "${D}"` ; do
		sed -e "s:${D}::g" -i "${i}"
	done

	[ -z "${XMLTV_OPTS}" ] || has tv_pick_cgi ${XMLTV_OPTS} && {
		dobin choose/tv_pick/tv_pick_cgi
		einfo
		einfo "To use tv_pick_cgi, please link it from /usr/bin/tv_pick_cgi"
		einfo "to where the ScriptAlias directive is configured."
		einfo
	}
}