/[gentoo-x86]/eclass/vdr-plugin-2.eclass
Gentoo

Contents of /eclass/vdr-plugin-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Mon Dec 31 09:27:00 2012 UTC (15 months, 2 weeks ago) by hd_brummy
Branch: MAIN
Changes since 1.14: +15 -13 lines
vdr-plugin-2.eclass; better detection of new Makefile handling, fixed some mistakes in inherited append-*flags

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

  ViewVC Help
Powered by ViewVC 1.1.20