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