2005-08-31 10:45:47 +00:00
|
|
|
inherit package
|
2007-04-03 11:31:02 +00:00
|
|
|
|
2006-09-19 09:04:09 +00:00
|
|
|
IMAGE_PKGTYPE ?= "ipk"
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2009-08-12 10:26:07 +00:00
|
|
|
IPKGCONF_TARGET = "${WORKDIR}/opkg.conf"
|
|
|
|
IPKGCONF_SDK = "${WORKDIR}/opkg-sdk.conf"
|
2007-09-01 22:17:06 +00:00
|
|
|
|
2010-08-05 10:12:27 +00:00
|
|
|
PKGWRITEDIRIPK = "${WORKDIR}/deploy-ipks"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
python package_ipk_fn () {
|
|
|
|
bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d)
|
|
|
|
}
|
|
|
|
|
|
|
|
python package_ipk_install () {
|
|
|
|
pkg = bb.data.getVar('PKG', d, 1)
|
|
|
|
pkgfn = bb.data.getVar('PKGFN', d, 1)
|
|
|
|
rootfs = bb.data.getVar('IMAGE_ROOTFS', d, 1)
|
|
|
|
ipkdir = bb.data.getVar('DEPLOY_DIR_IPK', d, 1)
|
|
|
|
stagingdir = bb.data.getVar('STAGING_DIR', d, 1)
|
|
|
|
tmpdir = bb.data.getVar('TMPDIR', d, 1)
|
|
|
|
|
|
|
|
if None in (pkg,pkgfn,rootfs):
|
|
|
|
raise bb.build.FuncFailed("missing variables (one or more of PKG, PKGFN, IMAGEROOTFS)")
|
|
|
|
try:
|
|
|
|
bb.mkdirhier(rootfs)
|
|
|
|
os.chdir(rootfs)
|
|
|
|
except OSError:
|
2009-11-08 22:32:43 +00:00
|
|
|
import sys
|
2005-08-31 10:45:47 +00:00
|
|
|
(type, value, traceback) = sys.exc_info()
|
|
|
|
print value
|
|
|
|
raise bb.build.FuncFailed
|
|
|
|
|
|
|
|
# Generate ipk.conf if it or the stamp doesnt exist
|
|
|
|
conffile = os.path.join(stagingdir,"ipkg.conf")
|
2007-11-24 14:55:57 +00:00
|
|
|
if not os.access(conffile, os.R_OK):
|
2006-09-19 09:04:09 +00:00
|
|
|
ipkg_archs = bb.data.getVar('PACKAGE_ARCHS',d)
|
2005-08-31 10:45:47 +00:00
|
|
|
if ipkg_archs is None:
|
2006-09-19 09:04:09 +00:00
|
|
|
bb.error("PACKAGE_ARCHS missing")
|
2005-08-31 10:45:47 +00:00
|
|
|
raise FuncFailed
|
|
|
|
ipkg_archs = ipkg_archs.split()
|
2009-11-16 10:06:52 +00:00
|
|
|
arch_priority = 1
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
f = open(conffile,"w")
|
|
|
|
for arch in ipkg_archs:
|
|
|
|
f.write("arch %s %s\n" % ( arch, arch_priority ))
|
|
|
|
arch_priority += 1
|
|
|
|
f.write("src local file:%s" % ipkdir)
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
|
2010-08-25 14:40:34 +00:00
|
|
|
if not os.access(os.path.join(ipkdir,"Packages"), os.R_OK) or not os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),os.R_OK):
|
2008-07-17 21:34:57 +00:00
|
|
|
ret = os.system('opkg-make-index -p %s %s ' % (os.path.join(ipkdir, "Packages"), ipkdir))
|
2005-08-31 10:45:47 +00:00
|
|
|
if (ret != 0 ):
|
|
|
|
raise bb.build.FuncFailed
|
2007-09-27 11:48:36 +00:00
|
|
|
f = open(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),"w")
|
2005-08-31 10:45:47 +00:00
|
|
|
f.close()
|
|
|
|
|
2008-03-17 13:18:07 +00:00
|
|
|
ret = os.system('opkg-cl -o %s -f %s update' % (rootfs, conffile))
|
|
|
|
ret = os.system('opkg-cl -o %s -f %s install %s' % (rootfs, conffile, pkgfn))
|
2005-08-31 10:45:47 +00:00
|
|
|
if (ret != 0 ):
|
|
|
|
raise bb.build.FuncFailed
|
|
|
|
}
|
|
|
|
|
2007-09-01 22:17:06 +00:00
|
|
|
#
|
|
|
|
# Update the Packages index files in ${DEPLOY_DIR_IPK}
|
|
|
|
#
|
|
|
|
package_update_index_ipk () {
|
|
|
|
set -x
|
|
|
|
|
|
|
|
ipkgarchs="${PACKAGE_ARCHS}"
|
|
|
|
|
|
|
|
if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2009-07-07 23:51:51 +00:00
|
|
|
packagedirs="${DEPLOY_DIR_IPK}"
|
2007-09-01 22:17:06 +00:00
|
|
|
for arch in $ipkgarchs; do
|
2009-09-17 12:18:48 +00:00
|
|
|
sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'`
|
|
|
|
packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/$arch ${DEPLOY_DIR_IPK}/$sdkarch-nativesdk"
|
2009-07-07 23:51:51 +00:00
|
|
|
done
|
|
|
|
|
2009-09-17 12:18:48 +00:00
|
|
|
packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/${SDK_ARCH}-${TARGET_ARCH}-canadian"
|
|
|
|
|
2009-07-07 23:51:51 +00:00
|
|
|
for pkgdir in $packagedirs; do
|
|
|
|
if [ -e $pkgdir/ ]; then
|
|
|
|
touch $pkgdir/Packages
|
|
|
|
flock $pkgdir/Packages.flock -c "opkg-make-index -r $pkgdir/Packages -p $pkgdir/Packages -l $pkgdir/Packages.filelist -m $pkgdir/"
|
2007-09-05 21:17:46 +00:00
|
|
|
fi
|
2007-09-01 22:17:06 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate an ipkg conf file ${IPKGCONF_TARGET} suitable for use against
|
|
|
|
# the target system and an ipkg conf file ${IPKGCONF_SDK} suitable for
|
|
|
|
# use against the host system in sdk builds
|
|
|
|
#
|
|
|
|
package_generate_ipkg_conf () {
|
2008-10-08 16:49:57 +00:00
|
|
|
package_generate_archlist
|
2008-10-08 19:16:08 +00:00
|
|
|
echo "src oe file:${DEPLOY_DIR_IPK}" >> ${IPKGCONF_TARGET}
|
|
|
|
echo "src oe file:${DEPLOY_DIR_IPK}" >> ${IPKGCONF_SDK}
|
2007-09-01 22:17:06 +00:00
|
|
|
ipkgarchs="${PACKAGE_ARCHS}"
|
|
|
|
for arch in $ipkgarchs; do
|
2007-09-05 07:53:21 +00:00
|
|
|
if [ -e ${DEPLOY_DIR_IPK}/$arch/Packages ] ; then
|
|
|
|
echo "src oe-$arch file:${DEPLOY_DIR_IPK}/$arch" >> ${IPKGCONF_TARGET}
|
2007-09-05 21:31:49 +00:00
|
|
|
fi
|
2009-09-17 12:18:48 +00:00
|
|
|
sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'`
|
2010-01-14 12:36:04 +00:00
|
|
|
extension=-nativesdk
|
|
|
|
if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then
|
|
|
|
extension=""
|
|
|
|
fi
|
|
|
|
if [ -e ${DEPLOY_DIR_IPK}/$sdkarch$extension/Packages ] ; then
|
|
|
|
echo "src oe-$sdkarch$extension file:${DEPLOY_DIR_IPK}/$sdkarch$extension" >> ${IPKGCONF_SDK}
|
2007-09-05 07:53:21 +00:00
|
|
|
fi
|
2007-09-01 22:17:06 +00:00
|
|
|
done
|
2009-09-17 12:18:48 +00:00
|
|
|
if [ -e ${DEPLOY_DIR_IPK}/${SDK_ARCH}-${TARGET_ARCH}-canadian/Packages ] ; then
|
|
|
|
echo "src oe-${SDK_ARCH}-${TARGET_ARCH}-canadian file:${DEPLOY_DIR_IPK}/${SDK_ARCH}-${TARGET_ARCH}-canadian" >> ${IPKGCONF_SDK}
|
|
|
|
fi
|
2007-09-01 22:17:06 +00:00
|
|
|
}
|
|
|
|
|
2008-10-08 16:49:57 +00:00
|
|
|
package_generate_archlist () {
|
|
|
|
ipkgarchs="${PACKAGE_ARCHS}"
|
|
|
|
priority=1
|
|
|
|
for arch in $ipkgarchs; do
|
2009-09-17 12:18:48 +00:00
|
|
|
sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'`
|
2008-10-08 16:49:57 +00:00
|
|
|
echo "arch $arch $priority" >> ${IPKGCONF_TARGET}
|
2010-01-14 13:16:13 +00:00
|
|
|
extension=-nativesdk
|
|
|
|
if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then
|
|
|
|
extension=""
|
|
|
|
fi
|
|
|
|
echo "arch $sdkarch$extension $priority" >> ${IPKGCONF_SDK}
|
2008-10-08 16:49:57 +00:00
|
|
|
priority=$(expr $priority + 5)
|
|
|
|
done
|
2009-09-17 12:18:48 +00:00
|
|
|
echo "arch ${SDK_ARCH}-${TARGET_ARCH}-canadian $priority" >> ${IPKGCONF_SDK}
|
2008-10-08 16:49:57 +00:00
|
|
|
}
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
python do_package_ipk () {
|
2009-11-08 22:32:43 +00:00
|
|
|
import re, copy
|
2010-09-29 15:11:24 +00:00
|
|
|
import textwrap
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2010-08-04 10:34:00 +00:00
|
|
|
workdir = bb.data.getVar('WORKDIR', d, True)
|
2010-08-05 10:12:27 +00:00
|
|
|
outdir = bb.data.getVar('PKGWRITEDIRIPK', d, True)
|
2010-08-04 10:34:00 +00:00
|
|
|
dvar = bb.data.getVar('D', d, True)
|
|
|
|
tmpdir = bb.data.getVar('TMPDIR', d, True)
|
|
|
|
pkgdest = bb.data.getVar('PKGDEST', d, True)
|
|
|
|
if not workdir or not outdir or not dvar or not tmpdir:
|
|
|
|
bb.error("Variables incorrectly set, unable to package")
|
2005-08-31 10:45:47 +00:00
|
|
|
return
|
|
|
|
|
2010-08-04 10:34:00 +00:00
|
|
|
if not os.path.exists(dvar):
|
|
|
|
bb.debug(1, "Nothing installed, nothing to do")
|
2005-08-31 10:45:47 +00:00
|
|
|
return
|
2007-09-05 07:53:21 +00:00
|
|
|
|
2010-08-04 10:34:00 +00:00
|
|
|
packages = bb.data.getVar('PACKAGES', d, True)
|
|
|
|
if not packages or packages == '':
|
|
|
|
bb.debug(1, "No packages; nothing to do")
|
2005-08-31 10:45:47 +00:00
|
|
|
return
|
|
|
|
|
2010-08-04 10:34:00 +00:00
|
|
|
# We're about to add new packages so the index needs to be checked
|
|
|
|
# so remove the appropriate stamp file.
|
2007-09-27 11:48:36 +00:00
|
|
|
if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
|
|
|
|
os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
for pkg in packages.split():
|
|
|
|
localdata = bb.data.createCopy(d)
|
2007-11-24 23:05:05 +00:00
|
|
|
root = "%s/%s" % (pkgdest, pkg)
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2007-11-24 14:55:57 +00:00
|
|
|
lf = bb.utils.lockfile(root + ".lock")
|
2007-08-24 16:50:56 +00:00
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
bb.data.setVar('ROOT', '', localdata)
|
|
|
|
bb.data.setVar('ROOT_%s' % pkg, root, localdata)
|
|
|
|
pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1)
|
|
|
|
if not pkgname:
|
|
|
|
pkgname = pkg
|
|
|
|
bb.data.setVar('PKG', pkgname, localdata)
|
|
|
|
|
2010-07-07 11:53:46 +00:00
|
|
|
bb.data.setVar('OVERRIDES', pkg, localdata)
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
bb.data.update_data(localdata)
|
|
|
|
basedir = os.path.join(os.path.dirname(root))
|
2007-11-25 19:35:19 +00:00
|
|
|
arch = bb.data.getVar('PACKAGE_ARCH', localdata, 1)
|
|
|
|
pkgoutdir = "%s/%s" % (outdir, arch)
|
2005-08-31 10:45:47 +00:00
|
|
|
bb.mkdirhier(pkgoutdir)
|
|
|
|
os.chdir(root)
|
|
|
|
from glob import glob
|
|
|
|
g = glob('*')
|
|
|
|
try:
|
|
|
|
del g[g.index('CONTROL')]
|
|
|
|
del g[g.index('./CONTROL')]
|
|
|
|
except ValueError:
|
|
|
|
pass
|
2007-09-01 23:49:12 +00:00
|
|
|
if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
|
2009-11-08 22:32:43 +00:00
|
|
|
bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2005-08-31 10:45:47 +00:00
|
|
|
continue
|
2007-09-01 23:49:12 +00:00
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
controldir = os.path.join(root, 'CONTROL')
|
|
|
|
bb.mkdirhier(controldir)
|
|
|
|
try:
|
|
|
|
ctrlfile = file(os.path.join(controldir, 'control'), 'w')
|
|
|
|
except OSError:
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2005-08-31 10:45:47 +00:00
|
|
|
raise bb.build.FuncFailed("unable to open control file for writing.")
|
|
|
|
|
|
|
|
fields = []
|
2007-05-31 22:51:19 +00:00
|
|
|
pe = bb.data.getVar('PE', d, 1)
|
|
|
|
if pe and int(pe) > 0:
|
|
|
|
fields.append(["Version: %s:%s-%s\n", ['PE', 'PV', 'PR']])
|
|
|
|
else:
|
|
|
|
fields.append(["Version: %s-%s\n", ['PV', 'PR']])
|
2005-08-31 10:45:47 +00:00
|
|
|
fields.append(["Description: %s\n", ['DESCRIPTION']])
|
|
|
|
fields.append(["Section: %s\n", ['SECTION']])
|
|
|
|
fields.append(["Priority: %s\n", ['PRIORITY']])
|
|
|
|
fields.append(["Maintainer: %s\n", ['MAINTAINER']])
|
|
|
|
fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
|
2007-05-31 22:51:19 +00:00
|
|
|
fields.append(["OE: %s\n", ['PN']])
|
2005-09-20 07:04:35 +00:00
|
|
|
fields.append(["Homepage: %s\n", ['HOMEPAGE']])
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
def pullData(l, d):
|
|
|
|
l2 = []
|
|
|
|
for i in l:
|
|
|
|
l2.append(bb.data.getVar(i, d, 1))
|
|
|
|
return l2
|
|
|
|
|
|
|
|
ctrlfile.write("Package: %s\n" % pkgname)
|
|
|
|
# check for required fields
|
|
|
|
try:
|
|
|
|
for (c, fs) in fields:
|
|
|
|
for f in fs:
|
|
|
|
if bb.data.getVar(f, localdata) is None:
|
|
|
|
raise KeyError(f)
|
2010-09-29 15:11:24 +00:00
|
|
|
# Special behavior for description...
|
|
|
|
if 'DESCRIPTION' in fs:
|
|
|
|
summary = bb.data.getVar('SUMMARY', localdata, True) or bb.data.getVar('DESCRIPTION', localdata, True) or "."
|
|
|
|
description = bb.data.getVar('DESCRIPTION', localdata, True) or "."
|
|
|
|
description = textwrap.dedent(description).strip()
|
|
|
|
ctrlfile.write('Description: %s\n' % summary)
|
|
|
|
ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
|
|
|
|
else:
|
|
|
|
ctrlfile.write(c % tuple(pullData(fs, localdata)))
|
2005-08-31 10:45:47 +00:00
|
|
|
except KeyError:
|
2009-11-08 22:32:43 +00:00
|
|
|
import sys
|
2005-08-31 10:45:47 +00:00
|
|
|
(type, value, traceback) = sys.exc_info()
|
|
|
|
ctrlfile.close()
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2005-08-31 10:45:47 +00:00
|
|
|
raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value)
|
|
|
|
# more fields
|
2006-02-27 13:18:52 +00:00
|
|
|
|
|
|
|
bb.build.exec_func("mapping_rename_hook", localdata)
|
|
|
|
|
2010-06-30 08:48:59 +00:00
|
|
|
rdepends = bb.utils.explode_dep_versions(bb.data.getVar("RDEPENDS", localdata, 1) or "")
|
|
|
|
rrecommends = bb.utils.explode_dep_versions(bb.data.getVar("RRECOMMENDS", localdata, 1) or "")
|
|
|
|
rsuggests = bb.utils.explode_dep_versions(bb.data.getVar("RSUGGESTS", localdata, 1) or "")
|
|
|
|
rprovides = bb.utils.explode_dep_versions(bb.data.getVar("RPROVIDES", localdata, 1) or "")
|
|
|
|
rreplaces = bb.utils.explode_dep_versions(bb.data.getVar("RREPLACES", localdata, 1) or "")
|
|
|
|
rconflicts = bb.utils.explode_dep_versions(bb.data.getVar("RCONFLICTS", localdata, 1) or "")
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
if rdepends:
|
2010-06-30 08:48:59 +00:00
|
|
|
ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
|
2005-08-31 10:45:47 +00:00
|
|
|
if rsuggests:
|
2010-06-30 08:48:59 +00:00
|
|
|
ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests))
|
2005-08-31 10:45:47 +00:00
|
|
|
if rrecommends:
|
2010-06-30 08:48:59 +00:00
|
|
|
ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends))
|
2005-08-31 10:45:47 +00:00
|
|
|
if rprovides:
|
2010-06-30 08:48:59 +00:00
|
|
|
ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides))
|
2005-08-31 10:45:47 +00:00
|
|
|
if rreplaces:
|
2010-06-30 08:48:59 +00:00
|
|
|
ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
|
2005-08-31 10:45:47 +00:00
|
|
|
if rconflicts:
|
2010-06-30 08:48:59 +00:00
|
|
|
ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
|
2005-08-31 10:45:47 +00:00
|
|
|
src_uri = bb.data.getVar("SRC_URI", localdata, 1)
|
|
|
|
if src_uri:
|
|
|
|
src_uri = re.sub("\s+", " ", src_uri)
|
|
|
|
ctrlfile.write("Source: %s\n" % " ".join(src_uri.split()))
|
|
|
|
ctrlfile.close()
|
|
|
|
|
|
|
|
for script in ["preinst", "postinst", "prerm", "postrm"]:
|
|
|
|
scriptvar = bb.data.getVar('pkg_%s' % script, localdata, 1)
|
|
|
|
if not scriptvar:
|
|
|
|
continue
|
|
|
|
try:
|
|
|
|
scriptfile = file(os.path.join(controldir, script), 'w')
|
|
|
|
except OSError:
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2005-08-31 10:45:47 +00:00
|
|
|
raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
|
|
|
|
scriptfile.write(scriptvar)
|
|
|
|
scriptfile.close()
|
|
|
|
os.chmod(os.path.join(controldir, script), 0755)
|
|
|
|
|
|
|
|
conffiles_str = bb.data.getVar("CONFFILES", localdata, 1)
|
|
|
|
if conffiles_str:
|
|
|
|
try:
|
|
|
|
conffiles = file(os.path.join(controldir, 'conffiles'), 'w')
|
|
|
|
except OSError:
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2005-08-31 10:45:47 +00:00
|
|
|
raise bb.build.FuncFailed("unable to open conffiles for writing.")
|
|
|
|
for f in conffiles_str.split():
|
|
|
|
conffiles.write('%s\n' % f)
|
|
|
|
conffiles.close()
|
|
|
|
|
|
|
|
os.chdir(basedir)
|
|
|
|
ret = os.system("PATH=\"%s\" %s %s %s" % (bb.data.getVar("PATH", localdata, 1),
|
2008-07-17 21:34:57 +00:00
|
|
|
bb.data.getVar("OPKGBUILDCMD",d,1), pkg, pkgoutdir))
|
2005-08-31 10:45:47 +00:00
|
|
|
if ret != 0:
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2008-07-17 21:34:57 +00:00
|
|
|
raise bb.build.FuncFailed("opkg-build execution failed")
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2008-08-18 07:58:39 +00:00
|
|
|
bb.utils.prunedir(controldir)
|
2007-11-24 14:55:57 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2010-08-05 10:12:27 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SSTATETASKS += "do_package_write_ipk"
|
|
|
|
do_package_write_ipk[sstate-name] = "deploy-ipk"
|
|
|
|
do_package_write_ipk[sstate-inputdirs] = "${PKGWRITEDIRIPK}"
|
|
|
|
do_package_write_ipk[sstate-outputdirs] = "${DEPLOY_DIR_IPK}"
|
|
|
|
|
|
|
|
python do_package_write_ipk_setscene () {
|
|
|
|
sstate_setscene(d)
|
2005-08-31 10:45:47 +00:00
|
|
|
}
|
2010-09-16 05:55:21 +00:00
|
|
|
addtask do_package_write_ipk_setscene
|
2007-08-21 09:37:30 +00:00
|
|
|
|
|
|
|
python () {
|
|
|
|
if bb.data.getVar('PACKAGES', d, True) != '':
|
2007-11-28 20:01:41 +00:00
|
|
|
deps = (bb.data.getVarFlag('do_package_write_ipk', 'depends', d) or "").split()
|
2009-11-10 14:55:23 +00:00
|
|
|
deps.append('opkg-utils-native:do_populate_sysroot')
|
2010-06-23 14:19:06 +00:00
|
|
|
deps.append('virtual/fakeroot-native:do_populate_sysroot')
|
2007-11-28 20:01:41 +00:00
|
|
|
bb.data.setVarFlag('do_package_write_ipk', 'depends', " ".join(deps), d)
|
2010-08-16 15:40:52 +00:00
|
|
|
bb.data.setVarFlag('do_package_write_ipk', 'fakeroot', "1", d)
|
2010-10-22 15:34:06 +00:00
|
|
|
bb.data.setVarFlag('do_package_write_ipk_setscene', 'fakeroot', "1", d)
|
2007-08-21 09:37:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
python do_package_write_ipk () {
|
|
|
|
bb.build.exec_func("read_subpackage_metadata", d)
|
|
|
|
bb.build.exec_func("do_package_ipk", d)
|
|
|
|
}
|
2010-08-05 10:12:27 +00:00
|
|
|
do_package_write_ipk[dirs] = "${PKGWRITEDIRIPK}"
|
2007-08-21 22:39:57 +00:00
|
|
|
addtask package_write_ipk before do_package_write after do_package
|