enigma2-plugins: remove unused dependencies
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2-plugins / enigma2-plugins.inc
1 SUMMARY = "Additional plugins for Enigma2"
2 LICENSE = "Proprietary"
3 LIC_FILES_CHKSUM = "file://COPYING;md5=8e37f34d0e40d32ea2bc90ee812c9131"
4 DEPENDS = "gettext-native"
5
6 SRC_URI += "file://print.mak"
7
8 inherit autotools-brokensep pythonnative
9
10 do_install_append() {
11         # create lists of files installed outside of "${libdir}/enigma2/python/Plugins" or "${datadir}/meta"
12         rm -rf ${INSTALL_ROOTDIR}
13         install -d ${INSTALL_ROOTDIR}
14         SUBDIRS=`make -f Makefile -f ${WORKDIR}/print.mak print-SUBDIRS`
15         for SUBDIR in $SUBDIRS; do
16                 oe_runmake -C $SUBDIR "DESTDIR=${INSTALL_DESTDIR}" install
17                 CATEGORY=`ls -1 ${INSTALL_PLUGINSDIR} | head -n1 | tr '[:upper:]' '[:lower:]'`
18                 NAME=`echo $SUBDIR | tr '[:upper:]' '[:lower:]'`
19                 PKG="enigma2-plugin-$CATEGORY-$NAME"
20                 rm -rf ${INSTALL_METADIR} ${INSTALL_PODIR} ${INSTALL_PLUGINSDIR}
21                 find ${INSTALL_DESTDIR} -type f -name "*.la" -delete
22                 find ${INSTALL_DESTDIR} -type f -fprintf ${INSTALL_ROOTDIR}/$PKG '/%P\n'
23                 [ -s ${INSTALL_ROOTDIR}/$PKG ] || rm ${INSTALL_ROOTDIR}/$PKG
24                 rm -rf ${INSTALL_DESTDIR}
25         done
26
27         # delete unwanted files
28         find ${D} -type f -name "*.la" -delete
29 }
30
31 PACKAGES_DYNAMIC = "^enigma2-plugin-(extensions|skincomponents|systemplugins)-.*"
32 PACKAGES += "${PN}-meta ${PN}-po"
33
34 FILES_${PN} = ""
35 FILES_${PN}-meta = "${datadir}/meta"
36 FILES_${PN}-po = "${datadir}/enigma2/po"
37
38 python enigma2_plugins_split_packages() {
39     enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
40     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+)', 'enigma2-plugin-%s', '%s', recursive=True, extra_depends='enigma2', match_path=True)
41
42     def parseControlFile(package, dir):
43         filename = os.path.join(dir, 'CONTROL/control')
44         if os.path.exists(filename):
45             with open(filename) as f:
46                 for line in f.read().splitlines():
47                     try:
48                         name, value = line.strip().split(': ', 1)
49                         if name == 'Description':
50                             d.setVar('DESCRIPTION_%s' % package, value)
51                         elif name in ('Breaks', 'Conflicts', 'Depends', 'Provides', 'Recommends', 'Replaces', 'Suggests'):
52                             d.appendVar('R%s_%s' % (name.upper(), package), ' ' + ' '.join(value.split(', ')))
53                     except:
54                         bb.fatal("Error parsing control file for package %s" % package)
55
56     def parseFileList(package, dir):
57         filename = os.path.join(dir, package)
58         if os.path.exists(filename):
59             varname = 'FILES_%s' % package
60             files = (d.getVar(varname, True) or "").split()
61             with open(filename) as f:
62                 for line in f.read().splitlines():
63                     if not line in files:
64                         files.append(line)
65             d.setVar(varname, ' '.join(files))
66
67     tempdir = d.getVar('INSTALL_ROOTDIR', True)
68     srcdir = d.getVar('S', True)
69     packages = d.getVar('PACKAGES', True).split()
70     for package in packages:
71         if package.startswith('enigma2-plugin-'):
72             subdir = package.split('-')[-1]
73             parseFileList(package, tempdir)
74             parseControlFile(package, os.path.join(srcdir, subdir))
75 }
76
77 PACKAGESPLITFUNCS_prepend = "enigma2_plugins_split_packages "
78
79 INSTALL_ROOTDIR = "${WORKDIR}/${PN}-packaging-tempdir"
80 INSTALL_DESTDIR = "${INSTALL_ROOTDIR}/destdir"
81 INSTALL_METADIR = "${INSTALL_DESTDIR}${datadir}/meta"
82 INSTALL_PODIR = "${INSTALL_DESTDIR}${datadir}/enigma2/po"
83 INSTALL_PLUGINSDIR = "${INSTALL_DESTDIR}${libdir}/enigma2/python/Plugins"
84
85 # This list of packages is compiled from all 'Depends' fields in all control
86 # files found in the enigma2-plugins repository. If a dependency gets added
87 # there, add it here, too. This allows to keep build dependencies minimal
88 # while making sure that all runtime dependencies are available.
89 # As ${PN} doesn't contain any files and ALLOW_EMPTY isn't set, this list
90 # actually has no impact on any generated packages.
91 RDEPENDS_${PN} = " \
92         aio-grab \
93         avahi-daemon \
94         cdrkit \
95         cdtextinfo \
96         dbttcd \
97         dvdbackup \
98         enigma2 \
99         enigma2-streamproxy \
100         gstreamer1.0-plugins-bad-faad \
101         gstreamer1.0-plugins-bad-fragmented \
102         gstreamer1.0-plugins-good-flv \
103         gstreamer1.0-plugins-good-icydemux \
104         gstreamer1.0-plugins-good-spectrum \
105         hdparm \
106         parted \
107         python-codecs \
108         python-compression \
109         python-crypt \
110         python-difflib \
111         python-email \
112         python-flickrapi \
113         python-gdata \
114         python-google-api-client \
115         python-html \
116         python-io \
117         python-json \
118         python-lang \
119         python-misc \
120         python-netclient \
121         python-pyopenssl \
122         python-re \
123         python-shell \
124         python-simplejson \
125         python-subprocess \
126         python-textutils \
127         python-threading \
128         python-transmissionrpc \
129         python-twisted-core \
130         python-twisted-mail \
131         python-twisted-names \
132         python-twisted-protocols \
133         python-twisted-web \
134         python-xml \
135         python-youtube-dl \
136         python-zlib \
137         satip-client \
138         shellinabox \
139         smartmontools \
140         streamripper \
141 "