enigma2-plugins.bb: use git to checkout
[openembedded.git] / recipes / enigma2 / enigma2-plugins.bb
1 DESCRIPTION = "Additional plugins for Enigma2"
2 MAINTAINER = "Felix Domke <tmbinc@elitedvb.net>"
3
4 PACKAGES_DYNAMIC = "enigma2-plugin-*"
5
6 # if you want experimental, use:
7 SRCREV=""
8 SRCDATE="20101211"
9 BRANCH="master"
10 PV = "experimental-git${SRCDATE}"
11
12 PR = "r0"
13 SRC_URI="git://schwerkraft.elitedvb.net/enigma2-plugins/enigma2-plugins.git;protocol=git;branch=${BRANCH};tag=${SRCREV}"
14
15 FILES_${PN} += " /usr/share/enigma2 /usr/share/fonts "
16 FILES_${PN}-meta = "${datadir}/meta"
17 PACKAGES += "${PN}-meta"
18 PACKAGE_ARCH = "${MACHINE_ARCH}"
19
20 inherit autotools
21
22 S = "${WORKDIR}/git"
23
24 DEPENDS = "python-pyopenssl python-gdata streamripper python-mutagen python-daap"
25 DEPENDS += "enigma2"
26
27 python populate_packages_prepend () {
28         enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
29
30         do_split_packages(d, enigma2_plugindir, '(.*?/.*?)/.*', 'enigma2-plugin-%s', 'Enigma2 Plugin: %s', recursive=True, match_path=True, prepend=True)
31
32         def getControlLines(mydir, d, package):
33                 import os
34                 try:
35                         #ac3lipsync is renamed since 20091121 to audiosync.. but rename in cvs is not possible without lost of revision history..
36                         #so the foldername is still ac3lipsync
37                         if package == 'audiosync':
38                                 package = 'ac3lipsync'
39                         src = open(mydir + package + "/CONTROL/control").read()
40                 except IOError:
41                         return
42                 for line in src.split("\n"):
43                         if line.startswith('Package: '):
44                                 full_package = line[9:]
45                         if line.startswith('Depends: '):
46                                 bb.data.setVar('RDEPENDS_' + full_package, ' '.join(line[9:].split(', ')), d)
47                         if line.startswith('Description: '):
48                                 bb.data.setVar('DESCRIPTION_' + full_package, line[13:], d)
49                         if line.startswith('Replaces: '):
50                                 bb.data.setVar('RREPLACES_' + full_package, ' '.join(line[10:].split(', ')), d)
51                         if line.startswith('Conflicts: '):
52                                 bb.data.setVar('RCONFLICTS_' + full_package, ' '.join(line[11:].split(', ')), d)
53                         if line.startswith('Maintainer: '):
54                                 bb.data.setVar('MAINTAINER_' + full_package, line[12:], d)
55
56         mydir = bb.data.getVar('D', d, 1) + "/../enigma2-plugins/"
57         for package in bb.data.getVar('PACKAGES', d, 1).split():
58                 getControlLines(mydir, d, package.split('-')[-1])
59 }