[SOLVED] build rpm spec file to install other rpm dependencies

Issues related to applications and software problems
Post Reply
User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

[SOLVED] build rpm spec file to install other rpm dependencies

Post by warron.french » 2018/01/06 09:02:29

I have successfully created my first two RPMs, using this link (https://www.theurbanpenguin.com/buildin ... entos-6-5/) and referencing others.

I would like, for academic purposes to have my RPM install another RPM as a dependency, but I cannot figure out what Tag to use in my spec file.

Can someone please provide me the appropriate syntax or the website that defines this succinctly? I don't know what search terms to put into Google, nothing has worked for me.

As a pre-empt, I tried both the BuildRequires and also the Requires tags to no avail.

This is the entirety of my SPEC file so far that has worked completely, other than the RPM dependency:

Code: Select all

Name:           wsf
Version:        1.0
Release:        0
Summary:        Another testrun on learning to develop an rpm; named wsf-1.0.x86_64.rpm.

Group:          Applications
License:        GPLv2+
URL:            http://rpm-files.french-family.com/wsf
Source0:        wsf-1.0.tar.gz
BuildArch:      x86_64
BuildRoot:      %{_tmppath}/%{name}-buildroot

%description
A simple RPM Build exercise.


Requires:  procmail


%prep
%setup -q


%install
mkdir -p "$RPM_BUILD_ROOT"
cp -R * "$RPM_BUILD_ROOT"

%clean
rm -rf "$RPM_BUILD_ROOT"


%files
%defattr(-,root,root,-)
/tmp/wsf-tmp.txt
/usr/bin/wsf-bin.tmp


%changelog
* Sat Jan 06 2018 Warron French <warron.french@gmail.com> - 1.0
- Created initial package.
Thank you for any assistance or guidance.
Last edited by warron.french on 2018/01/08 01:16:51, edited 1 time in total.
Thanks,
War

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: build rpm spec file to install other rpm dependencies

Post by TrevorH » 2018/01/06 14:28:46

Move your Requires: line above the %description - I suspect that it's being seen as part of the description now.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: build rpm spec file to install other rpm dependencies

Post by warron.french » 2018/01/07 04:31:15

Hi TrevorH, that certainly made a difference in the right direction, moving the Requires: tag above the %description tag.

Perhaps you can explain something to me please, is an install using the rpm command only supposed to point out dependencies, but if an RPM is installed using yum, the dependencies are automatically installed?

I ask, because the new RPM generated off the new spec file doesn't auto-install the procmail RPM.
Thanks,
War

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: build rpm spec file to install other rpm dependencies

Post by Whoever » 2018/01/07 05:46:54

That's right.

rpm will refuse to install a package without the dependencies (they can all the installed in the same rpm command). For example, you could do:

Code: Select all

rpm -ivh <path to>/wsf-1.0.rpm <path to>/procmail-3.22-25.1.el6_5.1.rpm
Note that rpm installs package files, not packages.

yum will install the dependencies if it can.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: build rpm spec file to install other rpm dependencies

Post by TrevorH » 2018/01/07 12:41:56

The rpm command should refuse to install the package unless the Requires: are already installed or specified on the same rpm --install command. Using yum should do dependency resolution and offer to install the whole lot in one go.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: build rpm spec file to install other rpm dependencies

Post by warron.french » 2018/01/08 01:14:54

TrevorH wrote:The rpm command should refuse to install the package unless the Requires: are already installed or specified on the same rpm --install command. Using yum should do dependency resolution and offer to install the whole lot in one go.
Ah! Excellent explanation, thank you.
Thanks,
War

Post Reply