4

I am making a package for RHEL7. When I try to install the package, I get

# yum localinstall mypackage-0.0-1.el7.rpm 
(...)
--> Running transaction check
---> Package webmin-GPI-init.noarch 0:0.0-1.el7 will be installed
--> Processing Dependency: perl(.::guardian-lib.pl) for package: webmin-GPI-init-0.0-1.el7.noarch
--> Processing Dependency: perl(.::hostconfig-lib.pl) for package: webmin-GPI-init-0.0-1.el7.noarch
--> Processing Dependency: perl(.::init-lib.pl) for package: webmin-GPI-init-0.0-1.el7.noarch

I have in mind that willing to get a perl module named .::init-lib.pl is not desirable. In the code, we can find something like

#! /usr/bin/perl
require './init-lib.pl';
require './guardian-lib.pl'; 
require './hostconfig-lib.pl';

I have managed to remove the win32 with the following option in my .spec file :

%{?perl_default_filter}
%global __requires_exclude perl\\(VMS|perl\\(Win32|perl\\(\\.

How can I get rid of the dependencies regarding the perl packages that start by a dot?

I have browsed the Internet and found https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering and other mailing lists I have not understood.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
MUY Belgium
  • 1,234
  • 2
  • 14
  • 31
  • Also, I just found https://stackoverflow.com/questions/7715955/how-can-i-rebuild-rpm-package-exclude-some-dependencies which enables to disable totally this functionality. This is a bit overkill, but enables the package to be installed. – MUY Belgium Sep 16 '16 at 16:26
  • Do you have a link to the source RPM? In some fooling around I cannot get a test RPM to generate `./foo.pl` provides or requires as yours is. – thrig Sep 16 '16 at 18:07
  • I do not think that generating pseudo/void dependencies is the answer, it is a programming trick. I do think that not to generate stupid dependencies is a good answer. – MUY Belgium Sep 17 '16 at 17:14
  • coded, not checked, but I think `%global __requires_exclude perl\\((VMS|Win32|\\..*)\\)` might be very close to what you want [though not sure from your question why VMS or Win32 are in your proposed regex at all] – Chaim Geretz Jun 19 '19 at 20:30

2 Answers2

5

rpmbuild analyses the content of your rpm package to automatically determine what is required for your program to work. If you use certain perl modules; those need to be installed for your program to work.

However, if you don't want rpm to do all that work for you; you can add

AutoReqProv : no

to your spec file. For more information; read this

Chris Maes
  • 3,282
  • 3
  • 21
  • 32
3

Why not use:

%define __requires_exclude ^perl(\s|)\(.*\)$
jbrios777
  • 41
  • 2