/[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.6 - (show annotations) (download)
Sun Jun 10 14:21:20 2012 UTC (2 years, 3 months ago) by hd_brummy
Branch: MAIN
Changes since 1.5: +15 -6 lines
fixed missing chost tag; fixed append-cppflags warning; added Variable to keep the i18n.o object

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

  ViewVC Help
Powered by ViewVC 1.1.20