summaryrefslogtreecommitdiff
blob: ded091d096e2fb9d0e74e25da0a95caad3f87c4d (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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit perl-module

DESCRIPTION="Set of utilities to manage TV listings stored in the XMLTV format"
HOMEPAGE="http://wiki.xmltv.org/index.php/XMLTVProject https://github.com/XMLTV/xmltv"
SRC_URI="https://github.com/XMLTV/xmltv/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ~ppc x86 ~x86-linux"

IUSE="ar ch-search dk dtvla eu-dotmedia eu-epgdata eu-xmltvse fi fi-sv fr
huro il is it na-dd na-dtv na-tvmedia pt-meo pt-vodafone se-swedb se-tvzon tr
tv-check tv-combiner tv-pick-cgi uk-bleb uk-tvguide zz-sdjson zz-sdjson-sqlite"

RDEPEND="
	dev-lang/perl
	dev-perl/Date-Manip
	dev-perl/File-Slurp
	dev-perl/JSON
	dev-perl/libwww-perl
	dev-perl/Lingua-Preferred
	dev-perl/PerlIO-gzip
	dev-perl/Term-ProgressBar
	dev-perl/TermReadKey
	dev-perl/XML-Parser
	dev-perl/XML-TreePP
	dev-perl/XML-Twig
	dev-perl/XML-Writer
	dev-perl/Unicode-String
	virtual/perl-Memoize
	virtual/perl-Storable
	virtual/perl-IO-Compress
	ar? (
		dev-perl/DateTime
		dev-perl/HTML-Parser
		dev-perl/HTML-Tree
		dev-perl/HTTP-Cookies
	)
	ch-search? (
		dev-perl/HTML-Tree
		dev-perl/HTML-Parser
		dev-perl/HTTP-Cookies
		dev-perl/URI
	)
	dk? (
		dev-perl/DateTime
		dev-perl/IO-stringy
	)
	dtvla? (
		dev-perl/DateTime
		dev-perl/HTML-Parser
		dev-perl/HTML-Tree
		dev-perl/HTTP-Cookies
	)
	eu-dotmedia? (
		dev-perl/HTTP-Cache-Transparent
		dev-perl/IO-stringy
	)
	eu-epgdata? (
		dev-perl/Archive-Zip
		dev-perl/DateTime
		dev-perl/DateTime-Format-Strptime
		dev-perl/HTML-Parser
		dev-perl/HTTP-Message
	)
	eu-xmltvse? (
		dev-perl/HTTP-Cache-Transparent
		dev-perl/IO-stringy
	)
	fi? (
		dev-perl/HTML-Tree
		dev-perl/LWP-Protocol-https
		dev-perl/URI
	)
	fi-sv? (
		dev-perl/DateTime
		dev-perl/HTML-Tree
		dev-perl/IO-stringy
	)
	fr? (
		dev-perl/DateTime
		dev-perl/DateTime-TimeZone
		dev-perl/HTML-Parser
		dev-perl/HTML-Tree
	)
	huro? (
		dev-perl/HTML-Parser
		dev-perl/HTML-Tree
	)
	il? ( dev-perl/DateTime )
	is? (
		dev-perl/HTML-Parser
		dev-perl/HTML-Tree
		dev-perl/URI
		dev-perl/XML-DOM
		dev-perl/XML-LibXSLT
	)
	it? (
		dev-perl/HTML-Parser
		dev-perl/HTML-Tree
		dev-perl/URI
	)
	na-dd? ( dev-perl/SOAP-Lite )
	na-dtv? (
		dev-perl/DateTime
		dev-perl/HTTP-Cookies
		dev-perl/URI
	 )
	na-tvmedia? ( dev-perl/XML-LibXML )
	pt-meo? (
		dev-perl/DateTime
		dev-perl/XML-LibXML
	)
	pt-vodafone? (
		dev-perl/DateTime
		dev-perl/URI
		dev-perl/XML-LibXML
	)
	se-swedb? (
		dev-perl/HTTP-Cache-Transparent
		dev-perl/IO-stringy
		dev-perl/XML-LibXML
	)
	se-tvzon? (
		dev-perl/XML-LibXML
		dev-perl/IO-stringy
		dev-perl/HTTP-Cache-Transparent
	)
	tr? (
		dev-perl/DateTime
		dev-perl/HTTP-Cache-Transparent
		dev-perl/HTTP-Cookies
		dev-perl/URI
	)
	uk-bleb? (
		dev-perl/Archive-Zip
		dev-perl/IO-stringy
	)
	uk-tvguide? (
		dev-perl/DateTime
		dev-perl/HTML-Tree
		dev-perl/HTTP-Cache-Transparent
		dev-perl/HTTP-Cookies
		dev-perl/URI
	)
	zz-sdjson? (
		dev-lang/perl
		dev-perl/DateTime
		virtual/perl-Digest-SHA
		dev-perl/HTTP-Message
		dev-perl/LWP-Protocol-https
		dev-perl/Try-Tiny
	)
	zz-sdjson-sqlite? (
		dev-lang/perl
		dev-perl/DateTime
		dev-perl/DateTime-Format-ISO8601
		dev-perl/DateTime-Format-SQLite
		dev-perl/DateTime-TimeZone
		dev-perl/DBD-SQLite
		dev-perl/DBI
		virtual/perl-Digest-SHA
		dev-perl/File-HomeDir
		dev-perl/File-Which
		dev-perl/List-MoreUtils
		dev-perl/LWP-UserAgent-Determined
	)
	tv-check? (
		dev-perl/Tk
		dev-perl/Tk-TableMatrix
	)
	tv-combiner? ( dev-perl/XML-LibXML )
	tv-pick-cgi? ( dev-perl/CGI )
"

PREFIX="/usr"

pkg_setup() {
	# Uses Data::Manip in various places which can fail
	# if TZ is still set to Factory as it is in stock gentoo
	# install media
	export TZ=UTC
}

src_prepare() {
	default
	# Add revision number to version info.
	# Remove the doc/COPYING file from documentation.
	sed -i \
		-e "s:\$VERSION = '${PV}':\$VERSION = '${PVR}':" \
		-e "/^@docs/s:doc/COPYING ::" \
		Makefile.PL || die
}

src_configure() {
	# Must match the order of elements in @opt_components in Makefile.PL
	make_config() {
		# Never except default configuration
		echo "no"

		# Enable Agentina
		usex ar
		# Enable Switzerland Search
		usex ch-search
		# Enable Denmark
		usex dk
		# Enable Latin America
		usex dtvla
		# Enable Europe (DEPRECATED, xmltv.se / dotmedia)
		usex eu-dotmedia
		# Enable EU epgdata.com including fanart
		usex eu-epgdata
		# Enable Europe (xmltv.se / xmltvse)
		usex eu-xmltvse
		# Enable Finland
		usex fi
		# Enable Swedish listings in Finland
		usex fi-sv
		# Enable France
		usex fr
		# Enable Hungary and Romania
		usex huro
		# Enable Israel
		usex il
		# Enable Iceland
		usex is
		# Enable Italy
		usex it
		# Enable Italy from DVB-S stream
		echo "no" # missing Linux::DVB
		# Enable North America using DataDirect
		usex na-dd
		# Enable North America from directv.com
		usex na-dtv
		# Enable North America XMLTVListings.com
		usex na-tvmedia
		# Enable Portugal EPG from sappo.pt
		usex pt-meo
		# Enable Portugal EPG from Vodafone
		usex pt-vodafone
		# Enable Sweden
		usex se-swedb
		# Enable Sweeden Alternative (Repace with eu_xmltvse)
		usex se-tvzon
		# Enable Turkey
		usex tr
		# Enable UK fast alternative grabber
		usex uk-bleb
		# Enable UK/Ireland TV Guide
		usex uk-tvguide
		# Enable Schedules Direct JSON
		usex zz-sdjson
		# Enable Schedules Direct JSON (SQLite version)
		usex zz-sdjson-sqlite
		# rules to improve episode numbering
		usex tv-check
		# Enable combiner
		usex tv-combiner
		# Enable CGI support
		usex tv-pick-cgi
	}

	pm_echovar=`make_config`
	perl-module_src_configure
}

src_install() {
	perl-module_src_install

	if use tv-pick-cgi; then
		dobin choose/tv_pick/tv_pick_cgi
	fi
}

pkg_postinst() {
	if use tv-pick-cgi; then
		elog "To use tv_pick_cgi, please link it from /usr/bin/tv_pick_cgi"
		elog "to where the ScriptAlias directive is configured."
	fi
}