Fixing bazel-based packaging of the CLI branding

Change-Id: I2a275a99d9a59ac4ac297e7cd445b11de63ca47b
diff --git a/tools/package/BUILD b/tools/package/BUILD
index 26638d4..93a0e1c 100644
--- a/tools/package/BUILD
+++ b/tools/package/BUILD
@@ -37,7 +37,6 @@
     tools = ["onos_stage.py"],
 )
 
-# Generates auxiliary tar file with ONOS runtime tools
 filegroup(
     name = "onos-runtime-tools",
     srcs = glob(["runtime/bin/*"]),
@@ -53,6 +52,7 @@
     visibility = ["//visibility:public"],
 )
 
+# Generates the onos-test.tar.gz file with test tools
 genrule(
     name = "onos-package-test",
     srcs = ["//tools/dev:onos-test", "//tools/test:onos-test", ":onos-runtime-tools", "//:onos-env-defaults"],
@@ -62,18 +62,23 @@
     visibility = ["//visibility:public"],
 )
 
+# Runs ONOS as a single instance from the /tmp directory
+# FIXME: Still work in progress
+genrule(
+    name = "onos-run",
+    outs = ["onos-runner"],
+    srcs = ["onos-run-karaf", "onos-package"],
+    cmd = "sed \"s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#\" $(location onos-run-karaf) > $(location onos-runner); chmod +x $(location onos-runner)",
+    executable = True,
+    local = True,
+    visibility = ["//visibility:public"],
+)
+
 #staged_repos = ['$(location %s-repo)' % f for f in FEATURES]
 #staged_apps = ['$(location %s)' % a for a in APPS]
 #
 ## feature_coords = 'foo:bar:1.3'
 #sources = [ '$(location :onos-features)', ]
 #sources += staged_repos + staged_apps
-#
-#genrule(
-#  name = 'onos-run',
-#  out = 'onos-run',
-#  srcs = [ 'onos-run-karaf' ],
-#  bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT',
-#  executable = True,
-#  visibility = [ 'PUBLIC' ],
-#)
+
+
diff --git a/tools/package/branding/BUILD b/tools/package/branding/BUILD
index 72fa352..e4f8270 100644
--- a/tools/package/branding/BUILD
+++ b/tools/package/branding/BUILD
@@ -1,5 +1,6 @@
 
 java_library(
-    name = "onos-tools-package-branding",
-    visibility = ["//visibility:public"],
-)
\ No newline at end of file
+     name = "onos-tools-package-branding",
+     resources = glob(["src/main/resources/**/*"]),
+     visibility = ["//visibility:public"],
+ )
\ No newline at end of file
diff --git a/tools/package/onos-prep-karaf b/tools/package/onos-prep-karaf
index cb30a43..b1361e8 100755
--- a/tools/package/onos-prep-karaf
+++ b/tools/package/onos-prep-karaf
@@ -51,7 +51,7 @@
 
 
 # Patch the Apache Karaf distribution with ONOS branding bundle
-cp $BRANDING $KARAF_DIR/lib
+cp $BRANDING $KARAF_DIR/lib/onos-tools-package-branding.jar
 
 # **** Moving karaf to subdirectory ****
 mkdir $PREFIX