summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-09-01 22:17:06 +0000
committerRichard Purdie <richard@openedhand.com>2007-09-01 22:17:06 +0000
commitc6938aad87ce4b9ce25ecd020ecddfe62b319bcf (patch)
treebf38fd54cc10deb22025853094b3e33c4043d1b2 /meta/classes
parenta7c63ec4828e08e0812f69a5be04422e5dd7b30a (diff)
downloadpoky-c6938aad87ce4b9ce25ecd020ecddfe62b319bcf.tar.gz
Factor ipkg index and conf file creation into package_ipk.bbclass
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2637 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/meta.bbclass4
-rw-r--r--meta/classes/package_ipk.bbclass44
-rw-r--r--meta/classes/rootfs_ipk.bbclass35
-rw-r--r--meta/classes/task.bbclass27
4 files changed, 80 insertions, 30 deletions
diff --git a/meta/classes/meta.bbclass b/meta/classes/meta.bbclass
new file mode 100644
index 0000000000..d35c40bccd
--- /dev/null
+++ b/meta/classes/meta.bbclass
@@ -0,0 +1,4 @@
1
2PACKAGES = ""
3
4do_build[recrdeptask] = "do_build" \ No newline at end of file
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index d88d11b994..1175d1e751 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -4,6 +4,9 @@ BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
4DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" 4DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
5IMAGE_PKGTYPE ?= "ipk" 5IMAGE_PKGTYPE ?= "ipk"
6 6
7IPKGCONF_TARGET = "${STAGING_ETCDIR_NATIVE}/ipkg.conf"
8IPKGCONF_SDK = "${STAGING_ETCDIR_NATIVE}/ipkg-sdk.conf"
9
7python package_ipk_fn () { 10python package_ipk_fn () {
8 from bb import data 11 from bb import data
9 bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) 12 bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d)
@@ -60,6 +63,47 @@ python package_ipk_install () {
60 raise bb.build.FuncFailed 63 raise bb.build.FuncFailed
61} 64}
62 65
66#
67# Update the Packages index files in ${DEPLOY_DIR_IPK}
68#
69package_update_index_ipk () {
70 set -x
71
72 ipkgarchs="${PACKAGE_ARCHS}"
73
74 if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then
75 return
76 fi
77
78 touch ${DEPLOY_DIR_IPK}/Packages
79 ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
80
81 for arch in $ipkgarchs; do
82 if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then
83 touch ${DEPLOY_DIR_IPK}/$arch/Packages
84 ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/
85 fi
86 done
87}
88
89#
90# Generate an ipkg conf file ${IPKGCONF_TARGET} suitable for use against
91# the target system and an ipkg conf file ${IPKGCONF_SDK} suitable for
92# use against the host system in sdk builds
93#
94package_generate_ipkg_conf () {
95 mkdir -p ${STAGING_ETCDIR_NATIVE}/
96 echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_TARGET}
97 echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_SDK}
98 ipkgarchs="${PACKAGE_ARCHS}"
99 priority=1
100 for arch in $ipkgarchs; do
101 echo "arch $arch $priority" >> ${IPKGCONF_TARGET}
102 echo "arch ${BUILD_ARCH}-$arch-sdk $priority" >> ${IPKGCONF_SDK}
103 priority=$(expr $priority + 5)
104 done
105}
106
63python do_package_ipk () { 107python do_package_ipk () {
64 import sys, re, fcntl, copy 108 import sys, re, fcntl, copy
65 109
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 3709f89743..3c9d03f9dd 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -8,41 +8,16 @@
8do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" 8do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging"
9do_rootfs[recrdeptask] += "do_package_write_ipk" 9do_rootfs[recrdeptask] += "do_package_write_ipk"
10 10
11IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" 11IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS}"
12
13rootfs_ipk_do_indexes () {
14 set -x
15
16 ipkgarchs="${PACKAGE_ARCHS}"
17
18 if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
19 touch ${DEPLOY_DIR_IPK}/Packages
20 ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
21 fi
22
23 for arch in $ipkgarchs; do
24 if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then
25 if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then
26 touch ${DEPLOY_DIR_IPK}/$arch/Packages
27 ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/
28 fi
29 fi
30 done
31}
32 12
33fakeroot rootfs_ipk_do_rootfs () { 13fakeroot rootfs_ipk_do_rootfs () {
34 set -x 14 set -x
35 15
36 rootfs_ipk_do_indexes 16 package_update_index_ipk
17 package_generate_ipkg_conf
37 18
38 mkdir -p ${T} 19 mkdir -p ${T}
39 echo "src oe file:${DEPLOY_DIR_IPK}" > ${T}/ipkg.conf 20
40 ipkgarchs="${PACKAGE_ARCHS}"
41 priority=1
42 for arch in $ipkgarchs; do
43 echo "arch $arch $priority" >> ${T}/ipkg.conf
44 priority=$(expr $priority + 5)
45 done
46 ipkg-cl ${IPKG_ARGS} update 21 ipkg-cl ${IPKG_ARGS} update
47 if [ ! -z "${LINGUAS_INSTALL}" ]; then 22 if [ ! -z "${LINGUAS_INSTALL}" ]; then
48 ipkg-cl ${IPKG_ARGS} install glibc-localedata-i18n 23 ipkg-cl ${IPKG_ARGS} install glibc-localedata-i18n
@@ -58,7 +33,7 @@ fakeroot rootfs_ipk_do_rootfs () {
58 export OFFLINE_ROOT=${IMAGE_ROOTFS} 33 export OFFLINE_ROOT=${IMAGE_ROOTFS}
59 export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} 34 export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
60 mkdir -p ${IMAGE_ROOTFS}/etc/ipkg/ 35 mkdir -p ${IMAGE_ROOTFS}/etc/ipkg/
61 grep "^arch" ${T}/ipkg.conf >${IMAGE_ROOTFS}/etc/ipkg/arch.conf 36 grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/ipkg/arch.conf
62 37
63 for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.preinst; do 38 for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.preinst; do
64 if [ -f $i ] && ! sh $i; then 39 if [ -f $i ] && ! sh $i; then
diff --git a/meta/classes/task.bbclass b/meta/classes/task.bbclass
new file mode 100644
index 0000000000..4edd704829
--- /dev/null
+++ b/meta/classes/task.bbclass
@@ -0,0 +1,27 @@
1# Task packages are only used to pull in other packages
2# via their dependencies. They are empty.
3ALLOW_EMPTY = "1"
4
5# By default, only the task package itself is in PACKAGES.
6# -dbg and -dev flavours are handled by the anonfunc below.
7# This means that task recipes used to build multiple task
8# packages have to modify PACKAGES after inheriting task.bbclass.
9PACKAGES = "${PN}"
10
11# By default, task packages do not depend on a certain architecture.
12# Only if dependencies are modified by MACHINE_FEATURES, packages
13# need to be set to MACHINE_ARCH after inheriting task.bbclass
14PACKAGE_ARCH = "all"
15
16# This automatically adds -dbg and -dev flavours of all PACKAGES
17# to the list. Their dependencies (RRECOMMENDS) are handled as usual
18# by package_depchains in a following step.
19python () {
20 packages = bb.data.getVar('PACKAGES', d, 1).split()
21 genpackages = []
22 for pkg in packages:
23 for postfix in ['-dbg', '-dev']:
24 genpackages.append(pkg+postfix)
25 bb.data.setVar('PACKAGES', ' '.join(packages+genpackages), d)
26}
27