LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-20-2009, 02:22 PM   #1
crontab
Member
 
Registered: Jun 2005
Distribution: Various
Posts: 72

Rep: Reputation: 15
How to make RPMs with dependencies (meta-packages?)


Hi all,

I found a few articles that describe the process of creating RPMs -- the expected directory layout, the spec file, etc. But I haven't found out how to tell an RPM what dependencies it needs. I'm trying to make a meta-package that simply installs a bunch of other packages, which makes life easier when deploying new systems.

Or is this a feature of yum, and not RPM?

Last edited by crontab; 04-20-2009 at 02:23 PM.
 
Old 04-20-2009, 02:36 PM   #2
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
You could add requires in the specfile.
IE:

Requires: PACKAGE1, PACKAGE2
 
Old 04-21-2009, 09:44 AM   #3
crontab
Member
 
Registered: Jun 2005
Distribution: Various
Posts: 72

Original Poster
Rep: Reputation: 15
Ah, thanks. Once I knew what to search for, I found this: http://www.rpm.org/max-rpm/s1-rpm-inside-tags.html
 
Old 04-22-2009, 12:58 PM   #4
crontab
Member
 
Registered: Jun 2005
Distribution: Various
Posts: 72

Original Poster
Rep: Reputation: 15
The RPM built fine with `rpmbuild -ba SPECS/metatest.spec`, but when I go to install it, nothing happens. Since there is no actual code or binary being packaged, I don't know if I'm doing it correctly.

Here is my metatest.spec file:

Code:
%define _topdir			/home/zed/meta_package
%define _tmppath		%{_topdir}/tmp
%define _prefix			/usr/local
%define _defaultdocdir		%{_prefix}/share/doc
%define _mandir			%{_prefix}/share/man

%define name			Metatest
%define summary			Meta-package test
%define version			0.1
%define release			1
%define license			GPL
%define group			Documentation
%define vendor			Zed, inc.
%define packager		zed
%define	buildroot		%{_tmppath}/%{name}-root

Name:      %{name}
Version:   %{version}
Release:   %{release}
Packager:  %{packager}
Vendor:    %{vendor}
License:   %{license}
Summary:   %{summary}
Group:     %{group}
#Source:    %{source}
URL:       %{url}
Prefix:    %{_prefix}
Buildroot: %{buildroot}
Requires:  screen irssi

%description
Meta-package test
I have screen and irssi there as examples just to see if it will pull them in.
 
Old 04-22-2009, 03:26 PM   #5
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
Your post said you wanted to require a package to be installed.

The other part where you said you wanted it to 'pull' it in would require a script that ran within the RPM itself. I'd advise against it as that's what require is for, to let people know that there is something else to install. Automaticly installing packages within other packages could break things or not work at all. It could also cause suspect that your installing something like a trojan horse.

The require means if the package is not installed that the current rpm will fail and require you to install the required package(s) before you can install it.
 
Old 04-22-2009, 04:27 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608
Quote:
Originally Posted by kentyler View Post
The other part where you said you wanted it to 'pull' it in would require a script that ran within the RPM itself.
It does not. All that was missing from the .spec file was an empty %files section to rpmbuild OK. Installing the package using yum I can confirm it properly requires screen and irssi.


Quote:
Originally Posted by kentyler View Post
I'd advise against it as that's what require is for, to let people know that there is something else to install. Automaticly installing packages within other packages could break things or not work at all.
Take a look at Xorg and OOo packages. The'res meta packages there that are placeholders just to make sure other packages are pulled in. Nothing rocketscience there.


Quote:
Originally Posted by kentyler View Post
It could also cause suspect that your installing something like a trojan horse.
Depending on who's the vedor, how the packages are signed (GPG) and how they're distributed slash provided that may or may not arouse suspicion.
 
Old 04-23-2009, 08:26 AM   #7
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
I think what he meant by pull it in is download or install other rpms automatically based on content within the specfile.
 
Old 04-23-2009, 08:55 AM   #8
crontab
Member
 
Registered: Jun 2005
Distribution: Various
Posts: 72

Original Poster
Rep: Reputation: 15
Let me be more clear about what I meant

When doing `yum localinstall` or `rpm -i` I wanted it to list those two apps as dependencies. Thanks to unSpawn for pointing out the empty %files section.

I failed to mention that I'm building my own yum repo, and I want to be able to type `yum install meta-test` (or whatever it's named) and have it find and download its dependencies, like most apps usually do. As I mentioned earlier, I wasn't sure if this dependency seeking and downloading was handled by RPM or by yum. Edit: I'm using Spacewalk, which doesn't support yum groups.

Right now it's failing to install due to dependency errors, which is definitely a step in the right direction:

Code:
Metatest-0.1-1.i386 from /home/Zed/meta_package/RPMS/i386/Metatest-0.1-1.i386.rpm has depsolving problems
  --> Missing Dependency: irssi is needed by package Metatest-0.1-1.i386 (/home/Zed/meta_package/RPMS/i386/Metatest-0.1-1.i386.rpm)
Error: Missing Dependency: irssi is needed by package Metatest-0.1-1.i386 (/home/Zed/meta_package/RPMS/i386/Metatest-0.1-1.i386.rpm)

Last edited by crontab; 04-23-2009 at 09:08 AM.
 
Old 04-23-2009, 10:14 AM   #9
crontab
Member
 
Registered: Jun 2005
Distribution: Various
Posts: 72

Original Poster
Rep: Reputation: 15
Looks like everything is working the way I wanted. Thanks, everyone!
 
Old 04-23-2009, 04:43 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608
Quote:
Originally Posted by kentyler View Post
I think what he meant by pull it in is download or install other rpms automatically based on content within the specfile.
Like I said before that's not rocketscience nor unusual. Examples were given already so you can see for yourself and not have to take my word for it.


Quote:
Originally Posted by crontab View Post
Let me be more clear about what I meant (..) I failed to mention that
For some reason people often find it necessary to post just half the information they posess. I don't know what that is all about unless people think everyone's ESP-fu here is major ;-p Sure in most occasions it might be overkill but it never hurts to put as much nfo in the OP as possible. Anyway. Good to see you made things work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OOo, yum, rpms....uninstall, reinstall, failed dependencies....HELP!!! kalico Linux - Software 17 07-11-2006 11:03 PM
RPMs and Dependencies JosiahW Linux - Newbie 1 06-28-2006 01:08 AM
Creating Meta Packages question robertp7684 Linux - Newbie 1 01-02-2006 08:45 PM
Failed dependencies on RPMs jared78 Linux - Newbie 16 07-01-2005 11:13 PM
RPMs: Interrelated dependencies teyesahr Linux - Software 2 01-20-2004 09:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration