summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-09-22 17:21:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-22 18:13:00 +0100
commit9e0a6b2e6f16185f8032d36b77d40802bc388987 (patch)
treeed74b7311e1fccfbad765dcd1fe9f27c8caaccfc /scripts
parentf6b90bceaedf9bad3d111e6ca1fa79e59f472c73 (diff)
downloadopenembedded-core-9e0a6b2e6f16185f8032d36b77d40802bc388987.tar.gz
openembedded-core-9e0a6b2e6f16185f8032d36b77d40802bc388987.tar.bz2
openembedded-core-9e0a6b2e6f16185f8032d36b77d40802bc388987.zip
devtool / recipetool: add handling for binary-only packages
Add a means of creating recipes for package files or archives that contain a directory structure to be installed verbatim, for example an rpm file. (We mostly just re-use bin_package here and skip some of the normal build system checks.) This support is available in "recipetool create" and "devtool add" which wraps the former. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py9
-rw-r--r--scripts/lib/recipetool/create.py14
2 files changed, 23 insertions, 0 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index c254132423..96b271c2d6 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -94,6 +94,8 @@ def add(args, config, basepath, workspace):
source = srctree
if args.version:
extracmdopts += ' -V %s' % args.version
+ if args.binary:
+ extracmdopts += ' -b'
try:
stdout, _ = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s" %s' % (color, recipefile, source, extracmdopts))
except bb.process.ExecutionError as e:
@@ -125,6 +127,12 @@ def add(args, config, basepath, workspace):
if initial_rev:
f.write('\n# initial_rev: %s\n' % initial_rev)
+ if args.binary:
+ f.write('do_install_append() {\n')
+ f.write(' rm -rf ${D}/.git\n')
+ f.write(' rm -f ${D}/singletask.lock\n')
+ f.write('}\n')
+
_add_md5(config, args.recipename, appendfile)
logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)
@@ -885,6 +893,7 @@ def register_commands(subparsers, context):
parser_add.add_argument('--fetch', '-f', help='Fetch the specified URI and extract it to create the source tree', metavar='URI')
parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)')
parser_add.add_argument('--no-git', '-g', help='If -f/--fetch is specified, do not set up source tree as a git repository', action="store_true")
+ parser_add.add_argument('--binary', '-b', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure)', action='store_true')
parser_add.set_defaults(func=add)
parser_modify = subparsers.add_parser('modify', help='Modify the source for an existing recipe',
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 409b255f5f..844073bf59 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -104,6 +104,10 @@ def create_recipe(args):
if '://' in args.source:
# Fetch a URL
fetchuri = urlparse.urldefrag(args.source)[0]
+ if args.binary:
+ # Assume the archive contains the directory structure verbatim
+ # so we need to extract to a subdirectory
+ fetchuri += ';subdir=%s' % os.path.splitext(os.path.basename(urlparse.urlsplit(fetchuri).path))[0]
srcuri = fetchuri
rev_re = re.compile(';rev=([^;]+)')
res = rev_re.search(srcuri)
@@ -226,6 +230,10 @@ def create_recipe(args):
lines_after.append('PACKAGE_ARCH = "%s"' % pkgarch)
lines_after.append('')
+ if args.binary:
+ lines_after.append('INSANE_SKIP_${PN} += "already-stripped"')
+ lines_after.append('')
+
# Find all plugins that want to register handlers
handlers = []
for plugin in plugins:
@@ -235,6 +243,11 @@ def create_recipe(args):
# Apply the handlers
classes = []
handled = []
+
+ if args.binary:
+ classes.append('bin_package')
+ handled.append('buildsystem')
+
for handler in handlers:
handler.process(srctree, classes, lines_before, lines_after, handled)
@@ -426,5 +439,6 @@ def register_command(subparsers):
parser_create.add_argument('-m', '--machine', help='Make recipe machine-specific as opposed to architecture-specific', action='store_true')
parser_create.add_argument('-x', '--extract-to', metavar='EXTRACTPATH', help='Assuming source is a URL, fetch it and extract it to the directory specified as %(metavar)s')
parser_create.add_argument('-V', '--version', help='Version to use within recipe (PV)')
+ parser_create.add_argument('-b', '--binary', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure)', action='store_true')
parser_create.set_defaults(func=create_recipe)