summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2006-08-13 15:39:08 +0000
committerKoen Kooi <koen@openembedded.org>2006-08-13 15:39:08 +0000
commitef92a8ed1dc323916be0ff18074f8a71020b6cfb (patch)
tree47b3895f63c8f7c0c00e77e2cadb07339c191db8
parent4d1fb8286ca958071250d1f546d01c7c59608cd7 (diff)
downloadopenembedded-ef92a8ed1dc323916be0ff18074f8a71020b6cfb.tar.gz
docs/packaged-staging.xml: describe how to package native applications
-rw-r--r--docs/packaged-staging.xml104
1 files changed, 104 insertions, 0 deletions
diff --git a/docs/packaged-staging.xml b/docs/packaged-staging.xml
index 1cd7e80bc3..e48a568393 100644
--- a/docs/packaged-staging.xml
+++ b/docs/packaged-staging.xml
@@ -155,6 +155,110 @@ STAGING_BASEDIR = "${STAGING_LIBDIR}/.."
</screen>
</para>
</section>
+
+
+<section>
+ <title>Handing native packages</title>
+<para>
+
+In its current state OE doesn't package the native packages it generates, so we'll have to write something that does:
+
+<screen>
+DEPLOY_DIR_PSTAGE = "${DEPLOY_DIR}/pstage"
+
+PSTAGE_BUILD_CMD = "${IPKGBUILDCMD}"
+PSTAGE_INSTALL_CMD = "ipkg-cl install -force-depends -f ${DEPLOY_DIR_PSTAGE}/ipkg.conf -o "
+PSTAGE_PKGNAME = "staging-${PN}_${PV}-${PR}_${PACKAGE_ARCH}.ipk"
+
+STAGING_BASEDIR = "${STAGING_LIBDIR}/.."
+
+do_stage_prepend() {
+
+#assemble appropriate ipkg.conf
+if [ -e ${DEPLOY_DIR_PSTAGE}/ipkg.conf ]; then
+ rm ${DEPLOY_DIR_PSTAGE}/ipkg.conf
+fi
+
+ipkgarchs="${BUILD_ARCH} all any noarch ${TARGET_ARCH} ${IPKG_ARCHS} ${IPKG_EXTRA_ARCHS} ${MACHINE}"
+ priority=1
+ for arch in $ipkgarchs; do
+ echo "arch $arch $priority" >> ${DEPLOY_DIR_PSTAGE}/ipkg.conf
+ priority=$(expr $priority + 5)
+ done
+echo "src oe file:${DEPLOY_DIR_IPK}" >> ${DEPLOY_DIR_PSTAGE}/ipkg.conf
+export OLD_PWD=`pwd`
+cd ${DEPLOY_DIR_IPK} &amp;&amp; rm *${BUILD_ARCH}.ipk -f ; ipkg-make-index -p Packages . ; cd ${OLD_PWD}
+${PSTAGE_UPDATE_CMD} ${STAGING_BASEDIR}
+
+if [ ${PN} != "glibc-intermediate" ] ; then
+
+ if [ -e ${DEPLOY_DIR_PSTAGE}/${PCROSS_PKGNAME} ]; then
+ oenote "Cross stuff already packaged, using that instead"
+ ${PSTAGE_INSTALL_CMD} ${CROSS_DIR} ${DEPLOY_DIR_PSTAGE}/${PCROSS_PKGNAME}
+ fi
+
+ if [ -e ${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGNAME} ]; then
+ oenote "Staging stuff already packaged, using that instead"
+ ${PSTAGE_INSTALL_CMD} ${STAGING_DIR} ${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGNAME}
+ exit 0
+ fi
+
+ touch ${TMPDIR}/moved-staging
+ mv ${STAGING_DIR} ${TMPDIR}/pstage
+
+ if [ -e ${CROSS_DIR} ]; then
+ mv ${CROSS_DIR} ${TMPDIR}/pcross
+ touch ${TMPDIR}/moved-cross
+ fi
+
+ mkdir -p ${STAGING_BINDIR}
+ mkdir -p ${STAGING_LIBDIR}
+ mkdir -p ${STAGING_INCDIR}
+ mkdir -p ${STAGING_DATADIR}/aclocal
+else
+ oenote "Glibc-intermediate detected!"
+fi #if !glibc intermediate
+}
+</screen>
+
+The above gets prepended to the do_stage() method specified in the recipe. I works by rotating away the staging dir so the next step can easily find the added files:
+
+<screen>
+do_stage_append() {
+
+if [ ${PN} != "glibc-intermediate" ] ; then
+ mkdir -p ${DEPLOY_DIR_PSTAGE}
+
+ #make a package for staging
+ mkdir -p ${STAGING_DIR}/CONTROL
+
+ echo "Package: staging-${PN}" > ${STAGING_DIR}/CONTROL/control
+ echo "Version: ${PV}-${PR}" >> ${STAGING_DIR}/CONTROL/control
+ echo "Description: ${DESCRIPTION}" >> ${STAGING_DIR}/CONTROL/control
+ echo "Section: ${SECTION}" >> ${STAGING_DIR}/CONTROL/control
+ echo "Priority: Optional" >> ${STAGING_DIR}/CONTROL/control
+ echo "Maintainer: ${MAINTAINER}" >> ${STAGING_DIR}/CONTROL/control
+ echo "Architecture: ${PACKAGE_ARCH}" >> ${STAGING_DIR}/CONTROL/control
+ echo "Source: ${SRC_URI}" >> ${STAGING_DIR}/CONTROL/control
+
+ ${PSTAGE_BUILD_CMD} ${STAGING_DIR} ${DEPLOY_DIR_PSTAGE}
+ rm -rf ${STAGING_DIR}
+ #move back stagingdir so we can install packages
+ mv ${TMPDIR}/pstage ${STAGING_DIR}
+ rm ${TMPDIR}/moved-staging
+
+ ${PSTAGE_INSTALL_CMD} ${STAGING_DIR} ${DEPLOY_DIR_PSTAGE}/${PSTAGE_PKGNAME}
+else
+ oenote "Glibc-intermediate detected (again)"
+fi #if !glibc-intermediate
+}
+</screen>
+
+
+</para>
+</section>
+
+
</chapter>
<chapter>