PDA

View Full Version : Checking 'Requires' & 'BuildRequires'


pedrogfrancisco
30th September 2010, 02:31 PM
How can I check the 'Requires' & 'BuildRequires' ?
I'm trying to package kupfer and I believe the .spec I got from openSUSE's Build Service has extra dependencies. My idea is removing them and testing the .spec .

However, I don't want to uninstall packages so I'm thinking either using something like openSUSE's Build Service -- though I have yet to understand if there is an equivalent for Fedora or not -- or chrooting and installing only the needed packages.

Is there an easier way? An automated script or something?

PabloTwo
30th September 2010, 03:33 PM
Hello pedrogfrancisco, and welcome to the forum.

One of the primary reasons why rpm packages, or spec files, from other rpm based Linux distros are incompatible with Fedora is that many packages are "packaged" under different names. The "Requires" and "BuildRequires" in the spec file are there for a reason. The "Requires" are dependencies needed to install/run the completed program package. The "BuildRequires" are the programs, usually the *-devel packages, needed to compile the source code and build the rpm package.

There are generally several other reasons why spec files from other distros are not compatible for building packages for Fedora. It is, however, useful to use them as a rough guide to creating your Fedora compatible spec file. For the Build and BuildRequires stipulations that you can't find for Fedora, by name, then you have to figure out which name Fedora uses for that particular program. Sometimes it takes a bit of detective work. Just removing entries in the spec file and expecting to end up with a completed rpm package for Fedora is, well, silly. Regardless of which distro you are building for, you still must have all the requirements installed to actually compile the code.

I would suggest you start off with going to this page (https://fedoraproject.org/wiki/Category:Package_Maintainers) and following some of the links to get some further info on building rpm packages the "Fedora" way.

Yes, there is a build service for the Fedora Project, but I believe you have to be accepted and signed up as an official package maintainer to use it. But, you still have to provide a valid spec file applicable to Fedora. There is no "easy way" to build an rpm package for Fedora starting out with little or no knowledge of how to do so. You "have to learn" how.

pedrogfrancisco
30th September 2010, 04:16 PM

Hi!

My problem was that openSUSE spec has both `update-desktop-files' and `desktop-file-utils'. Now the former is for openSUSE and the latter for Fedora, according to http://www.rpm.org/wiki/Problems/Distributions. That means that either the .spec was overreaching or I may be missing something as a Dependency.

I thought it'd be easier to build a chroot and test the .spec than to investigate through manual digging.

What is your opinion about Mock (http://fedoraproject.org/wiki/Projects/Mock) for such purpose?

PabloTwo
30th September 2010, 08:19 PM
Well, you are correct in that Fedora does not have, or use either a package or file named "update-desktop-files", so that would not be a valid "Requires" in Fedora. I don't have any opinion on using Mock as I've never used it before.

I did a quick Google search on kupfer and also a search for rpm packages built for kupfer. The only rpm packages that showed up in my search was for Mandriva, and no .src.rpm files at that. I see that kupfer is a python program that depends on "waf", which must be compiled, whatever that is.

http://git.gnome.org/browse/kupfer/tree/README

Do you have the basic rpm packaging packages installed:

redhat-rpm-config
rpm-build
rpmdevtools
rpmlint

---------- Post added at 03:19 PM CDT ---------- Previous post was at 11:28 AM CDT ----------

I played with this some after downloading kupfer.spec and kupfer-v202.tar.gz from the openSuse project site. But researching further to try and find all the dependencies, I came across this (https://bugzilla.redhat.com/show_bug.cgi?id=597681), which you should find very helpful.

PabloTwo
2nd October 2010, 10:24 PM
Getting somewhat bored and with no new game to play on the PS3, I dived further into packaging kupfer-v202 for Fedora. This was one tough nut to crack, but I finally succeeded today. The principle problem came while running "waf configure --prefix=/usr". From the tarball file, when it checks for the gtk python module it finds it. Doing the same within an "rpmbuild -bb kupfer.spec" environment, it fails to find the gtk python module. There are several discussion threads on this that can be found on the internet.

I borrowed heavily from the openSuse spec file, but made several modifications. The rst2man file that the package tries to call upon just can't be found for Fedora (even the GIT repo for the source code for rst2man appears to be empty). But the *.rst files it wants to convert to man pages aren't really in a suitable format for the standard unix type man pages anyway. I included python-docutils as a BuildRequies in order to use rst2html, and the results are good. I packaged those into the %doc folder.

It was also necessary to create a patch file for the wscript file (from another discussion on this found on the web) which, in conjunction with using the "--no-runtime-deps" option on the "waf configure" line, gets around the "gtk python module not found" error which kills the build very early on. I in no way made an attempt to divvy up the massive amount of python files into a %{python_sitelib} type of installation. I have not installed or tested the results.

<insert edit here: Did more testing and found I didn't really need the patch file, so rebuilt without it.>

Fedora does not provide either python-keyring or python-keybinder. I was able to create an rpm package for python-keyring which worked and the kupfer build found it. I tried building from keybinder-0.2.2, which provides python-keybinder, but it demanded a higher version of gtk2+ than what I have on F12. I also manually installed files taken from two Mandriva rpms which should have satisfied the python-keybinder configuration check, but that didn't work for whatever reason.

kupfer-v202-1.fc12.noarch.rpm
kupfer-v202-1.fc12.src.rpm
BASH:~/-> rpm -qpl ./kupfer-v202-1.fc12.noarch.rpm | wc -l
528

If you're still interested in this, post back here and I'll post the spec file for you to use or I can upload the binary package for you to download.