docbook-sgml-dtd-native: converted to new style staging
authorFahad Usman <fahad_usman@mentor.com>
Wed, 1 Sep 2010 01:54:55 +0000 (01:54 +0000)
committerTom Rini <tom_rini@mentor.com>
Thu, 30 Sep 2010 21:03:09 +0000 (14:03 -0700)
* Converted do_stage to do_install.
* Moved the catalog files from ${sysconfdir}/sgml to ${D}${sysconfdir}/sgml so that they get included in the package file resulting with the new style staging.
* Added a function docbook_sgml_dtd_native_mangle, to correct the path in .cat file and added it to SYSROOT_PREPROCESS_FUNCS.
* Added INC_PR = "r1" to the .inc file and PR = "${INC_PR}.0" to the .bb files

Signed-off-by: Fahad Usman <fahad_usman@mentor.com>
Signed-off-by: Tom Rini <tom_rini@mentor.com>
recipes/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native.bb
recipes/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native.bb
recipes/docbook-sgml-dtd/docbook-sgml-dtd-4.4-native.bb
recipes/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb
recipes/docbook-sgml-dtd/docbook-sgml-dtd-native.inc

index 939fd53..7f5e19e 100644 (file)
@@ -2,6 +2,8 @@ require docbook-sgml-dtd-native.inc
 
 DTD_VERSION = "3.1"
 
+PR = "${INC_PR}.0"
+
 SRC_URI = "http://www.docbook.org/sgml/3.1/docbk31.zip;md5sum=432749c0c806dbae81c8bcb70da3b5d3"
 
 do_compile() {
index 2bc43e1..e6650ed 100644 (file)
@@ -2,6 +2,8 @@ require docbook-sgml-dtd-native.inc
 
 DTD_VERSION = "4.1"
 
+PR = "${INC_PR}.0"
+
 SRC_URI = "http://docbook.org/sgml/4.1/docbk41.zip"
 
 do_compile() {
index 9e51964..537e8b2 100644 (file)
@@ -2,6 +2,8 @@ require docbook-sgml-dtd-native.inc
 
 DTD_VERSION = "4.4"
 
+PR = "${INC_PR}.0"
+
 do_compile() {
     # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
     # for details.
index f5e257c..82deb33 100644 (file)
@@ -2,6 +2,8 @@ require docbook-sgml-dtd-native.inc
 
 DTD_VERSION = "4.5"
 
+PR = "${INC_PR}.0"
+
 do_compile() {
     # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
     # for details.
index 69c9811..15afd00 100644 (file)
@@ -12,20 +12,33 @@ SRC_URI = "http://www.docbook.org/sgml/${DTD_VERSION}/docbook-${DTD_VERSION}.zip
 
 S = "${WORKDIR}"
 
+INC_PR = "r1"
+
+SYSROOT_PREPROCESS_FUNCS += "docbook_sgml_dtd_native_mangle"
+
 inherit native
 
-do_stage () {
+do_install () {
     # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
     # for details.
-    install -d -m 755 ${STAGING_DATADIR}/sgml/docbook/sgml-dtd-${DTD_VERSION}
-    install docbook.cat ${STAGING_DATADIR}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
-    cp -dpr *.dtd *.mod *.dcl ${STAGING_DATADIR}/sgml/docbook/sgml-dtd-${DTD_VERSION}
-    
+    install -d -m 755 ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
+    install docbook.cat ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
+    cp -dpr *.dtd *.mod *.dcl ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
+
     install-catalog --add ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat \
-      ${STAGING_DATADIR}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
-       
+      ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
     install-catalog --add ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat \
       ${sysconfdir}/sgml/sgml-docbook.cat
+    # Moving them to image directory so that they get included in the .ipk file
+    # generated by new style staging.
+    install -d ${D}${sysconfdir}/sgml
+    cp ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat ${D}${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+    cp ${sysconfdir}/sgml/catalog ${D}${sysconfdir}/sgml/
 }
 
 PACKAGES = ""
+docbook_sgml_dtd_native_mangle () {
+    # Removing the image directory path (${D}) from the .cat file.
+    sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+}
+NATIVE_INSTALL_WORKS = "1"