diff options
author | Joshua Lock <josh@linux.intel.com> | 2010-08-05 10:52:10 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-19 20:06:25 +0100 |
commit | 0769e847cbefbbf2f083b7fc585a0479db6b18a1 (patch) | |
tree | 1913535866bd23de3d73a788aeb8f667108073ec /meta/classes/package_rpm.bbclass | |
parent | 14801197f97d33c715d387315c20fb4269b2fb91 (diff) | |
download | poky-0769e847cbefbbf2f083b7fc585a0479db6b18a1.tar.gz |
package_(deb|rpm): Update to use packaged-staging2
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index b829d0d068..273a7d44ed 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -1,7 +1,5 @@ | |||
1 | inherit package | 1 | inherit package |
2 | 2 | ||
3 | #IMAGE_PKGTYPE ?= "rpm" | ||
4 | |||
5 | IMAGE_PKGTYPE ?= "rpm" | 3 | IMAGE_PKGTYPE ?= "rpm" |
6 | 4 | ||
7 | RPMBUILDPATH="${WORKDIR}/rpm" | 5 | RPMBUILDPATH="${WORKDIR}/rpm" |
@@ -11,6 +9,8 @@ RPMBUILDOPTS="--target ${TARGET_SYS} --define '_topdir ${RPMBUILDPATH}' --buildr | |||
11 | RPM="${BUILD_ARCH}-${BUILD_OS}-rpm ${RPMOPTS}" | 9 | RPM="${BUILD_ARCH}-${BUILD_OS}-rpm ${RPMOPTS}" |
12 | RPMBUILD="${BUILD_ARCH}-${BUILD_OS}-rpmbuild --short-circuit ${RPMBUILDOPTS}" | 10 | RPMBUILD="${BUILD_ARCH}-${BUILD_OS}-rpmbuild --short-circuit ${RPMBUILDOPTS}" |
13 | 11 | ||
12 | PKGWRITEDIRRPM = ${WORKDIR}/deploy-rpms" | ||
13 | |||
14 | python write_specfile() { | 14 | python write_specfile() { |
15 | version = bb.data.getVar('PV', d, 1) | 15 | version = bb.data.getVar('PV', d, 1) |
16 | version = version.replace('-', '+') | 16 | version = version.replace('-', '+') |
@@ -136,7 +136,7 @@ python write_specfile() { | |||
136 | 136 | ||
137 | # move the rpm into the pkgoutdir | 137 | # move the rpm into the pkgoutdir |
138 | rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d) | 138 | rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d) |
139 | outrpm = bb.data.expand('${DEPLOY_DIR_RPM}/${PACKAGE_ARCH}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d) | 139 | outrpm = bb.data.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d) |
140 | bb.movefile(rpm, outrpm) | 140 | bb.movefile(rpm, outrpm) |
141 | } | 141 | } |
142 | 142 | ||
@@ -152,9 +152,9 @@ python do_package_rpm () { | |||
152 | bb.error("WORKDIR not defined, unable to package") | 152 | bb.error("WORKDIR not defined, unable to package") |
153 | return | 153 | return |
154 | 154 | ||
155 | outdir = bb.data.getVar('DEPLOY_DIR_RPM', d, 1) | 155 | outdir = bb.data.getVar('PKGWRITEDIRRPM', d, 1) |
156 | if not outdir: | 156 | if not outdir: |
157 | bb.error("DEPLOY_DIR_RPM not defined, unable to package") | 157 | bb.error("PKGWRITEDIRRPM not defined, unable to package") |
158 | return | 158 | return |
159 | bb.mkdirhier(outdir) | 159 | bb.mkdirhier(outdir) |
160 | 160 | ||
@@ -208,13 +208,21 @@ python () { | |||
208 | bb.data.setVarFlag('do_package_write_rpm', 'depends', " ".join(deps), d) | 208 | bb.data.setVarFlag('do_package_write_rpm', 'depends', " ".join(deps), d) |
209 | } | 209 | } |
210 | 210 | ||
211 | SSTATETASKS += "do_package_write_rpm" | ||
212 | do_package_write_rpm[sstate-name] = "deploy-rpm" | ||
213 | do_package_write_rpm[sstate-inputdirs] = "${PKGWRITEDIRRPM}" | ||
214 | do_package_write_rpm[sstate-outputdirs] = "${DEPLOY_DIR_RPM}" | ||
215 | |||
216 | python do_package_write_rpm_setscene () { | ||
217 | sstate_setscene(d) | ||
218 | } | ||
219 | addtask do_package_write_rpm_setscene | ||
211 | 220 | ||
212 | python do_package_write_rpm () { | 221 | python do_package_write_rpm () { |
213 | bb.build.exec_func("read_subpackage_metadata", d) | 222 | bb.build.exec_func("read_subpackage_metadata", d) |
214 | bb.build.exec_func("rpm_prep", d) | 223 | bb.build.exec_func("rpm_prep", d) |
215 | bb.build.exec_func("do_package_rpm", d) | 224 | bb.build.exec_func("do_package_rpm", d) |
216 | } | 225 | } |
217 | 226 | do_package_write_rpm[dirs] = "${PKGWRITEDIRRPM}" | |
218 | do_package_write_rpm[dirs] = "${D}" | ||
219 | addtask package_write_rpm before do_package_write after do_package | 227 | addtask package_write_rpm before do_package_write after do_package |
220 | 228 | ||