/[gentoo-x86]/eclass/vdr-plugin.eclass
Gentoo

Contents of /eclass/vdr-plugin.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.93 - (hide annotations) (download)
Sat Apr 26 05:13:24 2014 UTC (2 months, 3 weeks ago) by hd_brummy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.92: +1 -1 lines
FILE REMOVED
vdr-plugin.eclass removed, see #497058, #489116

1 hd_brummy 1.92 # Copyright 1999-2014 Gentoo Foundation
2 zzam 1.1 # Distributed under the terms of the GNU General Public License v2
3 hd_brummy 1.93 # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.92 2014/01/15 01:12:10 hd_brummy Exp $
4 hd_brummy 1.92
5     # @DEAD
6 idl0r 1.79
7     # @ECLASS: vdr-plugin.eclass
8     # @MAINTAINER:
9     # vdr@gentoo.org
10     # @BLURB: common vdr plugin ebuild functions
11     # @DESCRIPTION:
12     # Eclass for easing maitenance of vdr plugin ebuilds
13    
14 idl0r 1.80 # Authors:
15     # Matthias Schwarzott <zzam@gentoo.org>
16     # Joerg Bornkessel <hd_brummy@gentoo.org>
17     # Christian Ruppert <idl0r@gentoo.org>
18    
19     # Plugin config file installation:
20     #
21     # A plugin config file can be specified through the $VDR_CONFD_FILE variable, it
22     # defaults to ${FILESDIR}/confd. Each config file will be installed as e.g.
23     # ${D}/etc/conf.d/vdr.${VDRPLUGIN}
24    
25     # Installation of rc-addon files:
26     # NOTE: rc-addon files must be valid shell scripts!
27     #
28     # Installing rc-addon files is basically the same as for plugin config files
29     # (see above), it's just using the $VDR_RCADDON_FILE variable instead.
30     # The default value when $VDR_RCADDON_FILE is undefined is:
31     # ${FILESDIR}/rc-addon.sh and will be installed as
32     # ${VDR_RC_DIR}/plugin-${VDRPLUGIN}.sh
33     #
34     # The rc-addon files will be sourced by the startscript when the specific plugin
35     # has been enabled.
36     # rc-addon files may be used to prepare everything that is necessary for the
37     # plugin start/stop, like passing extra command line options and so on.
38    
39     # Applying your own local/user patches:
40     # This is done by using the epatch_user() function of the eutils.eclass.
41     # Simply put your patches into one of these directories:
42     # /etc/portage/patches/<CATEGORY>/<PF|P|PN>/
43     # Quote: where the first of these three directories to exist will be the one to
44     # use, ignoring any more general directories which might exist as well.
45 hd_brummy 1.27 #
46 idl0r 1.80 # For more details about it please take a look at the eutils.class.
47 hd_brummy 1.27
48 zzam 1.22 inherit base multilib eutils flag-o-matic
49 zzam 1.1
50 axs 1.90 if ! has "${EAPI:-0}" 0 1 2 3 4 5; then
51 hd_brummy 1.72 die "API of vdr-plugin.eclass in EAPI=\"${EAPI}\" not established"
52     fi
53    
54 zzam 1.39 IUSE=""
55 zzam 1.15
56 zzam 1.1 # Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes
57     VDRPLUGIN="${PN/#vdrplugin-/}"
58 zzam 1.2 VDRPLUGIN="${VDRPLUGIN/#vdr-/}"
59 zzam 1.1 VDRPLUGIN="${VDRPLUGIN/%-cvs/}"
60    
61     DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin.eclass)"
62    
63     # works in most cases
64     S="${WORKDIR}/${VDRPLUGIN}-${PV}"
65    
66     # depend on headers for DVB-driver
67 zzam 1.65 COMMON_DEPEND=">=media-tv/gentoo-vdr-scripts-0.4.2"
68    
69     DEPEND="${COMMON_DEPEND}
70 hd_brummy 1.81 virtual/linuxtv-dvb-headers"
71 zzam 1.65 RDEPEND="${COMMON_DEPEND}
72     >=app-admin/eselect-vdr-0.0.2"
73 zzam 1.2
74 zzam 1.69 # 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     # make DEPEND conditional
78     IUSE="${IUSE} vdr"
79     DEPEND="vdr? ( ${DEPEND} )"
80     RDEPEND="vdr? ( ${RDEPEND} )"
81     fi
82    
83 zzam 1.37 # 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 zzam 1.50 local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}"
89     insinto "${NEW_VDRPLUGINDB_DIR}"
90 zzam 1.52
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 zzam 1.60 echo "PLUGINS=\"$@\""
104 zzam 1.52 } > "${D}/${DB_FILE}"
105 zzam 1.37 }
106    
107     # Delete files created outside of vdr-plugin.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 zzam 1.51 # vdrplugin-rebuild-0.2 / gentoo-vdr-scripts-0.4.2
112 zzam 1.37 delete_orphan_plugindb_file() {
113 hd_brummy 1.40 #elog Testing for orphaned plugindb file
114 zzam 1.37 local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/
115 zzam 1.50 local DB_FILE="${ROOT}/${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}"
116 zzam 1.37
117     # file exists
118     [[ -f ${DB_FILE} ]] || return
119    
120     # will portage handle the file itself
121 zzam 1.50 if grep -q CREATOR=ECLASS "${DB_FILE}"; then
122 hd_brummy 1.40 #elog file owned by eclass - don't touch it
123 zzam 1.37 return
124     fi
125    
126 hd_brummy 1.40 elog "Removing orphaned plugindb-file."
127 zzam 1.41 elog "\t#rm ${DB_FILE}"
128 zzam 1.50 rm "${DB_FILE}"
129 zzam 1.37 }
130    
131 zzam 1.45
132     create_header_checksum_file()
133     {
134     # Danger: Not using $ROOT here, as compile will also not use it !!!
135     # If vdr in $ROOT and / differ, plugins will not run anyway
136    
137 zzam 1.60 local CHKSUM="header-md5-vdr"
138    
139 zzam 1.45 if [[ -f ${VDR_CHECKSUM_DIR}/header-md5-vdr ]]; then
140 zzam 1.60 cp "${VDR_CHECKSUM_DIR}/header-md5-vdr" "${CHKSUM}"
141     elif type -p md5sum >/dev/null 2>&1; then
142     (
143     cd "${VDR_INCLUDE_DIR}"
144     md5sum *.h libsi/*.h|LC_ALL=C sort --key=2
145     ) > "${CHKSUM}"
146 zzam 1.45 else
147 zzam 1.60 die "Could not create md5 checksum of headers"
148 zzam 1.45 fi
149 zzam 1.60
150     insinto "${VDR_CHECKSUM_DIR}"
151     local p_name
152     for p_name; do
153     newins "${CHKSUM}" "header-md5-${p_name}"
154     done
155 zzam 1.45 }
156    
157 zzam 1.55 fix_vdr_libsi_include()
158     {
159 zzam 1.70 #einfo "Fixing include of libsi-headers"
160 zzam 1.55 local f
161     for f; do
162     sed -i "${f}" \
163     -e '/#include/s:"\(.*libsi.*\)":<\1>:' \
164     -e '/#include/s:<.*\(libsi/.*\)>:<vdr/\1>:'
165     done
166     }
167    
168     vdr_patchmakefile() {
169     einfo "Patching Makefile"
170     [[ -e Makefile ]] || die "Makefile of plugin can not be found!"
171     cp Makefile "${WORKDIR}"/Makefile.before
172    
173 zzam 1.60 # plugin makefiles use VDRDIR in strange ways
174     # assumptions:
175     # 1. $(VDRDIR) contains Make.config
176     # 2. $(VDRDIR) contains config.h
177     # 3. $(VDRDIR)/include/vdr contains the headers
178     # 4. $(VDRDIR) contains main vdr Makefile
179     # 5. $(VDRDIR)/locale exists
180     # 6. $(VDRDIR) allows to access vdr source files
181     #
182     # We only have one directory (for now /usr/include/vdr),
183     # that contains vdr-headers and Make.config.
184     # To satisfy 1-3 we do this:
185     # Set VDRDIR=/usr/include/vdr
186     # Set VDRINCDIR=/usr/include
187     # Change $(VDRDIR)/include to $(VDRINCDIR)
188    
189 zzam 1.55 sed -i Makefile \
190     -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \
191 zzam 1.60 -e "/^VDRDIR/a VDRINCDIR = ${VDR_INCLUDE_DIR%/vdr}" \
192     -e '/VDRINCDIR.*=/!s:$(VDRDIR)/include:$(VDRINCDIR):' \
193     \
194 zzam 1.59 -e 's:-I$(DVBDIR)/include::' \
195     -e 's:-I$(DVBDIR)::'
196 zzam 1.55
197     # maybe needed for multiproto:
198     #sed -i Makefile \
199     # -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
200     # -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):'
201    
202     if ! grep -q APIVERSION Makefile; then
203     ebegin " Converting to APIVERSION"
204     sed -i Makefile \
205     -e 's:^APIVERSION = :APIVERSION ?= :' \
206     -e 's:$(LIBDIR)/$@.$(VDRVERSION):$(LIBDIR)/$@.$(APIVERSION):' \
207     -e '/VDRVERSION =/a\APIVERSION = $(shell sed -ne '"'"'/define APIVERSION/s/^.*"\\(.*\\)".*$$/\\1/p'"'"' $(VDRDIR)/config.h)'
208     eend $?
209     fi
210    
211     # Correcting Compile-Flags
212     # Do not overwrite CXXFLAGS, add LDFLAGS if missing
213     sed -i Makefile \
214     -e '/^CXXFLAGS[[:space:]]*=/s/=/?=/' \
215     -e '/LDFLAGS/!s:-shared:$(LDFLAGS) -shared:'
216    
217     # Disabling file stripping, useful for debugging
218     sed -i Makefile \
219     -e '/@.*strip/d' \
220     -e '/strip \$(LIBDIR)\/\$@/d' \
221 zzam 1.70 -e 's/STRIP.*=.*$/STRIP = true/'
222 zzam 1.55
223     # Use a file instead of a variable as single-stepping via ebuild
224     # destroys environment.
225     touch "${WORKDIR}"/.vdr-plugin_makefile_patched
226     }
227    
228 zzam 1.56 vdr_has_gettext() {
229     has_version ">=media-video/vdr-1.5.7"
230     }
231    
232     plugin_has_gettext() {
233     [[ -d po ]]
234     }
235    
236     vdr_i18n_convert_to_gettext() {
237 hd_brummy 1.77 if has_version ">=media-video/vdr-1.7.22"; then
238     local i18n_tool="${ROOT}/usr/share/vdr/bin/i18n-to-gettext"
239     else
240     local i18n_tool="${ROOT}/usr/share/vdr/bin/i18n-to-gettext.pl"
241     fi
242 zzam 1.56
243     if [[ ${NO_GETTEXT_HACK} == "1" ]]; then
244     ewarn "Conversion to gettext disabled in ebuild"
245     return 1
246     fi
247    
248     if [[ ! -x ${i18n_tool} ]]; then
249     eerror "Missing ${i18n_tool}"
250     eerror "Please re-emerge vdr"
251     die "Missing ${i18n_tool}"
252     fi
253    
254     ebegin "Auto converting translations to gettext"
255     # call i18n-to-gettext tool
256     # take all texts missing tr call into special file
257     "${i18n_tool}" 2>/dev/null \
258     |sed -e '/^"/!d' \
259     -e '/^""$/d' \
260     -e 's/\(.*\)/trNOOP(\1)/' \
261     > dummy-translations-trNOOP.c
262    
263     # if there were untranslated texts just run it again
264     # now the missing calls are listed in
265     # dummy-translations-trNOOP.c
266     if [[ -s dummy-translations-trNOOP.c ]]; then
267     "${i18n_tool}" &>/dev/null
268     fi
269    
270     # now use the modified Makefile
271     if [[ -f Makefile.new ]]; then
272     mv Makefile.new Makefile
273     eend 0 ""
274     else
275     eend 1 "Conversion to gettext failed. Plugin needs fixing."
276     return 1
277     fi
278     }
279 zzam 1.55
280 zzam 1.56 vdr_i18n_disable_gettext() {
281 zzam 1.70 #einfo "Disabling gettext support in plugin"
282    
283 zzam 1.56 # Remove i18n Target if using older vdr
284     sed -i Makefile \
285     -e '/^all:/s/ i18n//'
286     }
287 zzam 1.55
288 zzam 1.56 vdr_i18n() {
289     if vdr_has_gettext; then
290 zzam 1.70 #einfo "VDR has gettext support"
291 zzam 1.56 if plugin_has_gettext; then
292 zzam 1.70 #einfo "Plugin has gettext support, fine"
293 zzam 1.62 if [[ ${NO_GETTEXT_HACK} == "1" ]]; then
294 zzam 1.70 ewarn "Please remove unneeded NO_GETTEXT_HACK from ebuild."
295 zzam 1.62 fi
296 zzam 1.55 else
297 zzam 1.56 vdr_i18n_convert_to_gettext
298     if [[ $? != 0 ]]; then
299 hd_brummy 1.84 einfo "Plugin has no OSD texts or will have only english OSD texts"
300 zzam 1.56 fi
301     fi
302     else
303 zzam 1.70 #einfo "VDR has no gettext support"
304 zzam 1.56 if plugin_has_gettext; then
305     vdr_i18n_disable_gettext
306 zzam 1.55 fi
307     fi
308     }
309    
310     vdr-plugin_copy_source_tree() {
311     pushd . >/dev/null
312     cp -r "${S}" "${T}"/source-tree
313     cd "${T}"/source-tree
314     cp "${WORKDIR}"/Makefile.before Makefile
315 zzam 1.59 # TODO: Fix this, maybe no longer needed
316 zzam 1.55 sed -i Makefile \
317     -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
318     -e 's:^CXXFLAGS:#CXXFLAGS:' \
319     -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \
320     -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):'
321     popd >/dev/null
322     }
323    
324     vdr-plugin_install_source_tree() {
325     einfo "Installing sources"
326     destdir="${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN}"
327     insinto "${destdir}-${PV}"
328     doins -r "${T}"/source-tree/*
329    
330     dosym "${VDRPLUGIN}-${PV}" "${destdir}"
331     }
332    
333     vdr-plugin_print_enable_command() {
334 zzam 1.64 local p_name c=0 l=""
335     for p_name in ${vdr_plugin_list}; do
336     c=$(( c+1 ))
337     l="$l ${p_name#vdr-}"
338     done
339    
340 zzam 1.55 elog
341 zzam 1.64 case $c in
342     1) elog "Installed plugin${l}" ;;
343     *) elog "Installed $c plugins:${l}" ;;
344     esac
345     elog "To activate a plugin execute this command:"
346     elog "\teselect vdr-plugin enable <plugin_name> ..."
347 zzam 1.55 elog
348     }
349    
350 zzam 1.69 has_vdr() {
351     [[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
352     }
353 zzam 1.55
354     ## exported functions
355    
356 zzam 1.1 vdr-plugin_pkg_setup() {
357     # -fPIC is needed for shared objects on some platforms (amd64 and others)
358     append-flags -fPIC
359    
360 hd_brummy 1.72 # Plugins need to be compiled with position independent code, otherwise linking
361     # VDR against it will fail
362     if has_version ">=media-video/vdr-1.7.13"; then
363 hd_brummy 1.89 append-lfs-flags
364 hd_brummy 1.72 fi
365    
366 zzam 1.22 # Where should the plugins live in the filesystem
367     VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins"
368     VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
369    
370 zzam 1.35 # was /usr/lib/... some time ago
371     # since gentoo-vdr-scripts-0.3.6 it works with /usr/share/...
372     VDR_RC_DIR="/usr/share/vdr/rcscript"
373 zzam 1.22
374     # Pathes to includes
375 zzam 1.29 VDR_INCLUDE_DIR="/usr/include/vdr"
376 zzam 1.22 DVB_INCLUDE_DIR="/usr/include"
377    
378 zzam 1.48 TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
379 hd_brummy 1.87 LOCDIR="/usr/share/locale"
380 zzam 1.48
381 zzam 1.69 if ! has_vdr; then
382     # set to invalid values to detect abuses
383     VDRVERSION="eclass_no_vdr_installed"
384     APIVERSION="eclass_no_vdr_installed"
385    
386     if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
387     einfo "VDR not found!"
388     else
389     # if vdr is required
390     die "VDR not found!"
391     fi
392     return
393     fi
394 maekke 1.71
395 zzam 1.50 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
396     APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
397 zzam 1.18 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
398    
399 zzam 1.55 einfo "Compiling against"
400     einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]"
401 idl0r 1.80
402    
403     if [ -n "${VDR_LOCAL_PATCHES_DIR}" ]; then
404     eerror "Using VDR_LOCAL_PATCHES_DIR is deprecated!"
405     eerror "Please move all your patches into"
406     eerror "${EROOT}/etc/portage/patches/${CATEGORY}/${P}"
407     eerror "and remove or unset the VDR_LOCAL_PATCHES_DIR variable."
408     die
409     fi
410 zzam 1.1 }
411    
412 zzam 1.66 vdr-plugin_src_util() {
413 zzam 1.1 while [ "$1" ]; do
414     case "$1" in
415 zzam 1.66 all)
416     vdr-plugin_src_util unpack add_local_patch patchmakefile i18n
417     ;;
418 zzam 1.68 prepare|all_but_unpack)
419 zzam 1.66 vdr-plugin_src_util add_local_patch patchmakefile i18n
420 zzam 1.34 ;;
421 zzam 1.1 unpack)
422 zzam 1.12 base_src_unpack
423 zzam 1.1 ;;
424 zzam 1.55 add_local_patch)
425     cd "${S}" || die "Could not change to plugin-source-directory!"
426 idl0r 1.80 epatch_user
427 zzam 1.55 ;;
428 zzam 1.1 patchmakefile)
429 zzam 1.55 cd "${S}" || die "Could not change to plugin-source-directory!"
430     vdr_patchmakefile
431 zzam 1.1 ;;
432 zzam 1.55 i18n)
433 hd_brummy 1.87 # i18n-to-gettext tool removed starting with version 1.7.27
434     if has_version "<media-video/vdr-1.7.27"; then
435     cd "${S}" || die "Could not change to plugin-source-directory!"
436     vdr_i18n
437     fi
438 hd_brummy 1.27 ;;
439 zzam 1.1 esac
440    
441     shift
442     done
443     }
444    
445 zzam 1.66 vdr-plugin_src_unpack() {
446 hd_brummy 1.91 # mark vdr-plugin.eclass deprecated
447     eerror "\n\tvdr-plugin.eclass is deprecated"
448     eerror "\tMaintainer: please fix your ebuilds to use"
449     eerror "\tvdr-plugin-2.eclass \n"
450    
451 zzam 1.66 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
452     eerror "Wrong use of vdr-plugin.eclass."
453     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin_pkg_setup."
454     echo
455     eerror "Please report this at bugs.gentoo.org."
456     die "vdr-plugin_pkg_setup not called!"
457     fi
458     if [ -z "$1" ]; then
459     case "${EAPI:-0}" in
460 axs 1.90 2|3|4|5)
461 zzam 1.66 vdr-plugin_src_util unpack
462     ;;
463     *)
464     vdr-plugin_src_util all
465     ;;
466     esac
467    
468     else
469     vdr-plugin_src_util $@
470     fi
471     }
472    
473     vdr-plugin_src_prepare() {
474 zzam 1.67 base_src_prepare
475 zzam 1.68 vdr-plugin_src_util prepare
476 zzam 1.66 }
477    
478 zzam 1.1 vdr-plugin_src_compile() {
479 zzam 1.68 [ -z "$1" ] && vdr-plugin_src_compile copy_source compile
480 zzam 1.6
481 zzam 1.7 while [ "$1" ]; do
482    
483     case "$1" in
484 zzam 1.68 copy_source)
485 zzam 1.7 [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin_copy_source_tree
486     ;;
487     compile)
488 zzam 1.33 if [[ ! -f ${WORKDIR}/.vdr-plugin_makefile_patched ]]; then
489 zzam 1.32 eerror "Wrong use of vdr-plugin.eclass."
490     eerror "An ebuild for a vdr-plugin will not work without"
491     eerror "calling vdr-plugin_src_unpack to patch the Makefile."
492     echo
493     eerror "Please report this at bugs.gentoo.org."
494     die "vdr-plugin_src_unpack not called!"
495     fi
496 zzam 1.50 cd "${S}"
497 zzam 1.7
498 zzam 1.65 BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all}}
499    
500 zzam 1.48 emake ${BUILD_PARAMS} \
501 zzam 1.65 ${BUILD_TARGETS} \
502 zzam 1.48 LOCALEDIR="${TMP_LOCALE_DIR}" \
503 zzam 1.61 LIBDIR="${S}" \
504 zzam 1.60 TMPDIR="${T}" \
505 zzam 1.48 || die "emake failed"
506 zzam 1.7 ;;
507     esac
508 zzam 1.1
509 zzam 1.7 shift
510     done
511 zzam 1.1 }
512    
513     vdr-plugin_src_install() {
514 zzam 1.6 [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin_install_source_tree
515 zzam 1.46 cd "${WORKDIR}"
516 zzam 1.1
517 zzam 1.22 if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
518 zzam 1.50 local mname="${P}-Makefile"
519     cp "${S}"/Makefile "${mname}.patched"
520     cp Makefile.before "${mname}.before"
521 zzam 1.22
522 zzam 1.50 diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff"
523 zzam 1.22
524     insinto "/usr/share/vdr/maintainer-data/makefile-changes"
525 zzam 1.50 doins "${mname}.diff"
526 zzam 1.22
527     insinto "/usr/share/vdr/maintainer-data/makefile-before"
528 zzam 1.50 doins "${mname}.before"
529 zzam 1.22
530     insinto "/usr/share/vdr/maintainer-data/makefile-patched"
531 zzam 1.50 doins "${mname}.patched"
532 zzam 1.22
533     fi
534    
535 zzam 1.60
536 zzam 1.61
537     cd "${S}"
538     insinto "${VDR_PLUGIN_DIR}"
539     doins libvdr-*.so.*
540    
541     # create list of all created plugin libs
542 zzam 1.64 vdr_plugin_list=""
543     local p_name
544 zzam 1.60 for p in libvdr-*.so.*; do
545     p_name="${p%.so*}"
546     p_name="${p_name#lib}"
547 zzam 1.64 vdr_plugin_list="${vdr_plugin_list} ${p_name}"
548 zzam 1.60 done
549    
550 zzam 1.64 create_header_checksum_file ${vdr_plugin_list}
551     create_plugindb_file ${vdr_plugin_list}
552 zzam 1.48
553 zzam 1.56 if vdr_has_gettext && [[ -d ${TMP_LOCALE_DIR} ]]; then
554 zzam 1.48 einfo "Installing locales"
555     cd "${TMP_LOCALE_DIR}"
556     insinto "${LOCDIR}"
557     doins -r *
558     fi
559    
560     cd "${S}"
561 zzam 1.23 local docfile
562     for docfile in README* HISTORY CHANGELOG; do
563     [[ -f ${docfile} ]] && dodoc ${docfile}
564     done
565 zzam 1.2
566 zzam 1.17 # if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
567     [[ -z ${VDR_CONFD_FILE} ]] && [[ -e ${FILESDIR}/confd ]] && VDR_CONFD_FILE=${FILESDIR}/confd
568    
569     if [[ -n ${VDR_CONFD_FILE} ]]; then
570 zzam 1.44 newconfd "${VDR_CONFD_FILE}" vdr.${VDRPLUGIN}
571 zzam 1.17 fi
572    
573    
574     # if VDR_RCADDON_FILE is empty and ${FILESDIR}/rc-addon.sh exists take it
575     [[ -z ${VDR_RCADDON_FILE} ]] && [[ -e ${FILESDIR}/rc-addon.sh ]] && VDR_RCADDON_FILE=${FILESDIR}/rc-addon.sh
576    
577     if [[ -n ${VDR_RCADDON_FILE} ]]; then
578     insinto "${VDR_RC_DIR}"
579     newins "${VDR_RCADDON_FILE}" plugin-${VDRPLUGIN}.sh
580     fi
581 zzam 1.1 }
582    
583 zzam 1.50 vdr-plugin_pkg_postinst() {
584     vdr-plugin_print_enable_command
585    
586 zzam 1.17 if [[ -n "${VDR_CONFD_FILE}" ]]; then
587 zzam 1.50 elog "Please have a look at the config-file"
588     elog "\t/etc/conf.d/vdr.${VDRPLUGIN}"
589 hd_brummy 1.40 elog
590 zzam 1.13 fi
591 zzam 1.1 }
592    
593 zzam 1.2 vdr-plugin_pkg_postrm() {
594 zzam 1.37 delete_orphan_plugindb_file
595 zzam 1.2 }
596    
597 hd_brummy 1.83 vdr-plugin_pkg_config() {
598     :
599     }
600    
601 zzam 1.66 case "${EAPI:-0}" in
602 axs 1.90 2|3|4|5)
603 zzam 1.66 EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm pkg_config
604     ;;
605     *)
606     EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config
607     ;;
608     esac

  ViewVC Help
Powered by ViewVC 1.1.20