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