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

Contents of /eclass/vdr-plugin.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Jul 23 15:11:25 2005 UTC (9 years ago) by zzam
Branch: MAIN
initial version of eclass for vdr-plugins

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4 #
5 # Author:
6 # Matthias Schwarzott <zzam@gentoo.org>
7
8 # vdr-plugin.eclass
9 #
10 # eclass to create ebuilds for vdr plugins
11 #
12
13 # Example ebuild (vdr-femon):
14 #
15 # inherit vdr-plugin
16 # IUSE=""
17 # SLOT="0"
18 # DESCRIPTION="vdr Plugin: DVB Frontend Status Monitor (signal strengt/noise)"
19 # HOMEPAGE="http://www.saunalahti.fi/~rahrenbe/vdr/femon/"
20 # SRC_URI="http://www.saunalahti.fi/~rahrenbe/vdr/femon/files/${P}.tgz"
21 # LICENSE="GPL-2"
22 # KEYWORDS="~x86"
23 # DEPEND=">=media-video/vdr-1.3.27"
24 #
25 #
26
27
28 inherit eutils flag-o-matic
29
30 # Name of the plugin stripped from all vdrplugin-, vdr- and -cvs pre- and postfixes
31 VDRPLUGIN="${PN/#vdrplugin-/}"
32 VDRPLUGIN="${PN/#vdr-/}"
33 VDRPLUGIN="${VDRPLUGIN/%-cvs/}"
34
35 DESCRIPTION="vdr Plugin: ${VDRPLUGIN} (based on vdr-plugin.eclass)"
36
37 # works in most cases
38 S="${WORKDIR}/${VDRPLUGIN}-${PV}"
39
40 # depend on headers for DVB-driver
41 RDEPEND=""
42 DEPEND="|| (
43 >=sys-kernel/linux-headers-2.6.11-r2
44 media-tv/linuxtv-dvb
45 )"
46
47 # Where should the plugins live in the filesystem
48 VDR_PLUGIN_DIR="/usr/lib/vdr/plugins"
49
50 # Pathes to includes
51 VDR_INCLUDE_DIR="/usr/include"
52 DVB_INCLUDE_DIR="/usr/include"
53
54 vdr-plugin_pkg_setup() {
55 # -fPIC is needed for shared objects on some platforms (amd64 and others)
56 append-flags -fPIC
57
58 VDRVERSION=$(awk -F'"' '/VDRVERSION/ {print $2}' /usr/include/vdr/config.h)
59 einfo "Building ${PF} against vdr-${VDRVERSION}"
60 }
61
62 vdr-plugin_src_unpack() {
63 [ -z "$1" ] && vdr-plugin_src_unpack unpack patchmakefile
64
65 while [ "$1" ]; do
66
67 case "$1" in
68 unpack)
69 unpack ${A}
70 ;;
71 patchmakefile)
72 cd ${S}
73
74 ebegin "Patching Makefile"
75 sed -i Makefile \
76 -e "s:^VDRDIR.*$:VDRDIR = ${VDR_INCLUDE_DIR}:" \
77 -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \
78 -e "s:^LIBDIR.*$:LIBDIR = ${S}:" \
79 -e "s:^TMPDIR.*$:TMPDIR = ${T}:" \
80 -e 's:^CXXFLAGS:#CXXFLAGS:' \
81 -e 's:-I$(VDRDIR)/include:-I$(VDRDIR):' \
82 -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' \
83 -e 's:-I$(VDRDIR) -I$(DVBDIR):-I$(DVBDIR) -I$(VDRDIR):' \
84 -e 's:$(VDRDIR)/\(config.h\|Make.config\):$(VDRDIR)/vdr/\1:'
85 eend $?
86 ;;
87 esac
88
89 shift
90 done
91 }
92
93 vdr-plugin_src_compile() {
94 cd ${S}
95
96 emake ${VDRPLUGIN_MAKE_TARGET:-all} || die "emake failed"
97 }
98
99 vdr-plugin_src_install() {
100 cd ${S}
101
102 insinto "${VDR_PLUGIN_DIR}"
103 doins libvdr-*.so.*
104 dodoc README* HISTORY CHANGELOG
105 }
106
107 vdr-plugin_pkg_postinst() {
108 einfo
109 einfo "The vdr plugin ${VDRPLUGIN} has now been installed,"
110 einfo "to activate it you have to add it to /etc/conf.d/vdr."
111 einfo
112 }
113
114 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst

  ViewVC Help
Powered by ViewVC 1.1.20