26a819528c66e45d510276e4a44f72f2f80c76b8
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-enigma2 / enigma2 / enigma2-plugins.bb
1 DESCRIPTION = "Additional plugins for Enigma2"
2 MAINTAINER = "Felix Domke <tmbinc@elitedvb.net>"
3 LICENSE = "Proprietary"
4 LIC_FILES_CHKSUM = "file://COPYING;md5=8e37f34d0e40d32ea2bc90ee812c9131"
5
6 PACKAGES_DYNAMIC = "enigma2-plugin-*"
7
8 # if you want experimental, use:
9 #SRCREV="87fd2f1120962f553ecb1a88bbee46ed821df975"
10 SRCREV="c8fc96e8e51e1ef71e1709f9dd6f733007f9463e"
11 SRCDATE="20110215"
12 BRANCH="master"
13 PV = "experimental-git${SRCDATE}"
14 PR = "r5"
15
16 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}/vuplus:"
17
18 SRC_URI="git://code.vuplus.com/git/dvbapp-plugin.git;protocol=git;branch=${BRANCH};tag=${SRCREV}"
19
20 EXTRA_OECONF = " \
21         BUILD_SYS=${BUILD_SYS} \
22         HOST_SYS=${HOST_SYS} \
23         STAGING_INCDIR=${STAGING_INCDIR} \
24         STAGING_LIBDIR=${STAGING_LIBDIR} \
25 "
26
27 SRC_URI_append_vuplus = " \
28            file://enigma2_plugins_mytube_tpm.patch;patch=1;pnum=1 \
29            file://enigma2_plugins_20110810.patch;patch=1;pnum=1 \
30            file://enigma2_plugins_webinterface_tpm.patch;patch=1;pnum=1 \
31            file://enigma2_plugins_ac3lipsync_dolby.patch;patch=1;pnum=1 \
32            file://enigma2_plugins_autoresolution_fix.patch;patch=1;pnum=1 \
33            file://enigma2_plugins_dependency.patch;patch=1;pnum=1 \
34            file://dreamboxweb.png \
35            file://dreamboxwebtv.png \
36            file://favicon.ico"
37
38 FILES_${PN} += " /usr/share/enigma2 /usr/share/fonts "
39 FILES_${PN}-meta = "${datadir}/meta"
40 PACKAGES += "${PN}-meta"
41 PACKAGE_ARCH = "${MACHINE_ARCH}"
42
43 inherit autotools
44
45 S = "${WORKDIR}/git"
46
47 DEPENDS = "python-pyopenssl python-gdata streamripper python-mutagen python-daap"
48 DEPENDS += "enigma2"
49 #DEPENDS += "enigma2-plugin-extensions-openwebif"
50
51
52 def modify_po():
53         import os
54         try:
55                 os.system("find ./ -name \"*.po\" > ./po_list")
56                 os.system("find ./ -name \"*.pot\" >> ./po_list")
57                 po_list = []
58                 po_list = open('po_list','r+').readlines()
59                 for x in po_list:
60                         changeword1(x)
61                 changeword1('enigma2-plugins/networkwizard/src/networkwizard.xml ')
62                 changeword2('enigma2-plugins/webinterface/src/web-data/tpl/default/index.html ')
63                 os.system('rm po_list')
64         except:
65                 print 'word patch error '
66                 return
67
68 def changeword1(file):
69         fn = file[:-1]
70         fnn = file[:-1]+'_n'
71         cmd = "sed s/Dreambox/STB/g "+fn+" > "+fnn
72         os.system(cmd)
73         cmd1 = "mv "+fnn+" "+fn
74         os.system(cmd1)
75
76 def changeword2(file):
77         fn = file[:-1]
78         fnn = file[:-1]+'_n'
79         cmd = "sed s/Dreambox/Vu+/g "+fn+" > "+fnn
80         os.system(cmd)
81         cmd1 = "mv "+fnn+" "+fn
82         os.system(cmd1)
83
84 do_unpack_append(){
85         modify_po()
86 }
87
88
89 do_install_append_vuplus() {
90         install -m 0644 ${WORKDIR}/dreamboxweb.png ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/img/
91         install -m 0644 ${WORKDIR}/dreamboxwebtv.png ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/tpl/default/streaminterface/img
92         install -m 0644 ${WORKDIR}/favicon.ico ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/img/
93 }
94
95 python populate_packages_prepend() {
96         enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
97         do_split_packages(d, enigma2_plugindir, '^(\w+/\w+)', 'enigma2-plugin-%s', '%s', recursive=True, match_path=True, prepend=True)
98         do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/.*\.la$', 'enigma2-plugin-%s-dev', '%s (development)', recursive=True, match_path=True, prepend=True)
99         do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/.*\.a$', 'enigma2-plugin-%s-staticdev', '%s (static development)', recursive=True, match_path=True, prepend=True)
100         do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/\.debug/', 'enigma2-plugin-%s-dbg', '%s (debug)', recursive=True, match_path=True, prepend=True)
101         def parseControlFile(dir, d, package):
102                 import os
103                 #ac3lipsync is renamed since 20091121 to audiosync.. but rename in cvs is not possible without lost of revision history..
104                 #so the foldername is still ac3lipsync
105                 if package == 'audiosync':
106                         package = 'ac3lipsync'
107                 src = open(dir + "/" + package.split('-')[-1] + "/CONTROL/control").read()
108                 for line in src.splitlines():
109                         name, value = line.strip().split(': ', 1)
110                         if name == 'Description':
111                                 d.setVar('DESCRIPTION_' + package, value)
112                         elif name == 'Depends':
113                                 d.setVar('RDEPENDS_' + package, ' '.join(value.split(', ')))
114                         elif name == 'Replaces':
115                                 d.setVar('RREPLACES_' + package, ' '.join(value.split(', ')))
116                         elif name == 'Conflicts':
117                                 d.setVar('RCONFLICTS_' + package, ' '.join(value.split(', ')))
118         srcdir = d.getVar('S', True)
119         for package in d.getVar('PACKAGES', True).split():
120                 if package.startswith('enigma2-plugin-') and not package.endswith('-dev') and not package.endswith('-dbg') and not package.endswith('-staticdev'):
121                         parseControlFile(srcdir, d, package)
122 }