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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-20-2009, 02:22 PM
|
#1
|
Member
Registered: Jun 2005
Distribution: Various
Posts: 72
Rep:
|
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.
|
|
|
04-20-2009, 02:36 PM
|
#2
|
Member
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270
Rep:
|
You could add requires in the specfile.
IE:
Requires: PACKAGE1, PACKAGE2
|
|
|
04-22-2009, 12:58 PM
|
#4
|
Member
Registered: Jun 2005
Distribution: Various
Posts: 72
Original Poster
Rep:
|
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.
|
|
|
04-22-2009, 03:26 PM
|
#5
|
Member
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270
Rep:
|
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.
|
|
|
04-22-2009, 04:27 PM
|
#6
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by kentyler
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
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
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.
|
|
|
04-23-2009, 08:26 AM
|
#7
|
Member
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270
Rep:
|
I think what he meant by pull it in is download or install other rpms automatically based on content within the specfile.
|
|
|
04-23-2009, 08:55 AM
|
#8
|
Member
Registered: Jun 2005
Distribution: Various
Posts: 72
Original Poster
Rep:
|
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.
|
|
|
04-23-2009, 10:14 AM
|
#9
|
Member
Registered: Jun 2005
Distribution: Various
Posts: 72
Original Poster
Rep:
|
Looks like everything is working the way I wanted. Thanks, everyone!
|
|
|
04-23-2009, 04:43 PM
|
#10
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by kentyler
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
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.
|
|
|
All times are GMT -5. The time now is 07:52 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|