Patchwork [denzil,01/18] Patch ocf-linux.inc to work with the 2010 and 2012 versions

login
register
mail settings
Submitter Mark Hatle
Date Feb. 7, 2013, 11:56 p.m.
Message ID <c3987be969d51494a4879b476a7d03fda27ad05f.1360270199.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/44265/
State New
Headers show

Comments

Mark Hatle - Feb. 7, 2013, 11:56 p.m.
From: dhall <dennis.hall@windriver.com>

The 2010 version of the ocf-linux package contains an embedded
tar file that has to be expanded.  The 2012 version of the package
comes with the contents of the tar file extracted in the source
tree.  This patch to ocf-linux.inc allows it to handle both versions.

Signed-off-by: dhall <dennis.hall@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-connectivity/openssl/ocf-linux.inc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-connectivity/openssl/ocf-linux.inc b/meta/recipes-connectivity/openssl/ocf-linux.inc
index f4ec7c9..15a553a 100644
--- a/meta/recipes-connectivity/openssl/ocf-linux.inc
+++ b/meta/recipes-connectivity/openssl/ocf-linux.inc
@@ -9,6 +9,12 @@  SRC_URI = "http://sourceforge.net/projects/ocf-linux/files/ocf-linux/${PV}/ocf-l
 
 S = "${WORKDIR}/ocf-linux-${PV}"
 
+get_headers() {
+    if [ -f ocf-linux.tar.gz ]; then
+        tar -xf ocf-linux.tar.gz
+    fi
+}
+
 # Need to unpack the the ocf-linux.tar.gz file contained inside the
 # downloaded tarball
 # Install the OCF Linux headers so that other packages such as openssl
@@ -16,7 +22,10 @@  S = "${WORKDIR}/ocf-linux-${PV}"
 # the README file.
 do_install() {
     cd ${S}
-    tar xzf ocf-linux.tar.gz
+    # if ocf-linux.tar.gz exists extract the contents or else go to 
+    #    the next do_install step
+    # Added to maintain compatibility between the 2010 and 2012+ versions
+    get_headers
     install -d ${D}${includedir}/crypto
     install -m 0644 ${S}/ocf/*.h ${D}${includedir}/crypto/
 }