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