1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 Gentoo Foundation |
2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/Attic/vdr-plugin.eclass,v 1.4 2005/08/22 16:20:30 swegener Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/Attic/vdr-plugin.eclass,v 1.7 2005/10/28 08:58:19 zzam Exp $ |
4 | # |
4 | # |
5 | # Author: |
5 | # Author: |
6 | # Matthias Schwarzott <zzam@gentoo.org> |
6 | # Matthias Schwarzott <zzam@gentoo.org> |
7 | |
7 | |
8 | # vdr-plugin.eclass |
8 | # vdr-plugin.eclass |
… | |
… | |
34 | # Everything put in variable _EXTRAOPTS is appended to the command line of |
34 | # Everything put in variable _EXTRAOPTS is appended to the command line of |
35 | # the plugin. |
35 | # the plugin. |
36 | |
36 | |
37 | |
37 | |
38 | # ${FILESDIR}/rc-addon-${PV}.sh or ${FILESDIR}/rc-addon.sh: |
38 | # ${FILESDIR}/rc-addon-${PV}.sh or ${FILESDIR}/rc-addon.sh: |
39 | # The first matching is installed under /usr/lib/vdr/rcscript/vdr.${VDRPLUGIN}.sh |
39 | # The first matching is installed under /usr/lib/vdr/rcscript/plugin-${VDRPLUGIN}.sh |
40 | # (in example vdr-femon this would be /usr/lib/vdr/rcscript/vdr.femon.sh) |
40 | # (in example vdr-femon this would be /usr/lib/vdr/rcscript/plugin-femon.sh) |
41 | # |
41 | # |
42 | # This file is sourced by the startscript when plugin is activated in /etc/conf.d/vdr |
42 | # This file is sourced by the startscript when plugin is activated in /etc/conf.d/vdr |
43 | # It could be used for special startup actions for this plugins, or to create the |
43 | # It could be used for special startup actions for this plugins, or to create the |
44 | # plugin command line options from a nicer version of a conf.d file. |
44 | # plugin command line options from a nicer version of a conf.d file. |
45 | |
45 | |
… | |
… | |
114 | ;; |
114 | ;; |
115 | patchmakefile) |
115 | patchmakefile) |
116 | cd ${S} |
116 | cd ${S} |
117 | |
117 | |
118 | ebegin "Patching Makefile" |
118 | ebegin "Patching Makefile" |
119 | sed -i Makefile \ |
119 | sed -i.orig Makefile \ |
120 | -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \ |
120 | -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \ |
121 | -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
121 | -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
122 | -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \ |
122 | -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \ |
123 | -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \ |
123 | -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \ |
124 | -e 's:^CXXFLAGS:#CXXFLAGS:' \ |
124 | -e 's:^CXXFLAGS:#CXXFLAGS:' \ |
… | |
… | |
132 | |
132 | |
133 | shift |
133 | shift |
134 | done |
134 | done |
135 | } |
135 | } |
136 | |
136 | |
|
|
137 | vdr-plugin_copy_source_tree() { |
|
|
138 | cp -r ${S} ${T}/source-tree |
|
|
139 | cd ${T}/source-tree |
|
|
140 | mv Makefile.orig Makefile |
|
|
141 | sed -i Makefile \ |
|
|
142 | -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
|
|
143 | -e 's:^CXXFLAGS:#CXXFLAGS:' \ |
|
|
144 | -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ |
|
|
145 | -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' |
|
|
146 | } |
|
|
147 | |
|
|
148 | vdr-plugin_install_source_tree() { |
|
|
149 | einfo "Installing sources" |
|
|
150 | destdir=${VDRSOURCE_DIR}/vdr-${VDRVERSION}/PLUGINS/src/${VDRPLUGIN} |
|
|
151 | insinto ${destdir}-${PV} |
|
|
152 | doins -r ${T}/source-tree/* |
|
|
153 | |
|
|
154 | dosym ${VDRPLUGIN}-${PV} ${destdir} |
|
|
155 | } |
|
|
156 | |
137 | vdr-plugin_src_compile() { |
157 | vdr-plugin_src_compile() { |
|
|
158 | [ -z "$1" ] && vdr-plugin_src_compile prepare compile |
|
|
159 | |
|
|
160 | while [ "$1" ]; do |
|
|
161 | |
|
|
162 | case "$1" in |
|
|
163 | prepare) |
|
|
164 | [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin_copy_source_tree |
|
|
165 | ;; |
|
|
166 | compile) |
138 | cd ${S} |
167 | cd ${S} |
139 | |
168 | |
140 | emake ${VDRPLUGIN_MAKE_TARGET:-all} || die "emake failed" |
169 | emake ${VDRPLUGIN_MAKE_TARGET:-all} || die "emake failed" |
|
|
170 | ;; |
|
|
171 | esac |
|
|
172 | |
|
|
173 | shift |
|
|
174 | done |
141 | } |
175 | } |
142 | |
176 | |
143 | vdr-plugin_src_install() { |
177 | vdr-plugin_src_install() { |
|
|
178 | [[ -n "${VDRSOURCE_DIR}" ]] && vdr-plugin_install_source_tree |
144 | cd ${S} |
179 | cd ${S} |
145 | |
180 | |
146 | insinto "${VDR_PLUGIN_DIR}" |
181 | insinto "${VDR_PLUGIN_DIR}" |
147 | doins libvdr-*.so.* |
182 | doins libvdr-*.so.* |
148 | dodoc README* HISTORY CHANGELOG |
183 | dodoc README* HISTORY CHANGELOG |
… | |
… | |
156 | done |
191 | done |
157 | |
192 | |
158 | for f in ${FILESDIR}/rc-addon-${PV}.sh ${FILESDIR}/rc-addon.sh; do |
193 | for f in ${FILESDIR}/rc-addon-${PV}.sh ${FILESDIR}/rc-addon.sh; do |
159 | if [[ -f "${f}" ]]; then |
194 | if [[ -f "${f}" ]]; then |
160 | insinto "${VDR_RC_DIR}" |
195 | insinto "${VDR_RC_DIR}" |
161 | newins "${f}" vdr.${VDRPLUGIN}.sh |
196 | newins "${f}" plugin-${VDRPLUGIN}.sh |
162 | break |
197 | break |
163 | fi |
198 | fi |
164 | done |
199 | done |
165 | } |
200 | } |
166 | |
201 | |