Fmstrat
Fmstrat

Reputation: 1692

RPM "Requires" is ignored

Can anyone tell me why when I try to install an RPM built with this spec file the "Requires" section is ignored?

Name:           test
Version:        1.1
Release:        0
Summary:        Test
Packager:       Author
Group:          Application/Other
License:        GPL
URL:            https://url.com
Source0:        %{name}-%{version}.tar.gz
BuildArch:      noarch
Requires:       bash ncurses which jq curl tar

%description
This is a description

%prep
%setup -q

%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/bin
cp scripts/* $RPM_BUILD_ROOT/usr/bin/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
# %dir /usr/bin
/usr/bin/mybin
%doc

When I do a yum install ./myrpm.rpm it only installs the local RPM, it doesn't require any of the dependencies specified in the spec. I've tried commas, different lines, and adding in Autoreq: no, too.

Upvotes: 0

Views: 1028

Answers (1)

Chris Maes
Chris Maes

Reputation: 37832

as @danilavershinin said in a comment: if those dependencies are already satisfied by packages installed on your system, nothing needs to be installed. To check this, you can run:

rpm -q --whatprovides bash

to query which package satisfies that dependency (same for all your other dependencies).

Commas, spaces or newlines don't really change the behavior.

AutoReq is something different however: suppose you package a perl script, then rpmbuild will automatically add a dependency on perl.

Upvotes: 1

Related Questions