Merge branch 'vuplus-1.6' of 192.168.102.66:/var/ikseong/repo/openembedded into vuplu...
[vuplus_openembedded] / 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="87fd2f1120962f553ecb1a88bbee46ed821df975"
8 SRCDATE="20110215"
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 EXTRA_OECONF = " \
16         BUILD_SYS=${BUILD_SYS} \
17         HOST_SYS=${HOST_SYS} \
18         STAGING_INCDIR=${STAGING_INCDIR} \
19         STAGING_LIBDIR=${STAGING_LIBDIR} \
20 "
21
22 SRC_URI_append_vuplus = " \
23            file://enigma2_plugins_mytube_tpm.patch;patch=1;pnum=1 \
24            file://enigma2_plugins_webinterface_tpm.patch;patch=1;pnum=1 \
25            file://enigma2_plugins_ac3lipsync_dolby.patch;patch=1;pnum=1 \
26            file://dreamboxweb.png \
27            file://favicon.ico"
28
29 FILES_${PN} += " /usr/share/enigma2 /usr/share/fonts "
30 FILES_${PN}-meta = "${datadir}/meta"
31 PACKAGES += "${PN}-meta"
32 PACKAGE_ARCH = "${MACHINE_ARCH}"
33
34 inherit autotools
35
36 S = "${WORKDIR}/git"
37
38 DEPENDS = "python-pyopenssl python-gdata streamripper python-mutagen python-daap"
39 DEPENDS += "enigma2"
40
41
42 def modify_po():
43         import os
44         try:
45                 os.system("find ./ -name \"*.po\" > ./po_list")
46                 os.system("find ./ -name \"*.pot\" >> ./po_list")
47                 po_list = []
48                 po_list = open('po_list','r+').readlines()
49                 for x in po_list:
50                         changeword1(x)
51                 changeword1('enigma2-plugins/networkwizard/src/networkwizard.xml ')
52                 changeword2('enigma2-plugins/webinterface/src/web-data/tpl/default/index.html ')
53                 os.system('rm po_list')
54         except:
55                 print 'word patch error '
56                 return
57
58 def changeword1(file):
59         fn = file[:-1]
60         fnn = file[:-1]+'_n'
61         cmd = "sed s/Dreambox/STB/g "+fn+" > "+fnn
62         os.system(cmd)
63         cmd1 = "mv "+fnn+" "+fn
64         os.system(cmd1)
65
66 def changeword2(file):
67         fn = file[:-1]
68         fnn = file[:-1]+'_n'
69         cmd = "sed s/Dreambox/Vu+/g "+fn+" > "+fnn
70         os.system(cmd)
71         cmd1 = "mv "+fnn+" "+fn
72         os.system(cmd1)
73
74 do_unpack_append(){
75         modify_po()
76 }
77
78
79 do_install_append_vuplus() {
80         install -m 0644 ${WORKDIR}/dreamboxweb.png ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/img/
81         install -m 0644 ${WORKDIR}/favicon.ico ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/img/
82 }
83
84 python populate_packages_prepend () {
85         enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
86
87         do_split_packages(d, enigma2_plugindir, '(.*?/.*?)/.*', 'enigma2-plugin-%s', 'Enigma2 Plugin: %s', recursive=True, match_path=True, prepend=True)
88
89         def getControlLines(mydir, d, package):
90                 import os
91                 try:
92                         #ac3lipsync is renamed since 20091121 to audiosync.. but rename in cvs is not possible without lost of revision history..
93                         #so the foldername is still ac3lipsync
94                         if package == 'audiosync':
95                                 package = 'ac3lipsync'
96                         src = open(mydir + package + "/CONTROL/control").read()
97                 except IOError:
98                         return
99                 for line in src.split("\n"):
100                         if line.startswith('Package: '):
101                                 full_package = line[9:]
102                         if line.startswith('Depends: '):
103                                 bb.data.setVar('RDEPENDS_' + full_package, ' '.join(line[9:].split(', ')), d)
104                         if line.startswith('Description: '):
105                                 bb.data.setVar('DESCRIPTION_' + full_package, line[13:], d)
106                         if line.startswith('Replaces: '):
107                                 bb.data.setVar('RREPLACES_' + full_package, ' '.join(line[10:].split(', ')), d)
108                         if line.startswith('Conflicts: '):
109                                 bb.data.setVar('RCONFLICTS_' + full_package, ' '.join(line[11:].split(', ')), d)
110                         if line.startswith('Maintainer: '):
111                                 bb.data.setVar('MAINTAINER_' + full_package, line[12:], d)
112
113         mydir = bb.data.getVar('D', d, 1) + "/../git/"
114         for package in bb.data.getVar('PACKAGES', d, 1).split():
115                 getControlLines(mydir, d, package.split('-')[-1])
116 }