[dvbapp] increase PR.
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-vuplus / 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 = "r13"
15
16 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
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         --with-gstversion=1.0 \
26 "
27
28 PARALLEL_MAKE = ""
29
30 SRC_URI_append_vuplus = " \
31         file://enigma2_plugins_mytube_tpm.patch \
32         file://enigma2_plugins_20121113.patch \
33         file://enigma2_plugins_webinterface_tpm.patch \
34         file://enigma2_plugins_ac3lipsync_dolby.patch \
35         file://enigma2_plugins_autoresolution_fix.patch \
36         file://enigma2_plugins_fancontrol2.patch \
37         file://enigma2_plugins_gst10_support.patch \
38         file://enigma2_plugins_fix_depends_pkgname.patch \
39         file://dreamboxweb.png \
40         file://dreamboxwebtv.png \
41         file://favicon.ico \
42         file://Makefile.am \
43 "
44
45 FILES_${PN} += " /usr/share/enigma2 /usr/share/fonts "
46 FILES_${PN}-meta = "${datadir}/meta"
47 PACKAGES += "${PN}-meta"
48 PACKAGE_ARCH = "${MACHINE_ARCH}"
49
50 inherit autotools-brokensep pythonnative pkgconfig
51
52 S = "${WORKDIR}/git"
53
54 DEPENDS = " \
55         enigma2 \
56         python-pyopenssl \
57         python-gdata \
58         streamripper \
59         python-mutagen \
60         python-daap \
61         enigma2-plugin-extensions-openwebif \
62         gstreamer1.0-plugins-bad \
63         "
64
65 def modify_po():
66     import os
67     try:
68         os.system("find ./ -name \"*.po\" > ./po_list")
69         os.system("find ./ -name \"*.pot\" >> ./po_list")
70         po_list = []
71         po_list = open('po_list','r+').readlines()
72         for x in po_list:
73             changeword1(x)
74         changeword1('enigma2-plugins/networkwizard/src/networkwizard.xml ')
75         changeword2('enigma2-plugins/webinterface/src/web-data/tpl/default/index.html ')
76         os.system('rm po_list')
77     except:
78         print 'word patch error '
79         return
80
81 def changeword1(file):
82     fn = file[:-1]
83     fnn = file[:-1]+'_n'
84     cmd = "sed s/Dreambox/STB/g "+fn+" > "+fnn
85     os.system(cmd)
86     cmd1 = "mv "+fnn+" "+fn
87     os.system(cmd1)
88
89 def changeword2(file):
90     fn = file[:-1]
91     fnn = file[:-1]+'_n'
92     cmd = "sed s/Dreambox/Vu+/g "+fn+" > "+fnn
93     os.system(cmd)
94     cmd1 = "mv "+fnn+" "+fn
95     os.system(cmd1)
96
97 do_unpack_append(){
98     modify_po()
99 }
100
101 do_configure_prepend_vuplus() {
102         cp -av ${WORKDIR}/Makefile.am ${S}/easymedia/po/
103 }
104
105 do_install_append_vuplus() {
106         install -m 0644 ${WORKDIR}/dreamboxweb.png ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/img/
107         install -m 0644 ${WORKDIR}/dreamboxwebtv.png ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/tpl/default/streaminterface/img
108         install -m 0644 ${WORKDIR}/favicon.ico ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/img/
109         rm -r ${D}/media
110 }
111
112 python populate_packages_prepend() {
113     enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
114     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+)', 'enigma2-plugin-%s', '%s', recursive=True, match_path=True, prepend=True)
115     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/.*\.la$', 'enigma2-plugin-%s-dev', '%s (development)', recursive=True, match_path=True, prepend=True)
116     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/.*\.a$', 'enigma2-plugin-%s-staticdev', '%s (static development)', recursive=True, match_path=True, prepend=True)
117     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/\.debug/', 'enigma2-plugin-%s-dbg', '%s (debug)', recursive=True, match_path=True, prepend=True)
118     def parseControlFile(dir, d, package):
119         import os
120         #ac3lipsync is renamed since 20091121 to audiosync.. but rename in cvs is not possible without lost of revision history..
121         #so the foldername is still ac3lipsync
122         if package == 'audiosync':
123             package = 'ac3lipsync'
124         src = open(dir + "/" + package.split('-')[-1] + "/CONTROL/control").read()
125         for line in src.splitlines():
126             name, value = line.strip().split(': ', 1)
127             if name == 'Description':
128                 d.setVar('DESCRIPTION_' + package, value)
129             elif name == 'Depends':
130                 rdepends = []
131                 for depend in value.split(','):
132                     depend = depend.strip()
133                     if depend.startswith('enigma2') and not depend.startswith('enigma2-'):
134                         rdepends.append('enigma2')
135                     else:
136                         rdepends.append(depend)
137                 d.setVar('RDEPENDS_' + package, ' '.join(rdepends))
138             elif name == 'Replaces':
139                 d.setVar('RREPLACES_' + package, ' '.join(value.split(', ')))
140             elif name == 'Conflicts':
141                 d.setVar('RCONFLICTS_' + package, ' '.join(value.split(', ')))
142     srcdir = d.getVar('S', True)
143     for package in d.getVar('PACKAGES', True).split():
144         if package.startswith('enigma2-plugin-') and not package.endswith('-dev') and not package.endswith('-dbg') and not package.endswith('-staticdev'):
145             parseControlFile(srcdir, d, package)
146 }