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.
|
 |
11-14-2007, 04:36 PM
|
#1
|
LQ Newbie
Registered: Nov 2007
Posts: 3
Rep:
|
Creating an RPM that installs in a directory made by another RPM
I have an application that is being distributed as two RPMs. One of them contains data files shared by all versions of the app, and the other contains files for the specific version being installed. In order for the application to work correctly, the version-specific files need to be installed in a subdirectory of the directory containing the version-shared files.
Everything seems to work fine if I make the shared package a dependency of the version package and hard-code the install directory. Problem is, I want to make the application relocatable. That is, I want to let the user set a prefix for the shared RPM and then have the version RPM automatically install into the same directory. Is there any way to do this?
|
|
|
11-15-2007, 08:02 AM
|
#2
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
Looks like it can be done. Go to the RedHat website and download the book Maximun RPM https://www.redhat.com/docs/books/max-rpm/index.html.
See chapter 15 on making a relocatable rpm. It looks like you would have to make the second rpm query the first to find the DEFAULT_PREFIX for installing the first package, then make the second install to the same default location.
PS: it's a big book; 700+ pages.
Last edited by bigrigdriver; 11-15-2007 at 08:04 AM.
|
|
|
11-15-2007, 12:51 PM
|
#3
|
LQ Newbie
Registered: Nov 2007
Posts: 3
Original Poster
Rep:
|
Thanks. DEFAULTPREFIX isn't quite what I wanted, but that got me to look at the querytags list, and it looks like INSTALLPREFIX will work.
I'm still having some trouble, though. I need to refer to this prefix in both the install and files sections of my spec file, but each section is treated as a separate script and I don't know of any way to share variables between them. Is there a way to set a global variable at runtime?
|
|
|
11-15-2007, 02:06 PM
|
#4
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
Refering back to the book Maximum RPM, see chapter 13 Tags: Data Definitions, the section about Directory-related tags. The --prefix option can be given at install time, as well as in the .spec file.
Write your INSTALL or README to include instructions to the prospective user about using the --prefix option at instal time.
|
|
|
11-15-2007, 05:10 PM
|
#5
|
LQ Newbie
Registered: Nov 2007
Posts: 3
Original Poster
Rep:
|
Well, okay. I'd really hoped to automate this, but I guess I can just make the user do it. Thanks.
|
|
|
All times are GMT -5. The time now is 05:41 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
|
|