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