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

Diff of /eclass/vdr-plugin.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.7 Revision 1.10
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.7 2005/10/28 08:58:19 zzam Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/vdr-plugin.eclass,v 1.10 2005/11/30 06:53:16 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
123 -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \ 123 -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \
124 -e 's:^CXXFLAGS:#CXXFLAGS:' \ 124 -e 's:^CXXFLAGS:#CXXFLAGS:' \
125 -e 's:-I$(VDRDIR)/include:-I$(VDRDIR):' \ 125 -e 's:-I$(VDRDIR)/include:-I$(VDRDIR):' \
126 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \ 126 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \
127 -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' \ 127 -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' \
128 -e 's:$(VDRDIR)/\(config.h\|Make.config\):$(VDRDIR)/vdr/\1:' 128 -e 's:$(VDRDIR)/\([a-z]*\.h\|Make.config\):$(VDRDIR)/vdr/\1:'
129 eend $? 129 eend $?
130 ;; 130 ;;
131 esac 131 esac
132 132
133 shift 133 shift
200} 200}
201 201
202vdr-plugin_pkg_postinst() { 202vdr-plugin_pkg_postinst() {
203 update_vdrplugindb 203 update_vdrplugindb
204 einfo 204 einfo
205 einfo "The vdr plugin ${VDRPLUGIN} has now been installed," 205 einfo "The vdr plugin ${VDRPLUGIN} has now been installed."
206 einfo "to activate it you have to add it to /etc/conf.d/vdr." 206 einfo "To activate execute the following command:"
207 einfo
208 einfo " emerge --config ${PN}"
207 einfo 209 einfo
208} 210}
209 211
210vdr-plugin_pkg_postrm() { 212vdr-plugin_pkg_postrm() {
211 remove_vdrplugindb 213 remove_vdrplugindb
212} 214}
213 215
216vdr-plugin_pkg_config_final() {
217 diff ${conf_orig} ${conf}
218 rm ${conf_orig}
219}
220
221vdr-plugin_pkg_config() {
222 if [[ -z "${INSTALLPLUGIN}" ]]; then
223 INSTALLPLUGIN="${VDRPLUGIN}"
224 fi
225 # First test if plugin is already inside PLUGINS
226 local conf=/etc/conf.d/vdr
227 conf_orig=${conf}.before_emerge_config
228 cp ${conf} ${conf_orig}
229
230 einfo "Reading ${conf}"
231 if ! grep -q "^PLUGINS=" ${conf}; then
232 local LINE=$(sed ${conf} -n -e '/^#.*PLUGINS=/=' | tail -n 1)
233 if [[ -n "${LINE}" ]]; then
234 sed -e ${LINE}'a PLUGINS=""' -i ${conf}
235 else
236 echo 'PLUGINS=""' >> ${conf}
237 fi
238 unset LINE
239 fi
240
241 unset PLUGINS
242 PLUGINS=$(source /etc/conf.d/vdr; echo ${PLUGINS})
243
244 active=0
245 for p in ${PLUGINS}; do
246 if [[ "${p}" == "${INSTALLPLUGIN}" ]]; then
247 active=1
248 break;
249 fi
250 done
251
252 if [[ "${active}" == "1" ]]; then
253 einfo "${INSTALLPLUGIN} already activated"
254 echo
255 read -p "Do you want to deactivate ${INSTALLPLUGIN} (yes/no) " answer
256 if [[ "${answer}" != "yes" ]]; then
257 einfo "aborted"
258 return
259 fi
260 einfo "Removing ${INSTALLPLUGIN} from active plugins."
261 local LINE=$(sed ${conf} -n -e '/^PLUGINS=.*\<'${INSTALLPLUGIN}'\>/=' | tail -n 1)
262 sed -i ${conf} -e ${LINE}'s/\<'${INSTALLPLUGIN}'\>//' \
263 -e ${LINE}'s/ \( \)*/ /g' \
264 -e ${LINE}'s/ "/"/g' \
265 -e ${LINE}'s/" /"/g'
266
267 vdr-plugin_pkg_config_final
268 return
269 fi
270
271
272 einfo "Adding ${INSTALLPLUGIN} to active plugins."
273 local LINE=$(sed ${conf} -n -e '/^PLUGINS=/=' | tail -n 1)
274 sed -i ${conf} -e ${LINE}'s/^PLUGINS=" *\(.*\)"/PLUGINS="\1 '${INSTALLPLUGIN}'"/' \
275 -e ${LINE}'s/ \( \)*/ /g' \
276 -e ${LINE}'s/ "/"/g' \
277 -e ${LINE}'s/" /"/g'
278
279 vdr-plugin_pkg_config_final
280}
281
214EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm 282EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_config

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20