enigma2-plugins: add dm520 to compatible machines
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-plugins_4.3.0.bb
1 SUMMARY = "Additional plugins for Enigma2"
2 LICENSE = "Proprietary"
3 LIC_FILES_CHKSUM = "file://COPYING;md5=8e37f34d0e40d32ea2bc90ee812c9131"
4 DEPENDS = " \
5         dbttcd \
6         dvdbackup \
7         enigma2 \
8         hdparm \
9         python-daap \
10         python-flickrapi \
11         python-gdata \
12         python-google-api-client \
13         python-mutagen \
14         python-pycrypto \
15         python-pyopenssl \
16         python-transmissionrpc \
17         python-youtube-dl \
18         smartmontools \
19         streamripper \
20         satip-client \
21 "
22 SRCREV = "${@opendreambox_srcrev('ddd960ad86fc351fad6d4ce5387d2f6b7d6d0f0c', d)}"
23
24 SRC_URI += "file://print.mak"
25
26 inherit autotools opendreambox-github pythonnative
27
28 export BUILD_SYS
29 export HOST_SYS
30 export STAGING_INCDIR
31 export STAGING_LIBDIR
32
33 do_install_append() {
34         # create lists of files installed outside of "${libdir}/enigma2/python/Plugins" or "${datadir}/meta"
35         rm -rf ${INSTALL_ROOTDIR}
36         install -d ${INSTALL_ROOTDIR}
37         SUBDIRS=`make -f Makefile -f ${WORKDIR}/print.mak print-SUBDIRS`
38         for SUBDIR in $SUBDIRS; do
39                 oe_runmake -C $SUBDIR "DESTDIR=${INSTALL_DESTDIR}" install
40                 CATEGORY=`ls -1 ${INSTALL_PLUGINSDIR} | head -n1 | tr '[:upper:]' '[:lower:]'`
41                 NAME=`echo $SUBDIR | tr '[:upper:]' '[:lower:]'`
42                 PKG="enigma2-plugin-$CATEGORY-$NAME"
43                 rm -rf ${INSTALL_METADIR} ${INSTALL_PODIR} ${INSTALL_PLUGINSDIR}
44                 find ${INSTALL_DESTDIR} -type f -name "*.la" -delete -fprintf ${INSTALL_ROOTDIR}/$PKG-dev '/%P\n'
45                 [ -s ${INSTALL_ROOTDIR}/$PKG-dev ] || rm ${INSTALL_ROOTDIR}/$PKG-dev
46                 find ${INSTALL_DESTDIR} -type f -name "*.a" -delete -fprintf ${INSTALL_ROOTDIR}/$PKG-staticdev '/%P\n'
47                 [ -s ${INSTALL_ROOTDIR}/$PKG-staticdev ] || rm ${INSTALL_ROOTDIR}/$PKG-staticdev
48                 find ${INSTALL_DESTDIR} -type f -fprintf ${INSTALL_ROOTDIR}/$PKG '/%P\n'
49                 [ -s ${INSTALL_ROOTDIR}/$PKG ] || rm ${INSTALL_ROOTDIR}/$PKG
50                 rm -rf ${INSTALL_DESTDIR}
51         done
52 }
53
54 PACKAGES_DYNAMIC = "enigma2-plugin-*"
55 PACKAGES += "${PN}-meta"
56 PACKAGES =+ "${PN}-po"
57
58 FILES_${PN} += "${datadir}/enigma2 ${datadir}/fonts"
59 FILES_${PN}-meta = "${datadir}/meta"
60 FILES_${PN}-po = "${datadir}/enigma2/po"
61
62 python populate_packages_prepend() {
63     enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
64     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+)', 'enigma2-plugin-%s', '%s', recursive=True, match_path=True, prepend=True)
65     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/.*\.la$', 'enigma2-plugin-%s-dev', '%s (development)', recursive=True, match_path=True, prepend=True)
66     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/.*\.a$', 'enigma2-plugin-%s-staticdev', '%s (static development)', recursive=True, match_path=True, prepend=True)
67     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+).*/\.debug/', 'enigma2-plugin-%s-dbg', '%s (debug)', recursive=True, match_path=True, prepend=True)
68     def parseControlFile(dir, d, package):
69         src = open(dir + "/" + package.split('-')[-1] + "/CONTROL/control").read()
70         for line in src.splitlines():
71             try:
72                 name, value = line.strip().split(': ', 1)
73                 if name == 'Description':
74                     d.setVar('DESCRIPTION_' + package, value)
75                 elif name == 'Depends':
76                     d.setVar('RDEPENDS_' + package, ' '.join(value.split(', ')))
77                 elif name == 'Replaces':
78                     d.setVar('RREPLACES_' + package, ' '.join(value.split(', ')))
79                 elif name == 'Conflicts':
80                     d.setVar('RCONFLICTS_' + package, ' '.join(value.split(', ')))
81             except:
82                 bb.fatal("Error parsing control file for package %s" % package)
83     def parseFileList(dir, d, package):
84         filename = os.path.join(dir, package)
85         if os.path.exists(filename):
86             varname = 'FILES_%s' % package
87             files = (d.getVar(varname, True) or "").split()
88             src = open(filename).read()
89             for line in src.splitlines():
90                 if not line in files:
91                     files.append(line)
92             d.setVar(varname, ' '.join(files))
93     tempdir = d.getVar('INSTALL_ROOTDIR', True)
94     srcdir = d.getVar('S', True)
95     for package in d.getVar('PACKAGES', True).split():
96         if package.startswith('enigma2-plugin-'):
97             parseFileList(tempdir, d, package)
98             if not package.endswith('-dev') and not package.endswith('-dbg') and not package.endswith('-staticdev'):
99                 parseControlFile(srcdir, d, package)
100 }
101
102 INSTALL_ROOTDIR = "${WORKDIR}/${PN}-packaging-tempdir"
103 INSTALL_DESTDIR = "${INSTALL_ROOTDIR}/destdir"
104 INSTALL_METADIR = "${INSTALL_DESTDIR}${datadir}/meta"
105 INSTALL_PODIR = "${INSTALL_DESTDIR}${datadir}/enigma2/po"
106 INSTALL_PLUGINSDIR = "${INSTALL_DESTDIR}${libdir}/enigma2/python/Plugins"
107
108 COMPATIBLE_MACHINE = "^(dm520|dm820|dm7080)$"