summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-08-21 09:37:30 +0000
committerRichard Purdie <richard@openedhand.com>2007-08-21 09:37:30 +0000
commit48fd37f5f9f2907d2c6f5d547e8471b232eadc90 (patch)
tree44b13b0d5d4381cce7cab8edd62fdd817d97ac6d /meta/classes
parent005bf0112ced82ef5e98de4854c0fa749e52d4d6 (diff)
downloadpoky-48fd37f5f9f2907d2c6f5d547e8471b232eadc90.tar.gz
packaging: Split deb and ipk creation into separate tasks so changing the packaging type means the new type of packages are automatically generated.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2526 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/image.bbclass3
-rw-r--r--meta/classes/package.bbclass19
-rw-r--r--meta/classes/package_deb.bbclass17
-rw-r--r--meta/classes/package_ipk.bbclass16
-rw-r--r--meta/classes/package_rpm.bbclass18
-rw-r--r--meta/classes/package_tar.bbclass21
-rw-r--r--meta/classes/rootfs_deb.bbclass1
-rw-r--r--meta/classes/rootfs_ipk.bbclass1
8 files changed, 61 insertions, 35 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index ec08017cd1..517868ed3e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -8,8 +8,7 @@ export IMAGE_BASENAME = "${PN}"
8export PACKAGE_INSTALL = "${IMAGE_INSTALL}" 8export PACKAGE_INSTALL = "${IMAGE_INSTALL}"
9 9
10# We need to recursively follow RDEPENDS and RRECOMMENDS for images 10# We need to recursively follow RDEPENDS and RRECOMMENDS for images
11BUILD_ALL_DEPS = "1" 11do_rootfs[recrdeptask] += "do_deploy do_populate_staging"
12do_rootfs[recrdeptask] = "do_package_write do_deploy do_populate_staging"
13 12
14# Images are generally built explicitly, do not need to be part of world. 13# Images are generally built explicitly, do not need to be part of world.
15EXCLUDE_FROM_WORLD = "1" 14EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 6c25b0d7de..e1a7d91a9e 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -126,11 +126,6 @@ python () {
126 deps += " %s:do_populate_staging" % dep 126 deps += " %s:do_populate_staging" % dep
127 bb.data.setVarFlag('do_package', 'depends', deps, d) 127 bb.data.setVarFlag('do_package', 'depends', deps, d)
128 128
129 deps = bb.data.getVarFlag('do_package_write', 'depends', d) or ""
130 for dep in (bb.data.getVar('PACKAGE_EXTRA_DEPENDS', d, True) or "").split():
131 deps += " %s:do_populate_staging" % dep
132 bb.data.setVarFlag('do_package_write', 'depends', deps, d)
133
134 # shlibs requires any DEPENDS to have already packaged for the *.list files 129 # shlibs requires any DEPENDS to have already packaged for the *.list files
135 bb.data.setVarFlag('do_package', 'deptask', 'do_package', d) 130 bb.data.setVarFlag('do_package', 'deptask', 'do_package', d)
136} 131}
@@ -902,19 +897,7 @@ do_package[dirs] = "${D}"
902addtask package before do_build after do_install 897addtask package before do_build after do_install
903 898
904 899
905 900EXPORT_FUNCTIONS do_package
906PACKAGE_WRITE_FUNCS ?= "read_subpackage_metadata"
907
908python package_do_package_write () {
909 for f in (bb.data.getVar('PACKAGE_WRITE_FUNCS', d, 1) or '').split():
910 bb.build.exec_func(f, d)
911}
912do_package_write[dirs] = "${D}"
913addtask package_write before do_build after do_package
914
915
916EXPORT_FUNCTIONS do_package do_package_write
917
918 901
919# 902#
920# Helper functions for the package writing classes 903# Helper functions for the package writing classes
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 9a8db4f8f2..c5452475c4 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -4,11 +4,8 @@
4 4
5inherit package 5inherit package
6 6
7PACKAGE_EXTRA_DEPENDS += "dpkg-native fakeroot-native"
8
9BOOTSTRAP_EXTRA_RDEPENDS += "dpkg" 7BOOTSTRAP_EXTRA_RDEPENDS += "dpkg"
10DISTRO_EXTRA_RDEPENDS += "dpkg" 8DISTRO_EXTRA_RDEPENDS += "dpkg"
11PACKAGE_WRITE_FUNCS += "do_package_deb"
12IMAGE_PKGTYPE ?= "deb" 9IMAGE_PKGTYPE ?= "deb"
13 10
14python package_deb_fn () { 11python package_deb_fn () {
@@ -248,3 +245,17 @@ python do_package_deb () {
248 pass 245 pass
249 del localdata 246 del localdata
250} 247}
248
249python () {
250 import bb
251 if bb.data.getVar('PACKAGES', d, True) != '':
252 bb.data.setVarFlag('do_package_write_deb', 'depends', 'dpkg-native:do_populate_staging fakeroot-native:do_populate_staging', d)
253}
254
255python do_package_write_deb () {
256 bb.build.exec_func("read_subpackage_metadata", d)
257 bb.build.exec_func("do_package_deb", d)
258}
259do_package_write_deb[dirs] = "${D}"
260addtask package_write_deb before do_build after do_package
261
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 0cdd941f41..2c75cd1838 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -1,10 +1,7 @@
1inherit package 1inherit package
2 2
3PACKAGE_EXTRA_DEPENDS += "ipkg-utils-native fakeroot-native"
4
5BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" 3BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
6DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" 4DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
7PACKAGE_WRITE_FUNCS += "do_package_ipk"
8IMAGE_PKGTYPE ?= "ipk" 5IMAGE_PKGTYPE ?= "ipk"
9 6
10python package_ipk_fn () { 7python package_ipk_fn () {
@@ -242,3 +239,16 @@ python do_package_ipk () {
242 pass 239 pass
243 del localdata 240 del localdata
244} 241}
242
243python () {
244 import bb
245 if bb.data.getVar('PACKAGES', d, True) != '':
246 bb.data.setVarFlag('do_package_write_ipk', 'depends', 'ipkg-utils-native:do_populate_staging fakeroot-native:do_populate_staging', d)
247}
248
249python do_package_write_ipk () {
250 bb.build.exec_func("read_subpackage_metadata", d)
251 bb.build.exec_func("do_package_ipk", d)
252}
253do_package_write_ipk[dirs] = "${D}"
254addtask package_write_ipk before do_build after do_package
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 4955792916..7fc5e8ea96 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -2,7 +2,6 @@ inherit package
2inherit rpm_core 2inherit rpm_core
3 3
4RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}" 4RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}"
5PACKAGE_WRITE_FUNCS += "do_package_rpm"
6IMAGE_PKGTYPE ?= "rpm" 5IMAGE_PKGTYPE ?= "rpm"
7 6
8python write_specfile() { 7python write_specfile() {
@@ -54,7 +53,6 @@ python write_specfile() {
54 except OSError: 53 except OSError:
55 raise bb.build.FuncFailed("unable to open spec file for writing.") 54 raise bb.build.FuncFailed("unable to open spec file for writing.")
56 55
57# fd = sys.__stdout__
58 fd = specfile 56 fd = specfile
59 for var in out_vartranslate.keys(): 57 for var in out_vartranslate.keys():
60 if out_vartranslate[var][0] == "%": 58 if out_vartranslate[var][0] == "%":
@@ -123,7 +121,7 @@ python do_package_rpm () {
123 bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata) 121 bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata)
124 122
125 bb.data.update_data(localdata) 123 bb.data.update_data(localdata)
126# stuff 124
127 root = bb.data.getVar('ROOT', localdata) 125 root = bb.data.getVar('ROOT', localdata)
128 basedir = os.path.dirname(root) 126 basedir = os.path.dirname(root)
129 pkgoutdir = outdir 127 pkgoutdir = outdir
@@ -132,3 +130,17 @@ python do_package_rpm () {
132 bb.build.exec_func('write_specfile', localdata) 130 bb.build.exec_func('write_specfile', localdata)
133 del localdata 131 del localdata
134} 132}
133
134python () {
135 import bb
136 if bb.data.getVar('PACKAGES', d, True) != '':
137 bb.data.setVarFlag('do_package_write_rpm', 'depends', 'rpm-native:do_populate_staging', d)
138}
139
140
141python do_package_write_rpm () {
142 bb.build.exec_func("read_subpackage_metadata", d)
143 bb.build.exec_func("do_package_rpm", d)
144}
145do_package_write_rpm[dirs] = "${D}"
146addtask package_write_rpm before do_build after do_package
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass
index 17216a86f4..cb4c42b261 100644
--- a/meta/classes/package_tar.bbclass
+++ b/meta/classes/package_tar.bbclass
@@ -1,8 +1,5 @@
1inherit package 1inherit package
2 2
3PACKAGE_EXTRA_DEPENDS += "tar-native"
4
5PACKAGE_WRITE_FUNCS += "do_package_tar"
6IMAGE_PKGTYPE ?= "tar" 3IMAGE_PKGTYPE ?= "tar"
7 4
8python package_tar_fn () { 5python package_tar_fn () {
@@ -78,7 +75,7 @@ python do_package_tar () {
78 bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata) 75 bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata)
79 76
80 bb.data.update_data(localdata) 77 bb.data.update_data(localdata)
81# stuff 78
82 root = bb.data.getVar('ROOT', localdata) 79 root = bb.data.getVar('ROOT', localdata)
83 bb.mkdirhier(root) 80 bb.mkdirhier(root)
84 basedir = os.path.dirname(root) 81 basedir = os.path.dirname(root)
@@ -97,6 +94,18 @@ python do_package_tar () {
97 ret = os.system("tar -czvf %s %s" % (tarfn, '.')) 94 ret = os.system("tar -czvf %s %s" % (tarfn, '.'))
98 if ret != 0: 95 if ret != 0:
99 bb.error("Creation of tar %s failed." % tarfn) 96 bb.error("Creation of tar %s failed." % tarfn)
100# end stuff
101 del localdata
102} 97}
98
99python () {
100 import bb
101 if bb.data.getVar('PACKAGES', d, True) != '':
102 bb.data.setVarFlag('do_package_write_tar', 'depends', 'tar-native:do_populate_staging', d)
103}
104
105
106python do_package_write_tar () {
107 bb.build.exec_func("read_subpackage_metadata", d)
108 bb.build.exec_func("do_package_tar", d)
109}
110do_package_write_tar[dirs] = "${D}"
111addtask package_write_tar before do_build after do_package
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 55dad6679a..6d405d2f51 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -3,6 +3,7 @@
3# 3#
4 4
5do_rootfs[depends] += "dpkg-native:do_populate_staging apt-native:do_populate_staging" 5do_rootfs[depends] += "dpkg-native:do_populate_staging apt-native:do_populate_staging"
6do_rootfs[recrdeptask] += "do_package_write_deb"
6 7
7fakeroot rootfs_deb_do_rootfs () { 8fakeroot rootfs_deb_do_rootfs () {
8 set +e 9 set +e
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 89c35ab85b..c58b547742 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -6,6 +6,7 @@
6# 6#
7 7
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"
9 10
10IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" 11IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}"
11 12