/[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.13 - (hide annotations) (download)
Sat Sep 29 19:38:56 2012 UTC (21 months, 1 week ago) by hd_brummy
Branch: MAIN
Changes since 1.12: +14 -1 lines
added helper function to remove i18n.h includes, if media-plugins/vdr-* are still use the obsoleted i18n handling and unsupported to gettext handling

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.13 # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin-2.eclass,v 1.12 2012/09/27 16:35:42 axs 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     # 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 hd_brummy 1.10 PLUGIN_LINGUAS=$( ls ${f}/po --ignore="*.pot" | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
266 hd_brummy 1.1 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 hd_brummy 1.13
320     remove_i18n_include() {
321     # remove uneeded i18.n includes
322     # call 'remove_i18n_include bla foo'
323    
324     local f
325     for f; do
326     sed -i "${f}" \
327     -e "s:^#include[[:space:]]*\"i18n.h\"://:"
328     done
329    
330     dev_check "removed i18n.h for ${@}"
331     }
332 hd_brummy 1.1 # end new vdr-plugin-2.eclass content
333    
334     vdr-plugin-2_copy_source_tree() {
335     pushd . >/dev/null
336     cp -r "${S}" "${T}"/source-tree
337     cd "${T}"/source-tree
338     cp "${WORKDIR}"/Makefile.before Makefile
339     # TODO: Fix this, maybe no longer needed
340     sed -i Makefile \
341     -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
342     -e 's:^CXXFLAGS:#CXXFLAGS:' \
343     -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \
344     -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):'
345     popd >/dev/null
346     }
347    
348     vdr-plugin-2_install_source_tree() {
349     einfo "Installing sources"
350     destdir="${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN}"
351     insinto "${destdir}-${PV}"
352     doins -r "${T}"/source-tree/*
353    
354     dosym "${VDRPLUGIN}-${PV}" "${destdir}"
355     }
356    
357     vdr-plugin-2_print_enable_command() {
358     local p_name c=0 l=""
359     for p_name in ${vdr_plugin_list}; do
360     c=$(( c+1 ))
361     l="$l ${p_name#vdr-}"
362     done
363    
364     elog
365     case $c in
366     1) elog "Installed plugin${l}" ;;
367     *) elog "Installed $c plugins:${l}" ;;
368     esac
369     elog "To activate a plugin execute this command:"
370     elog "\teselect vdr-plugin enable <plugin_name> ..."
371     elog
372     }
373    
374     has_vdr() {
375     [[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
376     }
377    
378     ## exported functions
379    
380     vdr-plugin-2_pkg_setup() {
381     # -fPIC is needed for shared objects on some platforms (amd64 and others)
382     append-flags -fPIC
383    
384     # Plugins need to be compiled with position independent code, otherwise linking
385     # VDR against it will fail
386     if has_version ">=media-video/vdr-1.7.13"; then
387 hd_brummy 1.11 append-lfs-flags
388 hd_brummy 1.1 fi
389    
390 hd_brummy 1.6 # missing ${chost}- tag
391     tc-export CC CXX
392    
393 hd_brummy 1.1 # Where should the plugins live in the filesystem
394     VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins"
395     VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
396    
397     # was /usr/lib/... some time ago
398     # since gentoo-vdr-scripts-0.3.6 it works with /usr/share/...
399     VDR_RC_DIR="/usr/share/vdr/rcscript"
400    
401     # Pathes to includes
402     VDR_INCLUDE_DIR="/usr/include/vdr"
403     DVB_INCLUDE_DIR="/usr/include"
404    
405     TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
406     LOCDIR="/usr/share/locale"
407    
408     if ! has_vdr; then
409     # set to invalid values to detect abuses
410     VDRVERSION="eclass_no_vdr_installed"
411     APIVERSION="eclass_no_vdr_installed"
412    
413     if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
414     einfo "VDR not found!"
415     else
416     # if vdr is required
417     die "VDR not found!"
418     fi
419     return
420     fi
421    
422     VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
423     APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
424     [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
425    
426     einfo "Compiling against"
427     einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]"
428    
429     if [[ -n "${VDR_LOCAL_PATCHES_DIR}" ]]; then
430     eerror "Using VDR_LOCAL_PATCHES_DIR is deprecated!"
431     eerror "Please move all your patches into"
432     eerror "${EROOT}/etc/portage/patches/${CATEGORY}/${P}"
433     eerror "and remove or unset the VDR_LOCAL_PATCHES_DIR variable."
434     die
435     fi
436     }
437    
438     vdr-plugin-2_src_util() {
439     while [ "$1" ]; do
440     case "$1" in
441     all)
442     vdr-plugin-2_src_util unpack add_local_patch patchmakefile linguas_patch i18n
443     ;;
444     prepare)
445     vdr-plugin-2_src_util add_local_patch patchmakefile linguas_patch i18n
446     ;;
447     unpack)
448     base_src_unpack
449     ;;
450     add_local_patch)
451     cd "${S}" || die "Could not change to plugin-source-directory!"
452     epatch_user
453     ;;
454     patchmakefile)
455     cd "${S}" || die "Could not change to plugin-source-directory!"
456     vdr_patchmakefile
457     ;;
458     i18n)
459     vdr_i18n
460     ;;
461     linguas_patch)
462     linguas_support
463     ;;
464     esac
465    
466     shift
467     done
468     }
469    
470     vdr-plugin-2_src_unpack() {
471     if [[ -z ${VDR_INCLUDE_DIR} ]]; then
472     eerror "Wrong use of vdr-plugin-2.eclass."
473 hd_brummy 1.3 eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_unpack."
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_unpack not called!"
477 hd_brummy 1.1 fi
478    
479     if [ -z "$1" ]; then
480     vdr-plugin-2_src_util unpack
481     else
482     vdr-plugin-2_src_util $@
483     fi
484     }
485    
486     vdr-plugin-2_src_prepare() {
487 hd_brummy 1.3 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
488     eerror "Wrong use of vdr-plugin-2.eclass."
489     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_prepare."
490     echo
491     eerror "Please report this at bugs.gentoo.org."
492     die "vdr-plugin-2_src_prepare not called!"
493     fi
494    
495 hd_brummy 1.1 base_src_prepare
496     vdr-plugin-2_src_util prepare
497     }
498    
499     vdr-plugin-2_src_compile() {
500     [ -z "$1" ] && vdr-plugin-2_src_compile copy_source compile
501    
502     while [ "$1" ]; do
503     case "$1" in
504     copy_source)
505     [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin-2_copy_source_tree
506     ;;
507     compile)
508     if [[ ! -f ${WORKDIR}/.vdr-plugin_makefile_patched ]]; then
509     eerror "Wrong use of vdr-plugin-2.eclass."
510     eerror "An ebuild for a vdr-plugin will not work without"
511 hd_brummy 1.3 eerror "calling vdr-plugin-2_src_compile to patch the Makefile."
512 hd_brummy 1.1 echo
513     eerror "Please report this at bugs.gentoo.org."
514 hd_brummy 1.3 die "vdr-plugin-2_src_compile not called!"
515 hd_brummy 1.1 fi
516     cd "${S}"
517    
518     BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all}}
519    
520     emake ${BUILD_PARAMS} \
521     ${BUILD_TARGETS} \
522     LOCALEDIR="${TMP_LOCALE_DIR}" \
523     LIBDIR="${S}" \
524     TMPDIR="${T}" \
525     || die "emake failed"
526     ;;
527     esac
528    
529     shift
530     done
531     }
532    
533     vdr-plugin-2_src_install() {
534 hd_brummy 1.3 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
535     eerror "Wrong use of vdr-plugin-2.eclass."
536     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_install."
537     echo
538     eerror "Please report this at bugs.gentoo.org."
539     die "vdr-plugin-2_src_install not called!"
540     fi
541    
542 hd_brummy 1.1 [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin-2_install_source_tree
543     cd "${WORKDIR}"
544    
545     if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
546     local mname="${P}-Makefile"
547     cp "${S}"/Makefile "${mname}.patched"
548     cp Makefile.before "${mname}.before"
549    
550     diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff"
551    
552     insinto "/usr/share/vdr/maintainer-data/makefile-changes"
553     doins "${mname}.diff"
554    
555     insinto "/usr/share/vdr/maintainer-data/makefile-before"
556     doins "${mname}.before"
557    
558     insinto "/usr/share/vdr/maintainer-data/makefile-patched"
559     doins "${mname}.patched"
560    
561     fi
562    
563     cd "${S}"
564     insinto "${VDR_PLUGIN_DIR}"
565     doins libvdr-*.so.*
566    
567     # create list of all created plugin libs
568     vdr_plugin_list=""
569     local p_name
570     for p in libvdr-*.so.*; do
571     p_name="${p%.so*}"
572     p_name="${p_name#lib}"
573     vdr_plugin_list="${vdr_plugin_list} ${p_name}"
574     done
575    
576     create_header_checksum_file ${vdr_plugin_list}
577     create_plugindb_file ${vdr_plugin_list}
578    
579     if [[ -d ${TMP_LOCALE_DIR} ]]; then
580     einfo "Installing locales"
581     cd "${TMP_LOCALE_DIR}"
582 hd_brummy 1.5 local linguas
583     for linguas in ${LINGUAS[*]}; do
584     insinto "${LOCDIR}"
585     cp -r --parents ${linguas}* ${D}/${LOCDIR}
586     done
587 hd_brummy 1.1 fi
588    
589     cd "${S}"
590     local docfile
591     for docfile in README* HISTORY CHANGELOG; do
592     [[ -f ${docfile} ]] && dodoc ${docfile}
593     done
594    
595     # if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
596     [[ -z ${VDR_CONFD_FILE} ]] && [[ -e ${FILESDIR}/confd ]] && VDR_CONFD_FILE=${FILESDIR}/confd
597    
598     if [[ -n ${VDR_CONFD_FILE} ]]; then
599     newconfd "${VDR_CONFD_FILE}" vdr.${VDRPLUGIN}
600     fi
601    
602     # if VDR_RCADDON_FILE is empty and ${FILESDIR}/rc-addon.sh exists take it
603     [[ -z ${VDR_RCADDON_FILE} ]] && [[ -e ${FILESDIR}/rc-addon.sh ]] && VDR_RCADDON_FILE=${FILESDIR}/rc-addon.sh
604    
605     if [[ -n ${VDR_RCADDON_FILE} ]]; then
606     insinto "${VDR_RC_DIR}"
607     newins "${VDR_RCADDON_FILE}" plugin-${VDRPLUGIN}.sh
608     fi
609     }
610    
611     vdr-plugin-2_pkg_postinst() {
612     vdr-plugin-2_print_enable_command
613    
614     if [[ -n "${VDR_CONFD_FILE}" ]]; then
615     elog "Please have a look at the config-file"
616     elog "\t/etc/conf.d/vdr.${VDRPLUGIN}"
617     elog
618     fi
619     }
620    
621     vdr-plugin-2_pkg_postrm() {
622     delete_orphan_plugindb_file
623     }
624    
625     vdr-plugin-2_pkg_config() {
626     :
627     }

  ViewVC Help
Powered by ViewVC 1.1.20