[yocto] How to handle src.rpm packages
Christian Ege
chege at cybertux.de
Sat Dec 1 06:00:34 PST 2012
Hi,
I think src rpms are not that interesting stuff for a lot of you. I've
fixed this by my own by adding a class to my meta-stlinux layer which
handles the extra sources and patches within the *.src.rpm.
The idea was taken from the lsof package.
LOCAL_SRC ??= ""
def src_rpm_do_base(d,func):
bb.build.exec_func(func, d)
src_uri = d.getVar('SRC_URI')
d.setVar('SRC_URI', '${LOCAL_SRC}')
bb.build.exec_func(func, d)
d.setVar('SRC_URI', src_uri)
python do_unpack () {
src_rpm_do_base(d,'base_do_unpack')
}
python do_patch () {
src_rpm_do_base(d,'base_d
}
https://github.com/project-magpie/meta-stlinux/blob/master/classes/src_rpm.bbclass
I hope this is the way things like this should be handled.
regards,
Christian
> Hello,
>
> I am interested in how to handle source code inside of a src.rpm
> package. There had been a patch from Mark Hatle which handles the rpm
> packages inside the fetcher2. In his patch he suggests to handle
> Patches inside the rpm in the following way:
>
>
> file://${WORKDIR}/mypatch.patch
>
> When I tried this inside the SRC_URI declaration I always get en error
> like this:
>
> NOTE: Running task 439 of 669 (ID: 4,
> /home/chris/src/poky-denzil/meta-stlinux/recipes-core/stslave/stslave_0.7.bb,
> do_fetch)
> NOTE: package stslave-0.7-r1: task do_fetch: Started
> ERROR: Function failed: Fetcher failure for URL:
> 'file:///home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz'.
> Unable to fetch URL from any source.
> ERROR: Logfile of failure stored in:
> /home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/temp/log.do_fetch.25817
> Log data follows:
> | DEBUG: Trying PREMIRRORS
> | DEBUG: For url ['file', '',
> '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz',
> '', '', {}] comparing ['bzr', '.*', '/.*', '', '', {}] to ['http',
> 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
> | DEBUG: For url ['file', '',
> '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz',
> '', '', {}] comparing ['cvs', '.*', '/.*', '', '', {}] to ['http',
> 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
> | DEBUG: For url ['file', '',
> '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz',
> '', '', {}] comparing ['git', '.*', '/.*', '', '', {}] to ['http',
> 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
> | DEBUG: For url ['file', '',
> '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz',
> '', '', {}] comparing ['hg', '.*', '/.*', '', '', {}] to ['http',
> 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
> | DEBUG: For url ['file', '',
> '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz',
> '', '', {}] comparing ['osc', '.*', '/.*', '', '', {}] to ['http',
> 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
> | DEBUG: For url ['file', '',
> '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz',
> '', '', {}] comparing ['p4', '.*', '/.*', '', '', {}] to ['http',
> 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
> | DEBUG: For url ['file', '',
> '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz',
> '', '', {}] comparing ['svk', '.*', '/.*', '', '', {}] to ['http',
> 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
> | DEBUG: For url ['file', '',
> '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz',
> '', '', {}] comparing ['svn', '.*', '/.*', '', '', {}] to ['http',
> 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
> | DEBUG: Trying Upstream
> | ERROR: Function failed: Fetcher failure for URL:
> 'file:///home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz'.
> Unable to fetch URL from any source.
>
> Yes of course I can just let fetcher2 extract all the files an
> afterwards apply the patches by hand. But I think there should be a
> more generic way to handle this. I hope I can get some hints how to
> solve this.
>
>
>
>
> with kind regards,
>
> Christian
>
>
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
--
~: https://github.com/project-magpie/meta-stlinux :~
More information about the yocto
mailing list