2

I'm trying to edit a spec file which always fails when I try to install it on other computer using RPM. I'm using CentOS. Here is the error.

error: Failed dependencies:
perl(ActsUtil) is needed by my_program
perl(ParseBishop) is needed by my_program

Both these 2 files are dependencies for the RPM. The thing is, these 2 files are actually provided inside the RPM package. Both these files are .pm file and located inside /opt/mysoftware/bin. I know it can be solved using rpm - ivh --nodeps mysoftware. But I don't prefer to use that method. So, I tried fixing the spec file. Here are some of the code that I've tried.

1st try

Summary:....
Name:..
Version:..
....
....
Provides: perl(ParseBishop), perl(ActsUtil)
...
...
%install
...
...
%changelog

2nd try

Summary:....
Name:..
Version:..
....
....
Provides: ParseBishop, ActsUtil
...
...
%install
...
...
%changelog

3rd try

Summary:....
Name:..
Version:..
....
....
Provides: ParseBishop.pm, ActsUtil.pm
...
...
%install
...
...
%changelog

4th try

Summary:....
Name:..
Version:..
....
....
Provides: /opt/mysoftware/bin/ParseBishop, /opt/mysoftware/bin/ActsUtil
...
...
%install
...
...
%changelog

Am I doing the "Provides" command wrong? Or my approach in solving the issue is already wrong?

  • You may try adding AutoReq: 0, Autoprov: 0 to disable dependency requirements and removing both Requires: depend1, Provides: depend1 lines. Ref: rpm5.org/docs/api/specfile.html P.S. I haven't test it before. – Ivan Chau Oct 24 '13 at 6:47
  • @MohdFikrie If you have found the solution, please consider answering your own question and marking the answer accepted. – Joseph R. Oct 24 '13 at 12:49
1

I have found the solution. The problem was my Provides are in the wrong area. It is suppose to be at the top of the code.

Summary:....
Name:..
Version:..
Provides: perl(ParseBishop), perl(ActsUtil)
...
...
%install
...
...
%changelog

To verify this. I have used rpm -qp --provides mysoftware.rpm inside the built folder. It will display what are provided from my packages.Thanks for all the help.

0
rpm -i --nodeps my_program.rpm

would skip any dependency prolems.

  • Yes..it can be run with that. But I prefer not to use that command. I would like to fix the .spec file instead. – Mohd Fikrie Oct 24 '13 at 6:13
  • It's still a working command, but allright, see you found the solution using what you wanted in the comments – PMint Oct 24 '13 at 12:51
0

PreReq?

I wonder if you need to list them as PreReqs?

Prereqs are different from requires only in that a PreReq is guaranteed to be installed before the package that contains the PreReq. PreReq's are used only to order packages, otherwise PreReq's are exactly the same as a Requires: dependency.

source: http://rpm5.org/docs/api/dependencies.html

Example

PreReq: perl(ActsUtil), perl(ParseBishop)

Requires

If those Perl modules are in fact required for this RPM to install then wouldn't they need to be on the Requires line and not Provides?

Example

Requires: perl(ParseBishop), perl(ActsUtil)

Just files?

If they're just .pm files that you're providing as part of the installation then these files shouldn't need to be listed anywhere except in in the RPMs install & manifest.

Other RPMs that depend on them would then just Require this RPM.

  • No its not. It is also needed after installation because some files are dependent on that file. Somehow the rpm cannot recognise the file is already provided inside the package. – Mohd Fikrie Oct 24 '13 at 8:04
  • @MohdFikrie - are the Perl modules actually in RPMs then or ar they just .pm files you're trying to include with this RPM? If they're just .pm files then you just need to include them in the installation manfiest, no? – slm Oct 24 '13 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.