/[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.25 - (hide annotations) (download)
Mon Oct 7 12:21:14 2013 UTC (10 months, 3 weeks ago) by hd_brummy
Branch: MAIN
Changes since 1.24: +2 -2 lines
small modification on output from function dev_check

1 hd_brummy 1.18 # Copyright 1999-2013 Gentoo Foundation
2 hd_brummy 1.1 # Distributed under the terms of the GNU General Public License v2
3 hd_brummy 1.25 # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin-2.eclass,v 1.24 2013/04/13 19:07:31 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 axs 1.12 4|5) ;;
50 hd_brummy 1.8 *) 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     create_header_checksum_file() {
108     # Danger: Not using $ROOT here, as compile will also not use it !!!
109     # If vdr in $ROOT and / differ, plugins will not run anyway
110    
111     local CHKSUM="header-md5-vdr"
112    
113     if [[ -f ${VDR_CHECKSUM_DIR}/header-md5-vdr ]]; then
114     cp "${VDR_CHECKSUM_DIR}/header-md5-vdr" "${CHKSUM}"
115     elif type -p md5sum >/dev/null 2>&1; then
116     (
117     cd "${VDR_INCLUDE_DIR}"
118     md5sum *.h libsi/*.h|LC_ALL=C sort --key=2
119     ) > "${CHKSUM}"
120     else
121     die "Could not create md5 checksum of headers"
122     fi
123    
124     insinto "${VDR_CHECKSUM_DIR}"
125     local p_name
126     for p_name; do
127     newins "${CHKSUM}" "header-md5-${p_name}"
128     done
129     }
130    
131     fix_vdr_libsi_include() {
132     dev_check "Fixing include of libsi-headers"
133     local f
134     for f; do
135     sed -i "${f}" \
136     -e '/#include/s:"\(.*libsi.*\)":<\1>:' \
137     -e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:'
138     done
139     }
140    
141     vdr_patchmakefile() {
142     einfo "Patching Makefile"
143     [[ -e Makefile ]] || die "Makefile of plugin can not be found!"
144     cp Makefile "${WORKDIR}"/Makefile.before
145    
146     # plugin makefiles use VDRDIR in strange ways
147     # assumptions:
148     # 1. $(VDRDIR) contains Make.config
149     # 2. $(VDRDIR) contains config.h
150     # 3. $(VDRDIR)/include/vdr contains the headers
151     # 4. $(VDRDIR) contains main vdr Makefile
152     # 5. $(VDRDIR)/locale exists
153     # 6. $(VDRDIR) allows to access vdr source files
154     #
155     # We only have one directory (for now /usr/include/vdr),
156     # that contains vdr-headers and Make.config.
157     # To satisfy 1-3 we do this:
158     # Set VDRDIR=/usr/include/vdr
159     # Set VDRINCDIR=/usr/include
160     # Change $(VDRDIR)/include to $(VDRINCDIR)
161    
162     sed -i Makefile \
163     -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \
164     -e "/^VDRDIR/a VDRINCDIR = ${VDR_INCLUDE_DIR%/vdr}" \
165     -e '/VDRINCDIR.*=/!s:$(VDRDIR)/include:$(VDRINCDIR):' \
166     \
167     -e 's:-I$(DVBDIR)/include::' \
168     -e 's:-I$(DVBDIR)::'
169    
170     # may be needed for multiproto:
171     #sed -i Makefile \
172     # -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
173     # -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
174    
175     if ! grep -q APIVERSION Makefile; then
176     ebegin " Converting to APIVERSION"
177     sed -i Makefile \
178     -e 's:^APIVERSION = :APIVERSION ?= :' \
179     -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \
180     -e '/VDRVERSION =/a\APIVERSION = $(shell sed -ne '"'"'/define APIVERSION/s/^.*"\\(.*\\)".*$$/\\1/p'"'"' $(VDRDIR)/config.h)'
181     eend $?
182     fi
183    
184     # Correcting Compile-Flags
185     # Do not overwrite CXXFLAGS, add LDFLAGS if missing
186     sed -i Makefile \
187     -e '/^CXXFLAGS[[:space:]]*=/s/=/?=/' \
188     -e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
189    
190     # Disabling file stripping, the package manager takes care of it
191     sed -i Makefile \
192     -e '/@.*strip/d' \
193     -e '/strip \$(LIBDIR)\/\$@/d' \
194     -e 's/STRIP.*=.*$/STRIP = true/'
195    
196     # Use a file instead of a variable as single-stepping via ebuild
197     # destroys environment.
198     touch "${WORKDIR}"/.vdr-plugin_makefile_patched
199     }
200    
201     # Begin new vdr-plugin-2.eclass content
202     dev_check() {
203     # A lot useful debug infos
204 hd_brummy 1.15 # set VDR_MAINTAINER_MODE="1" in make.conf
205 hd_brummy 1.1 if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
206 hd_brummy 1.25 eerror "\t Gentoo Developer Debug: $@"
207 hd_brummy 1.1 fi
208     }
209    
210     gettext_missing() {
211     # plugins without converting to gettext
212    
213     local GETTEXT_MISSING=$( grep xgettext Makefile )
214 hd_brummy 1.2 if [[ -z ${GETTEXT_MISSING} ]]; then
215 hd_brummy 1.1 dev_check "Plugin isn't converted to gettext handling \n"
216     fi
217     }
218    
219 hd_brummy 1.14 detect_po_dir() {
220 hd_brummy 1.22 # Some plugins have /po in a subdir
221 hd_brummy 1.14 # set PO_SUBDIR in .ebuild
222     # i.e media-plugins/vdr-streamdev
223     # PO_SUBDIR="client server"
224    
225     [[ -f po ]] && local po_dir="${S}"
226     local po_subdir=( ${S}/${PO_SUBDIR} )
227     local f
228    
229     pofile_dir=( ${po_dir} ${po_subdir[*]} )
230     }
231    
232 hd_brummy 1.1 linguas_support() {
233     # Patching Makefile for linguas support.
234     # Only locales, enabled through the LINGUAS (make.conf) variable will be
235     # "compiled" and installed.
236    
237     einfo "Patching for Linguas support"
238     einfo "available Languages for ${P} are:"
239    
240 hd_brummy 1.14 detect_po_dir
241 hd_brummy 1.1
242 hd_brummy 1.14 for f in ${pofile_dir[*]}; do
243 hd_brummy 1.10 PLUGIN_LINGUAS=$( ls ${f}/po --ignore="*.pot" | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
244 hd_brummy 1.1 einfo "LINGUAS=\"${PLUGIN_LINGUAS}\""
245    
246     sed -i ${f}/Makefile \
247     -e 's:\$(wildcard[[:space:]]*\$(PODIR)/\*.po):\$(foreach dir,\$(LINGUAS),\$(wildcard \$(PODIR)\/\$(dir)\*.po)):' \
248     || die "sed failed for Linguas"
249     done
250    
251 hd_brummy 1.7 strip-linguas ${PLUGIN_LINGUAS} en
252 hd_brummy 1.1 }
253    
254     vdr_i18n() {
255     # i18n handling was deprecated since >=media-video/vdr-1.5.9,
256     # finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some
257     # plugins will fail to "compile" because they're still using the old variant.
258     # Simply remove the i18n.o object from Makefile (OBJECT) and
259     # remove "static const tI18nPhrase*" from i18n.h.
260     #
261     # Plugins that are still using the old method will be pmasked until they're
262     # fixed or in case of maintainer timeout they'll be masked for removal.
263    
264     gettext_missing
265    
266     local I18N_OBJECT=$( grep i18n.o Makefile )
267     if [[ -n ${I18N_OBJECT} ]]; then
268 hd_brummy 1.6
269     if [[ "${KEEP_I18NOBJECT:-no}" = "yes" ]]; then
270     dev_check "Forced to keep i18n.o"
271     else
272     sed -i "s:i18n.o::g" Makefile
273     dev_check "OBJECT i18n.o found"
274     dev_check "removed per sed \n"
275     fi
276    
277 hd_brummy 1.1 else
278     dev_check "OBJECT i18n.o not found in Makefile"
279     dev_check "all fine or manual review needed? \n"
280     fi
281    
282     local I18N_STRING=$( [[ -e i18n.h ]] && grep tI18nPhrase i18n.h )
283     if [[ -n ${I18N_STRING} ]]; then
284     sed -i "s:^extern[[:space:]]*const[[:space:]]*tI18nPhrase://static const tI18nPhrase:" i18n.h
285     dev_check "obsolete tI18nPhrase found"
286     dev_check "disabled per sed, please recheck \n"
287     else
288     dev_check "obsolete tI18nPhrase not found, fine..."
289     dev_check "please review, may be in subdir... \n"
290     fi
291     }
292 hd_brummy 1.13
293     remove_i18n_include() {
294     # remove uneeded i18.n includes
295     # call 'remove_i18n_include bla foo'
296    
297     local f
298     for f; do
299     sed -i "${f}" \
300     -e "s:^#include[[:space:]]*\"i18n.h\"://:"
301     done
302    
303 hd_brummy 1.24 dev_check "removed i18n.h include in ${@}"
304 hd_brummy 1.13 }
305 hd_brummy 1.1 # end new vdr-plugin-2.eclass content
306    
307     vdr-plugin-2_print_enable_command() {
308     local p_name c=0 l=""
309     for p_name in ${vdr_plugin_list}; do
310     c=$(( c+1 ))
311     l="$l ${p_name#vdr-}"
312     done
313    
314     elog
315     case $c in
316     1) elog "Installed plugin${l}" ;;
317     *) elog "Installed $c plugins:${l}" ;;
318     esac
319     elog "To activate a plugin execute this command:"
320     elog "\teselect vdr-plugin enable <plugin_name> ..."
321     elog
322     }
323    
324     has_vdr() {
325     [[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
326     }
327    
328     ## exported functions
329    
330     vdr-plugin-2_pkg_setup() {
331 hd_brummy 1.15 # missing ${chost}- tag
332     tc-export CC CXX
333    
334 hd_brummy 1.1 # -fPIC is needed for shared objects on some platforms (amd64 and others)
335     append-flags -fPIC
336    
337     # Plugins need to be compiled with position independent code, otherwise linking
338     # VDR against it will fail
339     if has_version ">=media-video/vdr-1.7.13"; then
340 hd_brummy 1.16 append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
341 hd_brummy 1.1 fi
342    
343     # Where should the plugins live in the filesystem
344 hd_brummy 1.14 if has_version ">=media-video/vdr-1.7.34"; then
345     VDR_PLUGIN_DIR=$(pkg-config --variable=libdir vdr)
346     else
347     VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins"
348     fi
349    
350 hd_brummy 1.1 VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
351    
352     # was /usr/lib/... some time ago
353     # since gentoo-vdr-scripts-0.3.6 it works with /usr/share/...
354     VDR_RC_DIR="/usr/share/vdr/rcscript"
355    
356     # Pathes to includes
357     VDR_INCLUDE_DIR="/usr/include/vdr"
358     DVB_INCLUDE_DIR="/usr/include"
359    
360     TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
361 hd_brummy 1.14
362     if has_version ">=media-video/vdr-1.7.34"; then
363     LOCDIR=$(pkg-config --variable=locdir vdr)
364     else
365     LOCDIR="/usr/share/locale"
366     fi
367 hd_brummy 1.1
368     if ! has_vdr; then
369     # set to invalid values to detect abuses
370     VDRVERSION="eclass_no_vdr_installed"
371     APIVERSION="eclass_no_vdr_installed"
372    
373     if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
374     einfo "VDR not found!"
375     else
376     # if vdr is required
377     die "VDR not found!"
378     fi
379     return
380     fi
381    
382 hd_brummy 1.14 if has_version ">=media-video/vdr-1.7.34"; then
383 hd_brummy 1.23 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
384 hd_brummy 1.14 APIVERSION=$(pkg-config --variable=apiversion vdr)
385     else
386     VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
387     APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
388 hd_brummy 1.1 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
389 hd_brummy 1.14 fi
390 hd_brummy 1.1
391     einfo "Compiling against"
392 hd_brummy 1.17 einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]"
393 hd_brummy 1.1
394     if [[ -n "${VDR_LOCAL_PATCHES_DIR}" ]]; then
395     eerror "Using VDR_LOCAL_PATCHES_DIR is deprecated!"
396     eerror "Please move all your patches into"
397     eerror "${EROOT}/etc/portage/patches/${CATEGORY}/${P}"
398     eerror "and remove or unset the VDR_LOCAL_PATCHES_DIR variable."
399     die
400     fi
401     }
402    
403     vdr-plugin-2_src_util() {
404     while [ "$1" ]; do
405     case "$1" in
406     all)
407     vdr-plugin-2_src_util unpack add_local_patch patchmakefile linguas_patch i18n
408     ;;
409     prepare)
410     vdr-plugin-2_src_util add_local_patch patchmakefile linguas_patch i18n
411     ;;
412     unpack)
413     base_src_unpack
414     ;;
415     add_local_patch)
416     cd "${S}" || die "Could not change to plugin-source-directory!"
417     epatch_user
418     ;;
419     patchmakefile)
420     cd "${S}" || die "Could not change to plugin-source-directory!"
421     vdr_patchmakefile
422     ;;
423     i18n)
424     vdr_i18n
425     ;;
426     linguas_patch)
427     linguas_support
428     ;;
429     esac
430    
431     shift
432     done
433     }
434    
435     vdr-plugin-2_src_unpack() {
436     if [[ -z ${VDR_INCLUDE_DIR} ]]; then
437     eerror "Wrong use of vdr-plugin-2.eclass."
438 hd_brummy 1.3 eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_unpack."
439 hd_brummy 1.1 echo
440     eerror "Please report this at bugs.gentoo.org."
441 hd_brummy 1.3 die "vdr-plugin-2_src_unpack not called!"
442 hd_brummy 1.1 fi
443    
444     if [ -z "$1" ]; then
445     vdr-plugin-2_src_util unpack
446     else
447     vdr-plugin-2_src_util $@
448     fi
449     }
450    
451     vdr-plugin-2_src_prepare() {
452 hd_brummy 1.3 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
453     eerror "Wrong use of vdr-plugin-2.eclass."
454     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_prepare."
455     echo
456     eerror "Please report this at bugs.gentoo.org."
457     die "vdr-plugin-2_src_prepare not called!"
458     fi
459    
460 hd_brummy 1.1 base_src_prepare
461     vdr-plugin-2_src_util prepare
462     }
463    
464     vdr-plugin-2_src_compile() {
465 hd_brummy 1.22 [ -z "$1" ] && vdr-plugin-2_src_compile compile
466 hd_brummy 1.1
467     while [ "$1" ]; do
468     case "$1" in
469     compile)
470     if [[ ! -f ${WORKDIR}/.vdr-plugin_makefile_patched ]]; then
471     eerror "Wrong use of vdr-plugin-2.eclass."
472     eerror "An ebuild for a vdr-plugin will not work without"
473 hd_brummy 1.3 eerror "calling vdr-plugin-2_src_compile to patch the Makefile."
474 hd_brummy 1.1 echo
475     eerror "Please report this at bugs.gentoo.org."
476 hd_brummy 1.3 die "vdr-plugin-2_src_compile not called!"
477 hd_brummy 1.1 fi
478     cd "${S}"
479    
480 hd_brummy 1.14 BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all }}
481     emake ${BUILD_PARAMS} \
482     ${BUILD_TARGETS} \
483     LOCALEDIR="${TMP_LOCALE_DIR}" \
484 hd_brummy 1.18 LOCDIR="${TMP_LOCALE_DIR}" \
485 hd_brummy 1.14 LIBDIR="${S}" \
486     TMPDIR="${T}" \
487     || die "emake failed"
488 hd_brummy 1.1 ;;
489     esac
490    
491     shift
492     done
493     }
494    
495     vdr-plugin-2_src_install() {
496 hd_brummy 1.3 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
497     eerror "Wrong use of vdr-plugin-2.eclass."
498     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_install."
499     echo
500     eerror "Please report this at bugs.gentoo.org."
501     die "vdr-plugin-2_src_install not called!"
502     fi
503    
504 hd_brummy 1.1 cd "${WORKDIR}"
505    
506     if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
507     local mname="${P}-Makefile"
508     cp "${S}"/Makefile "${mname}.patched"
509     cp Makefile.before "${mname}.before"
510    
511     diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff"
512    
513     insinto "/usr/share/vdr/maintainer-data/makefile-changes"
514     doins "${mname}.diff"
515    
516     insinto "/usr/share/vdr/maintainer-data/makefile-before"
517     doins "${mname}.before"
518    
519     insinto "/usr/share/vdr/maintainer-data/makefile-patched"
520     doins "${mname}.patched"
521    
522     fi
523    
524     cd "${S}"
525 hd_brummy 1.14
526 hd_brummy 1.18 local SOFILE_STRING=$(grep SOFILE Makefile)
527     if [[ -n ${SOFILE_STRING} ]]; then
528 hd_brummy 1.20 dev_check "einstall with new Makefile handling"
529 hd_brummy 1.18 BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install }}
530     einstall ${BUILD_PARAMS} \
531     ${BUILD_TARGETS} \
532     TMPDIR="${T}" \
533     DESTDIR="${D}" \
534     || die "einstall (makefile target) failed"
535 hd_brummy 1.22 else
536     insinto "${VDR_PLUGIN_DIR}"
537     doins libvdr-*.so.*
538     fi
539 hd_brummy 1.18
540     if [[ -d ${TMP_LOCALE_DIR} ]]; then
541     einfo "Installing locales"
542     cd "${TMP_LOCALE_DIR}"
543    
544     local linguas
545     for linguas in ${LINGUAS[*]}; do
546     insinto "${LOCDIR}"
547     cp -r --parents ${linguas}* ${D}/${LOCDIR}
548     done
549     fi
550    
551 hd_brummy 1.22 cd "${D}/usr/$(get_libdir)/vdr/plugins"
552 hd_brummy 1.19
553 hd_brummy 1.1 # 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 hd_brummy 1.22 cd "${S}"
563    
564 hd_brummy 1.1 create_header_checksum_file ${vdr_plugin_list}
565     create_plugindb_file ${vdr_plugin_list}
566    
567     local docfile
568     for docfile in README* HISTORY CHANGELOG; do
569     [[ -f ${docfile} ]] && dodoc ${docfile}
570     done
571    
572     # if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
573     [[ -z ${VDR_CONFD_FILE} ]] && [[ -e ${FILESDIR}/confd ]] && VDR_CONFD_FILE=${FILESDIR}/confd
574    
575     if [[ -n ${VDR_CONFD_FILE} ]]; then
576     newconfd "${VDR_CONFD_FILE}" vdr.${VDRPLUGIN}
577     fi
578    
579     # if VDR_RCADDON_FILE is empty and ${FILESDIR}/rc-addon.sh exists take it
580     [[ -z ${VDR_RCADDON_FILE} ]] && [[ -e ${FILESDIR}/rc-addon.sh ]] && VDR_RCADDON_FILE=${FILESDIR}/rc-addon.sh
581    
582     if [[ -n ${VDR_RCADDON_FILE} ]]; then
583     insinto "${VDR_RC_DIR}"
584     newins "${VDR_RCADDON_FILE}" plugin-${VDRPLUGIN}.sh
585     fi
586     }
587    
588     vdr-plugin-2_pkg_postinst() {
589     vdr-plugin-2_print_enable_command
590    
591     if [[ -n "${VDR_CONFD_FILE}" ]]; then
592     elog "Please have a look at the config-file"
593     elog "\t/etc/conf.d/vdr.${VDRPLUGIN}"
594     elog
595     fi
596     }
597    
598     vdr-plugin-2_pkg_postrm() {
599 hd_brummy 1.22 :
600 hd_brummy 1.1 }
601    
602     vdr-plugin-2_pkg_config() {
603     :
604     }

  ViewVC Help
Powered by ViewVC 1.1.20