1 |
hd_brummy 12/04/29 13:05:34 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: vdr-plugin-2.eclass |
5 |
Log: |
6 |
vdr-plugin-2.eclass added; include major fixes for obselet i18n handling, Linguas support |
7 |
|
8 |
Revision Changes Path |
9 |
1.226 eclass/ChangeLog |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.226&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.226&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.225&r2=1.226 |
14 |
|
15 |
Index: ChangeLog |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
18 |
retrieving revision 1.225 |
19 |
retrieving revision 1.226 |
20 |
diff -u -r1.225 -r1.226 |
21 |
--- ChangeLog 27 Apr 2012 19:51:52 -0000 1.225 |
22 |
+++ ChangeLog 29 Apr 2012 13:05:34 -0000 1.226 |
23 |
@@ -1,6 +1,10 @@ |
24 |
# ChangeLog for eclass directory |
25 |
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 |
26 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.225 2012/04/27 19:51:52 ulm Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.226 2012/04/29 13:05:34 hd_brummy Exp $ |
28 |
+ |
29 |
+ 29 Apr 2012; Joerg Bornkessel <hd_brummy@g.o> +vdr-plugin-2.eclass: |
30 |
+ vdr-plugin-2.eclass added; include major fixes for obselet i18n handling, |
31 |
+ Linguas support |
32 |
|
33 |
27 Apr 2012; Ulrich Müller <ulm@g.o> elisp-common.eclass: |
34 |
Sync from Emacs overlay: Require GNU Emacs in elisp-need-emacs(). |
35 |
|
36 |
|
37 |
|
38 |
1.1 eclass/vdr-plugin-2.eclass |
39 |
|
40 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/vdr-plugin-2.eclass?rev=1.1&view=markup |
41 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/vdr-plugin-2.eclass?rev=1.1&content-type=text/plain |
42 |
|
43 |
Index: vdr-plugin-2.eclass |
44 |
=================================================================== |
45 |
# Copyright 1999-2012 Gentoo Foundation |
46 |
# Distributed under the terms of the GNU General Public License v2 |
47 |
# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin-2.eclass,v 1.1 2012/04/29 13:05:34 hd_brummy Exp $ |
48 |
|
49 |
# @ECLASS: vdr-plugin-2.eclass |
50 |
# @MAINTAINER: |
51 |
# vdr@g.o |
52 |
# @BLURB: common vdr plugin ebuild functions |
53 |
# @DESCRIPTION: |
54 |
# Eclass for easing maitenance of vdr plugin ebuilds |
55 |
|
56 |
# Authors: |
57 |
# Matthias Schwarzott <zzam@g.o> |
58 |
# Joerg Bornkessel <hd_brummy@g.o> |
59 |
# Christian Ruppert <idl0r@g.o> |
60 |
|
61 |
# Plugin config file installation: |
62 |
# |
63 |
# A plugin config file can be specified through the $VDR_CONFD_FILE variable, it |
64 |
# defaults to ${FILESDIR}/confd. Each config file will be installed as e.g. |
65 |
# ${D}/etc/conf.d/vdr.${VDRPLUGIN} |
66 |
|
67 |
# Installation of rc-addon files: |
68 |
# NOTE: rc-addon files must be valid shell scripts! |
69 |
# |
70 |
# Installing rc-addon files is basically the same as for plugin config files |
71 |
# (see above), it's just using the $VDR_RCADDON_FILE variable instead. |
72 |
# The default value when $VDR_RCADDON_FILE is undefined is: |
73 |
# ${FILESDIR}/rc-addon.sh and will be installed as |
74 |
# ${VDR_RC_DIR}/plugin-${VDRPLUGIN}.sh |
75 |
# |
76 |
# The rc-addon files will be sourced by the startscript when the specific plugin |
77 |
# has been enabled. |
78 |
# rc-addon files may be used to prepare everything that is necessary for the |
79 |
# plugin start/stop, like passing extra command line options and so on. |
80 |
|
81 |
# Applying your own local/user patches: |
82 |
# This is done by using the epatch_user() function of the eutils.eclass. |
83 |
# Simply put your patches into one of these directories: |
84 |
# /etc/portage/patches/<CATEGORY>/<PF|P|PN>/ |
85 |
# Quote: where the first of these three directories to exist will be the one to |
86 |
# use, ignoring any more general directories which might exist as well. |
87 |
# |
88 |
# For more details about it please take a look at the eutils.class. |
89 |
|
90 |
inherit base multilib eutils flag-o-matic |
91 |
|
92 |
if ! has "${EAPI:-4}" 4; then |
93 |
die "API of vdr-plugin-2.eclass in EAPI=\"${EAPI}\" not established" |
94 |
fi |
95 |
|
96 |
EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config |
97 |
|
98 |
IUSE="" |
99 |
|
100 |
# Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes |
101 |
VDRPLUGIN="${PN/#vdrplugin-/}" |
102 |
VDRPLUGIN="${VDRPLUGIN/#vdr-/}" |
103 |
VDRPLUGIN="${VDRPLUGIN/%-cvs/}" |
104 |
|
105 |
DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin-2.eclass)" |
106 |
|
107 |
# Works in most cases |
108 |
S="${WORKDIR}/${VDRPLUGIN}-${PV}" |
109 |
|
110 |
# depend on headers for DVB-driver |
111 |
COMMON_DEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2" |
112 |
|
113 |
DEPEND="${COMMON_DEPEND} |
114 |
virtual/linuxtv-dvb-headers" |
115 |
RDEPEND="${COMMON_DEPEND} |
116 |
>=app-admin/eselect-vdr-0.0.2" |
117 |
|
118 |
# This is a hack for ebuilds like vdr-xineliboutput that want to |
119 |
# conditionally install a vdr-plugin |
120 |
if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]]; then |
121 |
IUSE="${IUSE} vdr" |
122 |
DEPEND="vdr? ( ${DEPEND} )" |
123 |
RDEPEND="vdr? ( ${RDEPEND} )" |
124 |
fi |
125 |
|
126 |
# New method of storing plugindb |
127 |
# Called from src_install |
128 |
# file maintained by normal portage-methods |
129 |
create_plugindb_file() { |
130 |
local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/ |
131 |
local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}" |
132 |
insinto "${NEW_VDRPLUGINDB_DIR}" |
133 |
|
134 |
# BUG: portage-2.1.4_rc9 will delete the EBUILD= line, so we cannot use this code. |
135 |
# cat <<-EOT > "${D}/${DB_FILE}" |
136 |
# VDRPLUGIN_DB=1 |
137 |
# CREATOR=ECLASS |
138 |
# EBUILD=${CATEGORY}/${PN} |
139 |
# EBUILD_V=${PVR} |
140 |
# EOT |
141 |
{ |
142 |
echo "VDRPLUGIN_DB=1" |
143 |
echo "CREATOR=ECLASS" |
144 |
echo "EBUILD=${CATEGORY}/${PN}" |
145 |
echo "EBUILD_V=${PVR}" |
146 |
echo "PLUGINS=\"$@\"" |
147 |
} > "${D}/${DB_FILE}" |
148 |
} |
149 |
|
150 |
# Delete files created outside of vdr-plugin-2.eclass |
151 |
# vdrplugin-rebuild.ebuild converted plugindb and files are |
152 |
# not deleted by portage itself - should only be needed as |
153 |
# long as not every system has switched over to |
154 |
# vdrplugin-rebuild-0.2 / gentoo-vdr-scripts-0.4.2 |
155 |
delete_orphan_plugindb_file() { |
156 |
#elog Testing for orphaned plugindb file |
157 |
local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/ |
158 |
local DB_FILE="${ROOT}/${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}" |
159 |
|
160 |
# file exists |
161 |
[[ -f ${DB_FILE} ]] || return |
162 |
|
163 |
# will portage handle the file itself |
164 |
if grep -q CREATOR=ECLASS "${DB_FILE}"; then |
165 |
#elog file owned by eclass - don't touch it |
166 |
return |
167 |
fi |
168 |
|
169 |
elog "Removing orphaned plugindb-file." |
170 |
elog "\t#rm ${DB_FILE}" |
171 |
rm "${DB_FILE}" |
172 |
} |
173 |
|
174 |
|
175 |
create_header_checksum_file() { |
176 |
# Danger: Not using $ROOT here, as compile will also not use it !!! |
177 |
# If vdr in $ROOT and / differ, plugins will not run anyway |
178 |
|
179 |
local CHKSUM="header-md5-vdr" |
180 |
|
181 |
if [[ -f ${VDR_CHECKSUM_DIR}/header-md5-vdr ]]; then |
182 |
cp "${VDR_CHECKSUM_DIR}/header-md5-vdr" "${CHKSUM}" |
183 |
elif type -p md5sum >/dev/null 2>&1; then |
184 |
( |
185 |
cd "${VDR_INCLUDE_DIR}" |
186 |
md5sum *.h libsi/*.h|LC_ALL=C sort --key=2 |
187 |
) > "${CHKSUM}" |
188 |
else |
189 |
die "Could not create md5 checksum of headers" |
190 |
fi |
191 |
|
192 |
insinto "${VDR_CHECKSUM_DIR}" |
193 |
local p_name |
194 |
for p_name; do |
195 |
newins "${CHKSUM}" "header-md5-${p_name}" |
196 |
done |
197 |
} |
198 |
|
199 |
fix_vdr_libsi_include() { |
200 |
dev_check "Fixing include of libsi-headers" |
201 |
local f |
202 |
for f; do |
203 |
sed -i "${f}" \ |
204 |
-e '/#include/s:"\(.*libsi.*\)":<\1>:' \ |
205 |
-e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:' |
206 |
done |
207 |
} |
208 |
|
209 |
vdr_patchmakefile() { |
210 |
einfo "Patching Makefile" |
211 |
[[ -e Makefile ]] || die "Makefile of plugin can not be found!" |
212 |
cp Makefile "${WORKDIR}"/Makefile.before |
213 |
|
214 |
# plugin makefiles use VDRDIR in strange ways |
215 |
# assumptions: |
216 |
# 1. $(VDRDIR) contains Make.config |
217 |
# 2. $(VDRDIR) contains config.h |
218 |
# 3. $(VDRDIR)/include/vdr contains the headers |
219 |
# 4. $(VDRDIR) contains main vdr Makefile |
220 |
# 5. $(VDRDIR)/locale exists |
221 |
# 6. $(VDRDIR) allows to access vdr source files |
222 |
# |
223 |
# We only have one directory (for now /usr/include/vdr), |
224 |
# that contains vdr-headers and Make.config. |
225 |
# To satisfy 1-3 we do this: |
226 |
# Set VDRDIR=/usr/include/vdr |
227 |
# Set VDRINCDIR=/usr/include |
228 |
# Change $(VDRDIR)/include to $(VDRINCDIR) |
229 |
|
230 |
sed -i Makefile \ |
231 |
-e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \ |
232 |
-e "/^VDRDIR/a VDRINCDIR = ${VDR_INCLUDE_DIR%/vdr}" \ |
233 |
-e '/VDRINCDIR.*=/!s:$(VDRDIR)/include:$(VDRINCDIR):' \ |
234 |
\ |
235 |
-e 's:-I$(DVBDIR)/include::' \ |
236 |
-e 's:-I$(DVBDIR)::' |
237 |
|
238 |
# may be needed for multiproto: |
239 |
#sed -i Makefile \ |
240 |
# -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
241 |
# -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' |
242 |
|
243 |
if ! grep -q APIVERSION Makefile; then |
244 |
ebegin " Converting to APIVERSION" |
245 |
sed -i Makefile \ |
246 |
-e 's:^APIVERSION = :APIVERSION ?= :' \ |
247 |
-e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \ |
248 |
-e '/VDRVERSION =/a\APIVERSION = $(shell sed -ne '"'"'/define APIVERSION/s/^.*"\\(.*\\)".*$$/\\1/p'"'"' $(VDRDIR)/config.h)' |
249 |
eend $? |
250 |
fi |
251 |
|
252 |
# Correcting Compile-Flags |
253 |
# Do not overwrite CXXFLAGS, add LDFLAGS if missing |
254 |
sed -i Makefile \ |
255 |
-e '/^CXXFLAGS[[:space:]]*=/s/=/?=/' \ |
256 |
-e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:' |
257 |
|
258 |
# Disabling file stripping, the package manager takes care of it |
259 |
sed -i Makefile \ |
260 |
-e '/@.*strip/d' \ |
261 |
-e '/strip \$(LIBDIR)\/\$@/d' \ |
262 |
-e 's/STRIP.*=.*$/STRIP = true/' |
263 |
|
264 |
# Use a file instead of a variable as single-stepping via ebuild |
265 |
# destroys environment. |
266 |
touch "${WORKDIR}"/.vdr-plugin_makefile_patched |
267 |
} |
268 |
|
269 |
# Begin new vdr-plugin-2.eclass content |
270 |
dev_check() { |
271 |
# A lot useful debug infos |
272 |
# set VDR_MAINTAINER_MODE="1" in /etc/make.conf |
273 |
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then |
274 |
eerror "\t Maintainer Info: $@" |
275 |
fi |
276 |
} |
277 |
|
278 |
gettext_missing() { |
279 |
# plugins without converting to gettext |
280 |
|
281 |
local GETTEXT_MISSING=$( grep xgettext Makefile ) |
282 |
if [ -z ${GETTEXT_MISSING} ]; then |
283 |
dev_check "Plugin isn't converted to gettext handling \n" |
284 |
fi |
285 |
} |
286 |
|
287 |
linguas_support() { |
288 |
# Patching Makefile for linguas support. |
289 |
# Only locales, enabled through the LINGUAS (make.conf) variable will be |
290 |
# "compiled" and installed. |
291 |
# |
292 |
# Some plugins have po/ in a subdir |
293 |
# set PO_SUBDIR in .ebuild |
294 |
# i.e media-plugins/vdr-streamdev |
295 |
# PO_SUBDIR="client server" |
296 |
|
297 |
einfo "Patching for Linguas support" |
298 |
einfo "available Languages for ${P} are:" |
299 |
|
300 |
[[ -f po ]] && local po_dir="${S}" |
301 |
local po_subdir=( ${S}/${PO_SUBDIR} ) |
302 |
local f |
303 |
|
304 |
makefile_dir=( ${po_dir} ${po_subdir[*]} ) |
305 |
|
306 |
for f in ${makefile_dir[*]}; do |
307 |
|
308 |
PLUGIN_LINGUAS=$( ls ${f}/po | tr \\\012 ' ' | tr -d [:upper:] | tr -d [:punct:] |sed -e "s:po::g" ) |
309 |
einfo "LINGUAS=\"${PLUGIN_LINGUAS}\"" |
310 |
|
311 |
sed -i ${f}/Makefile \ |
312 |
-e 's:\$(wildcard[[:space:]]*\$(PODIR)/\*.po):\$(foreach dir,\$(LINGUAS),\$(wildcard \$(PODIR)\/\$(dir)\*.po)):' \ |
313 |
|| die "sed failed for Linguas" |
314 |
done |
315 |
|
316 |
# maintainer check |
317 |
if [[ ! -d po ]]; then |
318 |
dev_check "po dir not found? May be in subdir? \n" |
319 |
fi |
320 |
} |
321 |
|
322 |
vdr_i18n() { |
323 |
# i18n handling was deprecated since >=media-video/vdr-1.5.9, |
324 |
# finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some |
325 |
# plugins will fail to "compile" because they're still using the old variant. |
326 |
# Simply remove the i18n.o object from Makefile (OBJECT) and |
327 |
# remove "static const tI18nPhrase*" from i18n.h. |
328 |
# |
329 |
# Plugins that are still using the old method will be pmasked until they're |
330 |
# fixed or in case of maintainer timeout they'll be masked for removal. |
331 |
|
332 |
gettext_missing |
333 |
|
334 |
local I18N_OBJECT=$( grep i18n.o Makefile ) |
335 |
if [[ -n ${I18N_OBJECT} ]]; then |
336 |
sed -i "s:i18n.o::g" Makefile |
337 |
dev_check "OBJECT i18n.o found" |
338 |
dev_check "removed per sed \n" |
339 |
else |
340 |
dev_check "OBJECT i18n.o not found in Makefile" |
341 |
dev_check "all fine or manual review needed? \n" |
342 |
fi |
343 |
|
344 |
local I18N_STRING=$( [[ -e i18n.h ]] && grep tI18nPhrase i18n.h ) |
345 |
if [[ -n ${I18N_STRING} ]]; then |
346 |
sed -i "s:^extern[[:space:]]*const[[:space:]]*tI18nPhrase://static const tI18nPhrase:" i18n.h |
347 |
dev_check "obsolete tI18nPhrase found" |
348 |
dev_check "disabled per sed, please recheck \n" |
349 |
else |
350 |
dev_check "obsolete tI18nPhrase not found, fine..." |
351 |
dev_check "please review, may be in subdir... \n" |
352 |
fi |
353 |
} |
354 |
# end new vdr-plugin-2.eclass content |
355 |
|
356 |
vdr-plugin-2_copy_source_tree() { |
357 |
pushd . >/dev/null |
358 |
cp -r "${S}" "${T}"/source-tree |
359 |
cd "${T}"/source-tree |
360 |
cp "${WORKDIR}"/Makefile.before Makefile |
361 |
# TODO: Fix this, maybe no longer needed |
362 |
sed -i Makefile \ |
363 |
-e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
364 |
-e 's:^CXXFLAGS:#CXXFLAGS:' \ |
365 |
-e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ |
366 |
-e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' |
367 |
popd >/dev/null |
368 |
} |
369 |
|
370 |
vdr-plugin-2_install_source_tree() { |
371 |
einfo "Installing sources" |
372 |
destdir="${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN}" |
373 |
insinto "${destdir}-${PV}" |
374 |
doins -r "${T}"/source-tree/* |
375 |
|
376 |
dosym "${VDRPLUGIN}-${PV}" "${destdir}" |
377 |
} |
378 |
|
379 |
vdr-plugin-2_print_enable_command() { |
380 |
local p_name c=0 l="" |
381 |
for p_name in ${vdr_plugin_list}; do |
382 |
c=$(( c+1 )) |
383 |
l="$l ${p_name#vdr-}" |
384 |
done |
385 |
|
386 |
elog |
387 |
case $c in |
388 |
1) elog "Installed plugin${l}" ;; |
389 |
*) elog "Installed $c plugins:${l}" ;; |
390 |
esac |
391 |
elog "To activate a plugin execute this command:" |
392 |
elog "\teselect vdr-plugin enable <plugin_name> ..." |
393 |
elog |
394 |
} |
395 |
|
396 |
has_vdr() { |
397 |
[[ -f "${VDR_INCLUDE_DIR}"/config.h ]] |
398 |
} |
399 |
|
400 |
## exported functions |
401 |
|
402 |
vdr-plugin-2_pkg_setup() { |
403 |
# -fPIC is needed for shared objects on some platforms (amd64 and others) |
404 |
append-flags -fPIC |
405 |
|
406 |
# Plugins need to be compiled with position independent code, otherwise linking |
407 |
# VDR against it will fail |
408 |
if has_version ">=media-video/vdr-1.7.13"; then |
409 |
append-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE |
410 |
fi |
411 |
|
412 |
# Where should the plugins live in the filesystem |
413 |
VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins" |
414 |
VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums" |
415 |
|
416 |
# was /usr/lib/... some time ago |
417 |
# since gentoo-vdr-scripts-0.3.6 it works with /usr/share/... |
418 |
VDR_RC_DIR="/usr/share/vdr/rcscript" |
419 |
|
420 |
# Pathes to includes |
421 |
VDR_INCLUDE_DIR="/usr/include/vdr" |
422 |
DVB_INCLUDE_DIR="/usr/include" |
423 |
|
424 |
TMP_LOCALE_DIR="${WORKDIR}/tmp-locale" |
425 |
LOCDIR="/usr/share/locale" |
426 |
|
427 |
if ! has_vdr; then |
428 |
# set to invalid values to detect abuses |
429 |
VDRVERSION="eclass_no_vdr_installed" |
430 |
APIVERSION="eclass_no_vdr_installed" |
431 |
|
432 |
if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then |
433 |
einfo "VDR not found!" |
434 |
else |
435 |
# if vdr is required |
436 |
die "VDR not found!" |
437 |
fi |
438 |
return |
439 |
fi |
440 |
|
441 |
VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h) |
442 |
APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h) |
443 |
[[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}" |
444 |
|
445 |
einfo "Compiling against" |
446 |
einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]" |
447 |
|
448 |
if [[ -n "${VDR_LOCAL_PATCHES_DIR}" ]]; then |
449 |
eerror "Using VDR_LOCAL_PATCHES_DIR is deprecated!" |
450 |
eerror "Please move all your patches into" |
451 |
eerror "${EROOT}/etc/portage/patches/${CATEGORY}/${P}" |
452 |
eerror "and remove or unset the VDR_LOCAL_PATCHES_DIR variable." |
453 |
die |
454 |
fi |
455 |
} |
456 |
|
457 |
vdr-plugin-2_src_util() { |
458 |
while [ "$1" ]; do |
459 |
case "$1" in |
460 |
all) |
461 |
vdr-plugin-2_src_util unpack add_local_patch patchmakefile linguas_patch i18n |
462 |
;; |
463 |
prepare) |
464 |
vdr-plugin-2_src_util add_local_patch patchmakefile linguas_patch i18n |
465 |
;; |
466 |
unpack) |
467 |
base_src_unpack |
468 |
;; |
469 |
add_local_patch) |
470 |
cd "${S}" || die "Could not change to plugin-source-directory!" |
471 |
epatch_user |
472 |
;; |
473 |
patchmakefile) |
474 |
cd "${S}" || die "Could not change to plugin-source-directory!" |
475 |
vdr_patchmakefile |
476 |
;; |
477 |
i18n) |
478 |
vdr_i18n |
479 |
;; |
480 |
linguas_patch) |
481 |
linguas_support |
482 |
;; |
483 |
esac |
484 |
|
485 |
shift |
486 |
done |
487 |
} |
488 |
|
489 |
vdr-plugin-2_src_unpack() { |
490 |
if [[ -z ${VDR_INCLUDE_DIR} ]]; then |
491 |
eerror "Wrong use of vdr-plugin-2.eclass." |
492 |
eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_pkg_setup." |
493 |
echo |
494 |
eerror "Please report this at bugs.gentoo.org." |
495 |
die "vdr-plugin-2_pkg_setup not called!" |
496 |
fi |
497 |
|
498 |
if [ -z "$1" ]; then |
499 |
vdr-plugin-2_src_util unpack |
500 |
else |
501 |
vdr-plugin-2_src_util $@ |
502 |
fi |
503 |
} |
504 |
|
505 |
vdr-plugin-2_src_prepare() { |
506 |
base_src_prepare |
507 |
vdr-plugin-2_src_util prepare |
508 |
} |
509 |
|
510 |
vdr-plugin-2_src_compile() { |
511 |
[ -z "$1" ] && vdr-plugin-2_src_compile copy_source compile |
512 |
|
513 |
while [ "$1" ]; do |
514 |
case "$1" in |
515 |
copy_source) |
516 |
[[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin-2_copy_source_tree |
517 |
;; |
518 |
compile) |
519 |
if [[ ! -f ${WORKDIR}/.vdr-plugin_makefile_patched ]]; then |
520 |
eerror "Wrong use of vdr-plugin-2.eclass." |
521 |
eerror "An ebuild for a vdr-plugin will not work without" |
522 |
eerror "calling vdr-plugin-2_src_unpack to patch the Makefile." |
523 |
echo |
524 |
eerror "Please report this at bugs.gentoo.org." |
525 |
die "vdr-plugin-2_src_unpack not called!" |
526 |
fi |
527 |
cd "${S}" |
528 |
|
529 |
BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all}} |
530 |
|
531 |
emake ${BUILD_PARAMS} \ |
532 |
${BUILD_TARGETS} \ |
533 |
LOCALEDIR="${TMP_LOCALE_DIR}" \ |
534 |
LIBDIR="${S}" \ |
535 |
TMPDIR="${T}" \ |
536 |
|| die "emake failed" |
537 |
;; |
538 |
esac |
539 |
|
540 |
shift |
541 |
done |
542 |
} |
543 |
|
544 |
vdr-plugin-2_src_install() { |
545 |
[[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin-2_install_source_tree |
546 |
cd "${WORKDIR}" |
547 |
|
548 |
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then |
549 |
local mname="${P}-Makefile" |
550 |
cp "${S}"/Makefile "${mname}.patched" |
551 |
cp Makefile.before "${mname}.before" |
552 |
|
553 |
diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff" |
554 |
|
555 |
insinto "/usr/share/vdr/maintainer-data/makefile-changes" |
556 |
doins "${mname}.diff" |
557 |
|
558 |
insinto "/usr/share/vdr/maintainer-data/makefile-before" |
559 |
doins "${mname}.before" |
560 |
|
561 |
insinto "/usr/share/vdr/maintainer-data/makefile-patched" |
562 |
doins "${mname}.patched" |
563 |
|
564 |
fi |
565 |
|
566 |
cd "${S}" |
567 |
insinto "${VDR_PLUGIN_DIR}" |
568 |
doins libvdr-*.so.* |
569 |
|
570 |
# create list of all created plugin libs |
571 |
vdr_plugin_list="" |
572 |
local p_name |
573 |
for p in libvdr-*.so.*; do |
574 |
p_name="${p%.so*}" |
575 |
p_name="${p_name#lib}" |
576 |
vdr_plugin_list="${vdr_plugin_list} ${p_name}" |
577 |
done |
578 |
|
579 |
create_header_checksum_file ${vdr_plugin_list} |
580 |
create_plugindb_file ${vdr_plugin_list} |
581 |
|
582 |
if [[ -d ${TMP_LOCALE_DIR} ]]; then |
583 |
einfo "Installing locales" |
584 |
cd "${TMP_LOCALE_DIR}" |
585 |
insinto "${LOCDIR}" |
586 |
doins -r * |
587 |
fi |
588 |
|
589 |
cd "${S}" |
590 |
local docfile |
591 |
for docfile in README* HISTORY CHANGELOG; do |
592 |
[[ -f ${docfile} ]] && dodoc ${docfile} |
593 |
done |
594 |
|
595 |
# if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it |
596 |
[[ -z ${VDR_CONFD_FILE} ]] && [[ -e ${FILESDIR}/confd ]] && VDR_CONFD_FILE=${FILESDIR}/confd |
597 |
|
598 |
if [[ -n ${VDR_CONFD_FILE} ]]; then |
599 |
newconfd "${VDR_CONFD_FILE}" vdr.${VDRPLUGIN} |
600 |
fi |
601 |
|
602 |
# if VDR_RCADDON_FILE is empty and ${FILESDIR}/rc-addon.sh exists take it |
603 |
[[ -z ${VDR_RCADDON_FILE} ]] && [[ -e ${FILESDIR}/rc-addon.sh ]] && VDR_RCADDON_FILE=${FILESDIR}/rc-addon.sh |
604 |
|
605 |
if [[ -n ${VDR_RCADDON_FILE} ]]; then |
606 |
insinto "${VDR_RC_DIR}" |
607 |
newins "${VDR_RCADDON_FILE}" plugin-${VDRPLUGIN}.sh |
608 |
fi |
609 |
} |
610 |
|
611 |
vdr-plugin-2_pkg_postinst() { |
612 |
vdr-plugin-2_print_enable_command |
613 |
|
614 |
if [[ -n "${VDR_CONFD_FILE}" ]]; then |
615 |
elog "Please have a look at the config-file" |
616 |
elog "\t/etc/conf.d/vdr.${VDRPLUGIN}" |
617 |
elog |
618 |
fi |
619 |
} |
620 |
|
621 |
vdr-plugin-2_pkg_postrm() { |
622 |
delete_orphan_plugindb_file |
623 |
} |
624 |
|
625 |
vdr-plugin-2_pkg_config() { |
626 |
: |
627 |
} |