mraa
mraa copied to clipboard
CMakeLists.txt: Provide libmraa rpm packaging support
Yocto recipes manage all packages as RPMs. This patch enables rpm packaging for libmraa that can be used in the Yocto flow.
Signed-off-by: Sai Hari Chandana Kalluri [email protected]
Thanks for the PR! I am not a big user of Yocto but would you not normally package using 'make install' /install target from CMake then the Yocto/Bitbake stage handle the RPM creation?
@tingleby The do_install task in bitbake copies the built files along with their hierarchy to locations that would mirror their locations on the target device. The installation process copies files from the work and build directories to the ${D} directory to create the structure as it should appear on the target system.
For the software to be installed correctly, it depends on how the software is built and the build system being used. If the Yocto recipe builds using Autotools or CMake, the Yocto OpenEmbedded build system understands how to install the software. Consequently, you do not have to have a do_install task as part of your recipe. However, if you wish to install additional files not already being installed by make install, you should do this using a do_install_append function using the install command.
In short, Yocto thinks that libmraa which uses CMake already creates the RPMs. If the lines of code from the PR are not included, the RPMs will not be created in the Yocto flow.
Cpack isn't used in the cmake bbclass? Why would any of these change anything?
In short, Yocto thinks that libmraa which uses CMake already creates the RPMs. If the lines of code from the PR are not included, the RPMs will not be created in the Yocto flow.
@ckalluri, that's a bit strange, at least with the opkg packages (and to the best of my recollection DEB/RPM as well, though it's a bit fuzzier) nothing additional was ever necessary. My understanding that it's namely as @tingleby described, Yocto creates RPMs on its own, not relying on the application's CMake targets beyond install
, by doing the install
and then collecting and packaging the produced files and dirs. Which Yocto version do you have and what mraa recipe(s) do you use?
ADDED LATER: I've just specifically checked the cmake.bbclass
on Thud (but looking at git history for the file, the logic hasn't really changed in years) and it runs through configure, compile and install, doesn't really use the CMake's RPM generation facilities. So I'd presume you have some specifics in your Yocto environment causing the need for those changes?
Yeah it would seem what Id assume from experience with Debian packaging, using the Debian tool-set that the project itself doesn't need to be aware of Distro packaging.
I did a quick build of Poky and using the mraa recipe from meta-oe/recipes-extended/mraa
I was able to get several RPMS from it :/
Okay, thanks Tom. @ckalluri, please clarify why you need this, otherwise I'd personally be inclined to reject this for no good justification.