How to make bitbake to generate .deb packages - yocto

Bitbake by default generates .rpm files,
But unfortunately .rpm files do not work on debian or ubuntu systems.
How to make bitbake to generate .deb files directly?

First, you can't assume that you'll be able to use your bitbake:ed deb-packages in your regular Debian or Ubuntu system anyway.
Now, the Poky reference distribution (of the Yocto Project), which is what I assume you're using (due to your yocto tag), do default to rpm.
Set PACKAGE_CLASSES in conf/local.conf or preferably, in your own distro config to:
PACKAGE_CLASSES = "package_deb"
This will configure your build to use deb-packages. (The other options are package_ipk or package_rpm.

Related

Yocto check which packages are installed on target system

I have a Yocto system where I'm running some Chef InSpec scans. Chef InSpec offers a command to check if a package is installed, however, that doesn't work with Yocto (I imagine it would if you'd install a package manager, but I don't want to do that). What would be the best way to check if a certain package is installed on the system?
I know that bitbake can show every package that would be in the built image, but I need to check on the target system. Is there a way I can get this information from bitbake from within a recipe that would just route the output into a file on the rootfs? Or is there a better approach without installing a package manager on the target system?
Inside the folder tmp/deploy/images/$MACHINE/${IMAGE}/
You should see a file named with manifest extension. It is often named like this : [image-name]-[image-version].manifest"
In this file you will find all packages that are present in your linux image built with Yocto, so packages that will be deployed in your target.

How can I configure rpmbuild to use lib64/perl5 as an install path?

I am running CentOS7 (RHEL7) and I am trying to build a Perl module with rpmbuild. I have generated the SPEC file and it builds all the way until it installs, which fails.
error: File not found by glob: /home/user/rpm/BUILDROOT/perl-Data-Dumper-2.167_02-1.el7.centos.x86_64/usr/lib64/perl5/vendor_perl/auto/*
I see that in the .spec file, it is looking for %{perl_vendorarch}/auto/* so it's looking in the right place (same place that yum installs pre-built rpms for perl modules.)
HOWEVER, when doing the install phase, it seems rpmbuild is trying to use (via the MakeMaker generated Makefile) my PERL5LIB /home/user/perl5/lib/perl5. I can change the INSTALL_DIR via the spec to /usr, however, I can't figure out how to change the suffix to lib/perl5
Is there anyway to tell MakeMaker to use a different suffix?

centos updating system rpm

Hello I still new to this creating rpm from tar files but is it safe to create newer versions for linking lib tiff etc or would this break any other rpm that requires lib tiff or lib png as I would like to manage my own repo if possible but keeping it running latest versions as centos 6.6 uses old packages
You just need to version that library. See
https://fedoraproject.org/wiki/Packaging:Guidelines#Downstream_.so_name_versioning
Then rpmbuild correctly generate version for Provides and as far as it does not conflict with other requires of other installed packages, you can install it.

How to build gstreamer ugly plugins from source

I would like to change some code in one element X in gstreamer ugly plugin and rebuild and use it.
How I can do it?
I have gstreamer-0.10 and installed gstreamer-ugly plugin.
I would like to download only gstreamer0-10 ugly plugin code and change it and would like to use the new lib file. How I can do it?
unfortunately gstreamer-ugly depends on a lot of stuff in at least libgstreamer and plugins-base (if you're using linux and your distro provides *-dev packages as debian/ubuntu does).
If you're on debian you could use dpkg-buildpackage after checking out the source using apt-source. The big advantage here is that all the build dependencies can be easily installed.
The manual way will probably need you to first build all the other gstreamer packages have a close look on what ./configure tells you
I'm workin on debian and have already built gstreamer+plugins to backport the recent ones to ubuntu (although I'm not sure if I did it in a best-practice way ;) )
/edit: I'll try to cover the basic steps for ubuntu here:
add the source repositories to apt (check the "source code" checkbox in the ubuntu software center's "software sources" tool
sudo apt-get install dpkg-dev devscripts
sudo apt-get build-dep gst-plugins-ugly0.10
apt-get source gst-plugins-ugly0.10
change to the newly created gst-plugins-base* folder
dpkg-buildpackage (and make sure it works)
change the source to your needs
you can rebuild it any time using dpkg-buildpackage (to simply see if it compiles make might be faster though). This creates a .deb file in the parent folder that you can simply install using dpkg -i
If it's a useful change you might want to get in touch with the gstreamer-devs ;)
On a debian system, run apt-get build-dep gstreamer0.10-plugins-ugly to get all the build dependencies for that package. After that you can build the package from git, source tarball or even rebuild the debian package (using dkgp-buildpackage).

Preventing hardcode path in RPM SPEC file

I am creating rpm for apc. While writing spec file, I realized that some commands may have path which can keep on changing which are required during the compilation time. For eg. these commands are required to be executed during the building time.
$ /usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config
But the complete path of phpize and php-config file may change. So how can i prevent this dependencies so that i should not hard-code these path in my spec file.
Because these commands are used at building time, the ideal solution to this problem is here:
Find packages on distribution which provide these commands or paths e.g php-config is provided by php-devel package on Fedora operating system. In fedora you can find it using yum whatprovides "*/php-config" or if they are already installed on system then using rpm -qf /path/to/command.
Once you know the packages add them as BuildRequire tag in spec file. Step 2 will make sure that paths are always present whenever you build the package from spec file even if you use hard coded paths (which isn't ofcourse best way to do it).
In place of /usr/ you can use %{_prefix}, it depends entirely on macros available on distribution you are building this rpm on. Check macro files for path macros. One link which has common macro definitions is here.