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