/[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.27 - (hide annotations) (download)
Sat Jan 25 15:23:54 2014 UTC (11 months ago) by hd_brummy
Branch: MAIN
Changes since 1.26: +18 -5 lines
major changes depend on wrt bug 497056, vdr-plugin-2.eclass

1 hd_brummy 1.26 # Copyright 1999-2014 Gentoo Foundation
2 hd_brummy 1.1 # Distributed under the terms of the GNU General Public License v2
3 hd_brummy 1.27 # $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin-2.eclass,v 1.26 2014/01/24 13:51:18 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.27 inherit eutils flag-o-matic multilib toolchain-funcs unpacker # base
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.27 VDR_MAINTAINER_MODE="1" # cleanup later
206 hd_brummy 1.1 if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
207 hd_brummy 1.25 eerror "\t Gentoo Developer Debug: $@"
208 hd_brummy 1.1 fi
209     }
210    
211     gettext_missing() {
212     # plugins without converting to gettext
213    
214     local GETTEXT_MISSING=$( grep xgettext Makefile )
215 hd_brummy 1.2 if [[ -z ${GETTEXT_MISSING} ]]; then
216 hd_brummy 1.1 dev_check "Plugin isn't converted to gettext handling \n"
217     fi
218     }
219    
220 hd_brummy 1.14 detect_po_dir() {
221 hd_brummy 1.22 # Some plugins have /po in a subdir
222 hd_brummy 1.14 # set PO_SUBDIR in .ebuild
223     # i.e media-plugins/vdr-streamdev
224     # PO_SUBDIR="client server"
225    
226     [[ -f po ]] && local po_dir="${S}"
227     local po_subdir=( ${S}/${PO_SUBDIR} )
228     local f
229    
230     pofile_dir=( ${po_dir} ${po_subdir[*]} )
231     }
232    
233 hd_brummy 1.1 linguas_support() {
234     # Patching Makefile for linguas support.
235     # Only locales, enabled through the LINGUAS (make.conf) variable will be
236     # "compiled" and installed.
237    
238     einfo "Patching for Linguas support"
239     einfo "available Languages for ${P} are:"
240    
241 hd_brummy 1.14 detect_po_dir
242 hd_brummy 1.1
243 hd_brummy 1.14 for f in ${pofile_dir[*]}; do
244 hd_brummy 1.10 PLUGIN_LINGUAS=$( ls ${f}/po --ignore="*.pot" | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
245 hd_brummy 1.1 einfo "LINGUAS=\"${PLUGIN_LINGUAS}\""
246    
247     sed -i ${f}/Makefile \
248     -e 's:\$(wildcard[[:space:]]*\$(PODIR)/\*.po):\$(foreach dir,\$(LINGUAS),\$(wildcard \$(PODIR)\/\$(dir)\*.po)):' \
249     || die "sed failed for Linguas"
250     done
251    
252 hd_brummy 1.7 strip-linguas ${PLUGIN_LINGUAS} en
253 hd_brummy 1.1 }
254    
255     vdr_i18n() {
256     # i18n handling was deprecated since >=media-video/vdr-1.5.9,
257     # finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some
258     # plugins will fail to "compile" because they're still using the old variant.
259     # Simply remove the i18n.o object from Makefile (OBJECT) and
260     # remove "static const tI18nPhrase*" from i18n.h.
261     #
262     # Plugins that are still using the old method will be pmasked until they're
263     # fixed or in case of maintainer timeout they'll be masked for removal.
264    
265     gettext_missing
266    
267     local I18N_OBJECT=$( grep i18n.o Makefile )
268     if [[ -n ${I18N_OBJECT} ]]; then
269 hd_brummy 1.6
270     if [[ "${KEEP_I18NOBJECT:-no}" = "yes" ]]; then
271     dev_check "Forced to keep i18n.o"
272     else
273     sed -i "s:i18n.o::g" Makefile
274     dev_check "OBJECT i18n.o found"
275     dev_check "removed per sed \n"
276     fi
277    
278 hd_brummy 1.1 else
279     dev_check "OBJECT i18n.o not found in Makefile"
280     dev_check "all fine or manual review needed? \n"
281     fi
282    
283     local I18N_STRING=$( [[ -e i18n.h ]] && grep tI18nPhrase i18n.h )
284     if [[ -n ${I18N_STRING} ]]; then
285     sed -i "s:^extern[[:space:]]*const[[:space:]]*tI18nPhrase://static const tI18nPhrase:" i18n.h
286     dev_check "obsolete tI18nPhrase found"
287     dev_check "disabled per sed, please recheck \n"
288     else
289     dev_check "obsolete tI18nPhrase not found, fine..."
290     dev_check "please review, may be in subdir... \n"
291     fi
292     }
293 hd_brummy 1.13
294     remove_i18n_include() {
295     # remove uneeded i18.n includes
296     # call 'remove_i18n_include bla foo'
297    
298     local f
299     for f; do
300     sed -i "${f}" \
301     -e "s:^#include[[:space:]]*\"i18n.h\"://:"
302     done
303    
304 hd_brummy 1.24 dev_check "removed i18n.h include in ${@}"
305 hd_brummy 1.13 }
306 hd_brummy 1.1 # end new vdr-plugin-2.eclass content
307    
308     vdr-plugin-2_print_enable_command() {
309     local p_name c=0 l=""
310     for p_name in ${vdr_plugin_list}; do
311     c=$(( c+1 ))
312     l="$l ${p_name#vdr-}"
313     done
314    
315     elog
316     case $c in
317     1) elog "Installed plugin${l}" ;;
318     *) elog "Installed $c plugins:${l}" ;;
319     esac
320     elog "To activate a plugin execute this command:"
321     elog "\teselect vdr-plugin enable <plugin_name> ..."
322     elog
323     }
324    
325     has_vdr() {
326     [[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
327     }
328    
329     ## exported functions
330    
331     vdr-plugin-2_pkg_setup() {
332 hd_brummy 1.15 # missing ${chost}- tag
333     tc-export CC CXX
334    
335 hd_brummy 1.1 # -fPIC is needed for shared objects on some platforms (amd64 and others)
336     append-flags -fPIC
337    
338     # Plugins need to be compiled with position independent code, otherwise linking
339     # VDR against it will fail
340     if has_version ">=media-video/vdr-1.7.13"; then
341 hd_brummy 1.16 append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
342 hd_brummy 1.1 fi
343    
344     # Where should the plugins live in the filesystem
345 hd_brummy 1.14 if has_version ">=media-video/vdr-1.7.34"; then
346     VDR_PLUGIN_DIR=$(pkg-config --variable=libdir vdr)
347     else
348     VDR_PLUGIN_DIR="/usr/$(get_libdir)/vdr/plugins"
349     fi
350    
351 hd_brummy 1.1 VDR_CHECKSUM_DIR="${VDR_PLUGIN_DIR%/plugins}/checksums"
352    
353     # was /usr/lib/... some time ago
354     # since gentoo-vdr-scripts-0.3.6 it works with /usr/share/...
355     VDR_RC_DIR="/usr/share/vdr/rcscript"
356    
357     # Pathes to includes
358     VDR_INCLUDE_DIR="/usr/include/vdr"
359     DVB_INCLUDE_DIR="/usr/include"
360    
361     TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
362 hd_brummy 1.14
363     if has_version ">=media-video/vdr-1.7.34"; then
364     LOCDIR=$(pkg-config --variable=locdir vdr)
365     else
366     LOCDIR="/usr/share/locale"
367     fi
368 hd_brummy 1.1
369     if ! has_vdr; then
370     # set to invalid values to detect abuses
371     VDRVERSION="eclass_no_vdr_installed"
372     APIVERSION="eclass_no_vdr_installed"
373    
374     if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
375     einfo "VDR not found!"
376     else
377     # if vdr is required
378     die "VDR not found!"
379     fi
380     return
381     fi
382    
383 hd_brummy 1.14 if has_version ">=media-video/vdr-1.7.34"; then
384 hd_brummy 1.23 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
385 hd_brummy 1.14 APIVERSION=$(pkg-config --variable=apiversion vdr)
386     else
387     VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
388     APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
389 hd_brummy 1.1 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"
390 hd_brummy 1.14 fi
391 hd_brummy 1.1
392     einfo "Compiling against"
393 hd_brummy 1.17 einfo "\tvdr-${VDRVERSION} [API version ${APIVERSION}]"
394 hd_brummy 1.1
395     if [[ -n "${VDR_LOCAL_PATCHES_DIR}" ]]; then
396     eerror "Using VDR_LOCAL_PATCHES_DIR is deprecated!"
397     eerror "Please move all your patches into"
398     eerror "${EROOT}/etc/portage/patches/${CATEGORY}/${P}"
399     eerror "and remove or unset the VDR_LOCAL_PATCHES_DIR variable."
400     die
401     fi
402     }
403    
404     vdr-plugin-2_src_util() {
405     while [ "$1" ]; do
406     case "$1" in
407     all)
408     vdr-plugin-2_src_util unpack add_local_patch patchmakefile linguas_patch i18n
409     ;;
410     prepare)
411     vdr-plugin-2_src_util add_local_patch patchmakefile linguas_patch i18n
412     ;;
413     unpack)
414 hd_brummy 1.27 # base_src_unpack # cleanup later
415     dev_check "function src_unpack, changed from base.eclass to unpacker.eclass"
416     unpacker_src_unpack
417 hd_brummy 1.1 ;;
418     add_local_patch)
419     cd "${S}" || die "Could not change to plugin-source-directory!"
420     epatch_user
421     ;;
422     patchmakefile)
423     cd "${S}" || die "Could not change to plugin-source-directory!"
424     vdr_patchmakefile
425     ;;
426     i18n)
427     vdr_i18n
428     ;;
429     linguas_patch)
430     linguas_support
431     ;;
432     esac
433    
434     shift
435     done
436     }
437    
438     vdr-plugin-2_src_unpack() {
439     if [[ -z ${VDR_INCLUDE_DIR} ]]; then
440     eerror "Wrong use of vdr-plugin-2.eclass."
441 hd_brummy 1.3 eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_unpack."
442 hd_brummy 1.1 echo
443     eerror "Please report this at bugs.gentoo.org."
444 hd_brummy 1.3 die "vdr-plugin-2_src_unpack not called!"
445 hd_brummy 1.1 fi
446    
447 hd_brummy 1.27 # cleanup later...
448     dev_check "https://bugs.gentoo.org/show_bug.cgi?id=497056"
449     dev_check "Major changes in vdr-plugin-2.eclass"
450     dev_check "Please report problems in scr_unpack, src_prepare"
451     dev_check "to this bug or direct to vdr(at)gentoo.org"
452    
453 hd_brummy 1.1 if [ -z "$1" ]; then
454     vdr-plugin-2_src_util unpack
455     else
456     vdr-plugin-2_src_util $@
457     fi
458     }
459    
460     vdr-plugin-2_src_prepare() {
461 hd_brummy 1.3 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
462     eerror "Wrong use of vdr-plugin-2.eclass."
463     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_prepare."
464     echo
465     eerror "Please report this at bugs.gentoo.org."
466     die "vdr-plugin-2_src_prepare not called!"
467     fi
468    
469 hd_brummy 1.27 # base_src_prepare # cleanup later
470     dev_check "function src_prepare, changed from base.eclass to eutils.eclass"
471     [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
472     debug-print "$FUNCNAME: applying user patches"
473    
474 hd_brummy 1.1 vdr-plugin-2_src_util prepare
475     }
476    
477     vdr-plugin-2_src_compile() {
478 hd_brummy 1.22 [ -z "$1" ] && vdr-plugin-2_src_compile compile
479 hd_brummy 1.1
480     while [ "$1" ]; do
481     case "$1" in
482     compile)
483     if [[ ! -f ${WORKDIR}/.vdr-plugin_makefile_patched ]]; then
484     eerror "Wrong use of vdr-plugin-2.eclass."
485     eerror "An ebuild for a vdr-plugin will not work without"
486 hd_brummy 1.3 eerror "calling vdr-plugin-2_src_compile to patch the Makefile."
487 hd_brummy 1.1 echo
488     eerror "Please report this at bugs.gentoo.org."
489 hd_brummy 1.3 die "vdr-plugin-2_src_compile not called!"
490 hd_brummy 1.1 fi
491     cd "${S}"
492    
493 hd_brummy 1.14 BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all }}
494     emake ${BUILD_PARAMS} \
495     ${BUILD_TARGETS} \
496     LOCALEDIR="${TMP_LOCALE_DIR}" \
497 hd_brummy 1.18 LOCDIR="${TMP_LOCALE_DIR}" \
498 hd_brummy 1.14 LIBDIR="${S}" \
499     TMPDIR="${T}" \
500     || die "emake failed"
501 hd_brummy 1.1 ;;
502     esac
503    
504     shift
505     done
506     }
507    
508     vdr-plugin-2_src_install() {
509 hd_brummy 1.3 if [[ -z ${VDR_INCLUDE_DIR} ]]; then
510     eerror "Wrong use of vdr-plugin-2.eclass."
511     eerror "An ebuild for a vdr-plugin will not work without calling vdr-plugin-2_src_install."
512     echo
513     eerror "Please report this at bugs.gentoo.org."
514     die "vdr-plugin-2_src_install not called!"
515     fi
516    
517 hd_brummy 1.1 cd "${WORKDIR}"
518    
519     if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
520     local mname="${P}-Makefile"
521     cp "${S}"/Makefile "${mname}.patched"
522     cp Makefile.before "${mname}.before"
523    
524     diff -u "${mname}.before" "${mname}.patched" > "${mname}.diff"
525    
526     insinto "/usr/share/vdr/maintainer-data/makefile-changes"
527     doins "${mname}.diff"
528    
529     insinto "/usr/share/vdr/maintainer-data/makefile-before"
530     doins "${mname}.before"
531    
532     insinto "/usr/share/vdr/maintainer-data/makefile-patched"
533     doins "${mname}.patched"
534    
535     fi
536    
537     cd "${S}"
538 hd_brummy 1.14
539 hd_brummy 1.18 local SOFILE_STRING=$(grep SOFILE Makefile)
540     if [[ -n ${SOFILE_STRING} ]]; then
541     BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install }}
542     einstall ${BUILD_PARAMS} \
543     ${BUILD_TARGETS} \
544     TMPDIR="${T}" \
545     DESTDIR="${D}" \
546     || die "einstall (makefile target) failed"
547 hd_brummy 1.22 else
548 hd_brummy 1.27 dev_check "Plugin use still the old Makefile handling"
549 hd_brummy 1.22 insinto "${VDR_PLUGIN_DIR}"
550     doins libvdr-*.so.*
551     fi
552 hd_brummy 1.18
553     if [[ -d ${TMP_LOCALE_DIR} ]]; then
554     einfo "Installing locales"
555     cd "${TMP_LOCALE_DIR}"
556    
557     local linguas
558     for linguas in ${LINGUAS[*]}; do
559     insinto "${LOCDIR}"
560     cp -r --parents ${linguas}* ${D}/${LOCDIR}
561     done
562     fi
563    
564 hd_brummy 1.22 cd "${D}/usr/$(get_libdir)/vdr/plugins"
565 hd_brummy 1.19
566 hd_brummy 1.1 # create list of all created plugin libs
567     vdr_plugin_list=""
568     local p_name
569     for p in libvdr-*.so.*; do
570     p_name="${p%.so*}"
571     p_name="${p_name#lib}"
572     vdr_plugin_list="${vdr_plugin_list} ${p_name}"
573     done
574    
575 hd_brummy 1.22 cd "${S}"
576    
577 hd_brummy 1.1 create_header_checksum_file ${vdr_plugin_list}
578     create_plugindb_file ${vdr_plugin_list}
579    
580     local docfile
581     for docfile in README* HISTORY CHANGELOG; do
582     [[ -f ${docfile} ]] && dodoc ${docfile}
583     done
584    
585     # if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it
586     [[ -z ${VDR_CONFD_FILE} ]] && [[ -e ${FILESDIR}/confd ]] && VDR_CONFD_FILE=${FILESDIR}/confd
587    
588     if [[ -n ${VDR_CONFD_FILE} ]]; then
589     newconfd "${VDR_CONFD_FILE}" vdr.${VDRPLUGIN}
590     fi
591    
592     # if VDR_RCADDON_FILE is empty and ${FILESDIR}/rc-addon.sh exists take it
593     [[ -z ${VDR_RCADDON_FILE} ]] && [[ -e ${FILESDIR}/rc-addon.sh ]] && VDR_RCADDON_FILE=${FILESDIR}/rc-addon.sh
594    
595     if [[ -n ${VDR_RCADDON_FILE} ]]; then
596     insinto "${VDR_RC_DIR}"
597     newins "${VDR_RCADDON_FILE}" plugin-${VDRPLUGIN}.sh
598     fi
599     }
600    
601     vdr-plugin-2_pkg_postinst() {
602     vdr-plugin-2_print_enable_command
603    
604     if [[ -n "${VDR_CONFD_FILE}" ]]; then
605     elog "Please have a look at the config-file"
606     elog "\t/etc/conf.d/vdr.${VDRPLUGIN}"
607     elog
608     fi
609     }
610    
611     vdr-plugin-2_pkg_postrm() {
612 hd_brummy 1.22 :
613 hd_brummy 1.1 }
614    
615     vdr-plugin-2_pkg_config() {
616     :
617     }

  ViewVC Help
Powered by ViewVC 1.1.20