/[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.8 - (hide annotations) (download)
Wed Jun 27 18:54:58 2012 UTC (2 years, 2 months ago) by hd_brummy
Branch: MAIN
Changes since 1.7: +5 -4 lines
fixed eapi block; bug 423657

1 hd_brummy 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 hd_brummy 1.8 # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin-2.eclass,v 1.7 2012/06/10 14:59:55 hd_brummy Exp $
4 hd_brummy 1.1
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 hd_brummy 1.6 inherit base eutils flag-o-matic multilib toolchain-funcs
47 hd_brummy 1.1
48 hd_brummy 1.8 case ${EAPI:-0} in
49     4) ;;
50     *) die "EAPI ${EAPI} unsupported."
51     esac
52 hd_brummy 1.1
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 /etc/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 hd_brummy 1.2 if [[ -z ${GETTEXT_MISSING} ]]; then
240 hd_brummy 1.1 dev_check "Plugin isn't converted to gettext handling \n"
241     fi
242     }
243    
244     linguas_support() {
245     # Patching Makefile for linguas support.
246     # Only locales, enabled through the LINGUAS (make.conf) variable will be
247     # "compiled" and installed.
248     #
249     # Some plugins have po/ in a subdir
250     # set PO_SUBDIR in .ebuild
251     # i.e media-plugins/vdr-streamdev
252     # PO_SUBDIR="client server"
253    
254     einfo "Patching for Linguas support"
255     einfo "available Languages for ${P} are:"
256    
257     [[ -f po ]] && local po_dir="${S}"
258     local po_subdir=( ${S}/${PO_SUBDIR} )
259     local f
260    
261     makefile_dir=( ${po_dir} ${po_subdir[*]} )
262    
263     for f in ${makefile_dir[*]}; do
264    
265     PLUGIN_LINGUAS=$( ls ${f}/po | tr \\\012 ' ' | tr -d [:upper:] | tr -d [:punct:] |sed -e "s:po::g" )
266     einfo "LINGUAS=\"${PLUGIN_LINGUAS}\""
267    
268     sed -i ${f}/Makefile \
269     -e 's:\$(wildcard[[:space:]]*\$(PODIR)/\*.po):\$(foreach dir,\$(LINGUAS),\$(wildcard \$(PODIR)\/\$(dir)\*.po)):' \
270     || die "sed failed for Linguas"
271     done
272    
273 hd_brummy 1.7 strip-linguas ${PLUGIN_LINGUAS} en
274 hd_brummy 1.4
275 hd_brummy 1.1 # maintainer check
276     if [[ ! -d po ]]; then
277     dev_check "po dir not found? May be in subdir? \n"
278     fi
279     }
280    
281     vdr_i18n() {
282     # i18n handling was deprecated since >=media-video/vdr-1.5.9,
283     # finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some
284     # plugins will fail to "compile" because they're still using the old variant.
285     # Simply remove the i18n.o object from Makefile (OBJECT) and
286     # remove "static const tI18nPhrase*" from i18n.h.
287     #
288     # Plugins that are still using the old method will be pmasked until they're
289     # fixed or in case of maintainer timeout they'll be masked for removal.
290    
291     gettext_missing
292    
293     local I18N_OBJECT=$( grep i18n.o Makefile )
294     if [[ -n ${I18N_OBJECT} ]]; then
295 hd_brummy 1.6
296     if [[ "${KEEP_I18NOBJECT:-no}" = "yes" ]]; then
297     dev_check "Forced to keep i18n.o"
298     else
299     sed -i "s:i18n.o::g" Makefile
300     dev_check "OBJECT i18n.o found"
301     dev_check "removed per sed \n"
302     fi
303    
304 hd_brummy 1.1 else
305     dev_check "OBJECT i18n.o not found in Makefile"
306     dev_check "all fine or manual review needed? \n"
307     fi
308    
309     local I18N_STRING=$( [[ -e i18n.h ]] && grep tI18nPhrase i18n.h )
310     if [[ -n ${I18N_STRING} ]]; then
311     sed -i "s:^extern[[:space:]]*const[[:space:]]*tI18nPhrase://static const tI18nPhrase:" i18n.h
312     dev_check "obsolete tI18nPhrase found"
313     dev_check "disabled per sed, please recheck \n"
314     else
315     dev_check "obsolete tI18nPhrase not found, fine..."
316     dev_check "please review, may be in subdir... \n"
317     fi
318     }
319     # end new vdr-plugin-2.eclass content
320    
321     vdr-plugin-2_copy_source_tree() {
322     pushd . >/dev/null
323     cp -r "${S}" "${T}"/source-tree
324     cd "${T}"/source-tree
325     cp "${WORKDIR}"/Makefile.before Makefile
326     # TODO: Fix this, maybe no longer needed
327     sed -i Makefile \
328     -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
329     -e 's:^CXXFLAGS:#CXXFLAGS:' \
330     -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \
331     -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):'
332     popd >/dev/null
333     }
334    
335     vdr-plugin-2_install_source_tree() {
336     einfo "Installing sources"
337     destdir="${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN}"
338     insinto "${destdir}-${PV}"
339     doins -r "${T}"/source-tree/*
340    
341     dosym "${VDRPLUGIN}-${PV}" "${destdir}"
342     }
343    
344     vdr-plugin-2_print_enable_command() {
345     local p_name c=0 l=""
346     for p_name in ${vdr_plugin_list}; do
347     c=$(( c+1 ))
348     l="$l ${p_name#vdr-}"
349     done
350    
351     elog
352     case $c in
353     1) elog "Installed plugin${l}" ;;
354     *) elog "Installed $c plugins:${l}" ;;
355     esac
356     elog "To activate a plugin execute this command:"
357     elog "\teselect vdr-plugin enable <plugin_name> ..."
358     elog
359     }
360    
361     has_vdr() {
362     [[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
363     }
364    
365     ## exported functions
366    
367     vdr-plugin-2_pkg_setup() {
368     # -fPIC is needed for shared objects on some platforms (amd64 and others)
369     append-flags -fPIC
370    
371     # Plugins need to be compiled with position independent code, otherwise linking
372     # VDR against it will fail
373     if has_version ">=media-video/vdr-1.7.13"; then
374 hd_brummy 1.6 append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
375 hd_brummy 1.1 fi
376    
377 hd_brummy 1.6 # missing ${chost}- tag
378     tc-export CC CXX
379    
380 hd_brummy 1.1 # Where should the plugins live in the filesystem
381     VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins"
382     VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
383    
384     # was /usr/lib/... some time ago
385     # since gentoo-vdr-scripts-0.3.6 it works with /usr/share/...
386     VDR_RC_DIR="/usr/share/vdr/rcscript"
387    
388     # Pathes to includes
389     VDR_INCLUDE_DIR="/usr/include/vdr"
390     DVB_INCLUDE_DIR="/usr/include"
391    
392     TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
393     LOCDIR="/usr/share/locale"
394    
395     if ! has_vdr; then
396     # set to invalid values to detect abuses
397     VDRVERSION="eclass_no_vdr_installed"
398     APIVERSION="eclass_no_vdr_installed"
399    
400     if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
401     einfo "VDR not found!"
402     else
403     # if vdr is required
404     die "VDR not found!"
405     fi
406     return
407     fi
408    
409     VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
410     APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
411     [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
412    
413     einfo "Compiling against"
414     einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]"
415    
416     if [[ -n "${VDR_LOCAL_PATCHES_DIR}" ]]; then
417     eerror "Using VDR_LOCAL_PATCHES_DIR is deprecated!"
418     eerror "Please move all your patches into"
419     eerror "${EROOT}/etc/portage/patches/${CATEGORY}/${P}"
420     eerror "and remove or unset the VDR_LOCAL_PATCHES_DIR variable."
421     die
422     fi
423     }
424    
425     vdr-plugin-2_src_util() {
426     while [ "$1" ]; do
427     case "$1" in
428     all)
429     vdr-plugin-2_src_util unpack add_local_patch patchmakefile linguas_patch i18n
430     ;;
431     prepare)
432     vdr-plugin-2_src_util add_local_patch patchmakefile linguas_patch i18n
433     ;;
434     unpack)
435     base_src_unpack
436     ;;
437     add_local_patch)
438     cd "${S}" || die "Could not change to plugin-source-directory!"
439     epatch_user
440     ;;
441     patchmakefile)
442     cd "${S}" || die "Could not change to plugin-source-directory!"
443     vdr_patchmakefile
444     ;;
445     i18n)
446     vdr_i18n
447     ;;
448     linguas_patch)
449     linguas_support
450     ;;
451     esac
452    
453     shift
454     done
455     }
456    
457     vdr-plugin-2_src_unpack() {
458     if [[ -z ${VDR_INCLUDE_DIR} ]]; then
459     eerror "Wrong use of vdr-plugin-2.eclass."
460 hd_brummy 1.3 eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_unpack."
461 hd_brummy 1.1 echo
462     eerror "Please report this at bugs.gentoo.org."
463 hd_brummy 1.3 die "vdr-plugin-2_src_unpack not called!"
464 hd_brummy 1.1 fi
465    
466     if [ -z "$1" ]; then
467     vdr-plugin-2_src_util unpack
468     else
469     vdr-plugin-2_src_util $@
470     fi
471     }
472    
473     vdr-plugin-2_src_prepare() {
474 hd_brummy 1.3 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
475     eerror "Wrong use of vdr-plugin-2.eclass."
476     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_prepare."
477     echo
478     eerror "Please report this at bugs.gentoo.org."
479     die "vdr-plugin-2_src_prepare not called!"
480     fi
481    
482 hd_brummy 1.1 base_src_prepare
483     vdr-plugin-2_src_util prepare
484     }
485    
486     vdr-plugin-2_src_compile() {
487     [ -z "$1" ] && vdr-plugin-2_src_compile copy_source compile
488    
489     while [ "$1" ]; do
490     case "$1" in
491     copy_source)
492     [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin-2_copy_source_tree
493     ;;
494     compile)
495     if [[ ! -f ${WORKDIR}/.vdr-plugin_makefile_patched ]]; then
496     eerror "Wrong use of vdr-plugin-2.eclass."
497     eerror "An ebuild for a vdr-plugin will not work without"
498 hd_brummy 1.3 eerror "calling vdr-plugin-2_src_compile to patch the Makefile."
499 hd_brummy 1.1 echo
500     eerror "Please report this at bugs.gentoo.org."
501 hd_brummy 1.3 die "vdr-plugin-2_src_compile not called!"
502 hd_brummy 1.1 fi
503     cd "${S}"
504    
505     BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all}}
506    
507     emake ${BUILD_PARAMS} \
508     ${BUILD_TARGETS} \
509     LOCALEDIR="${TMP_LOCALE_DIR}" \
510     LIBDIR="${S}" \
511     TMPDIR="${T}" \
512     || die "emake failed"
513     ;;
514     esac
515    
516     shift
517     done
518     }
519    
520     vdr-plugin-2_src_install() {
521 hd_brummy 1.3 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
522     eerror "Wrong use of vdr-plugin-2.eclass."
523     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_install."
524     echo
525     eerror "Please report this at bugs.gentoo.org."
526     die "vdr-plugin-2_src_install not called!"
527     fi
528    
529 hd_brummy 1.1 [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin-2_install_source_tree
530     cd "${WORKDIR}"
531    
532     if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
533     local mname="${P}-Makefile"
534     cp "${S}"/Makefile "${mname}.patched"
535     cp Makefile.before "${mname}.before"
536    
537     diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff"
538    
539     insinto "/usr/share/vdr/maintainer-data/makefile-changes"
540     doins "${mname}.diff"
541    
542     insinto "/usr/share/vdr/maintainer-data/makefile-before"
543     doins "${mname}.before"
544    
545     insinto "/usr/share/vdr/maintainer-data/makefile-patched"
546     doins "${mname}.patched"
547    
548     fi
549    
550     cd "${S}"
551     insinto "${VDR_PLUGIN_DIR}"
552     doins libvdr-*.so.*
553    
554     # create list of all created plugin libs
555     vdr_plugin_list=""
556     local p_name
557     for p in libvdr-*.so.*; do
558     p_name="${p%.so*}"
559     p_name="${p_name#lib}"
560     vdr_plugin_list="${vdr_plugin_list} ${p_name}"
561     done
562    
563     create_header_checksum_file ${vdr_plugin_list}
564     create_plugindb_file ${vdr_plugin_list}
565    
566     if [[ -d ${TMP_LOCALE_DIR} ]]; then
567     einfo "Installing locales"
568     cd "${TMP_LOCALE_DIR}"
569 hd_brummy 1.5 local linguas
570     for linguas in ${LINGUAS[*]}; do
571     insinto "${LOCDIR}"
572     cp -r --parents ${linguas}* ${D}/${LOCDIR}
573     done
574 hd_brummy 1.1 fi
575    
576     cd "${S}"
577     local docfile
578     for docfile in README* HISTORY CHANGELOG; do
579     [[ -f ${docfile} ]] && dodoc ${docfile}
580     done
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     delete_orphan_plugindb_file
610     }
611    
612     vdr-plugin-2_pkg_config() {
613     :
614     }

  ViewVC Help
Powered by ViewVC 1.1.20