LinuxQuestions.org
Review your favorite Linux distribution.
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 11-14-2007, 04:36 PM   #1
erinfin
LQ Newbie
 
Registered: Nov 2007
Posts: 3

Rep: Reputation: 0
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?
 
Old 11-15-2007, 08:02 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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.
 
Old 11-15-2007, 12:51 PM   #3
erinfin
LQ Newbie
 
Registered: Nov 2007
Posts: 3

Original Poster
Rep: Reputation: 0
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?
 
Old 11-15-2007, 02:06 PM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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.
 
Old 11-15-2007, 05:10 PM   #5
erinfin
LQ Newbie
 
Registered: Nov 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Well, okay. I'd really hoped to automate this, but I guess I can just make the user do it. Thanks.
 
  


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
Creating RPM that installs Icon into Gnome Application Browser bobbrandt Linux - Software 4 06-25-2007 03:39 AM
Streamline RPM installs DirkDiggler Linux - Software 2 05-23-2007 07:08 AM
rpm installs liljhand Linux - Software 6 05-14-2004 05:21 PM
RPM installs, but doesn't keegan Linux - Software 6 01-06-2004 11:49 AM
RPM Installs... but what do you do afters? jimdaworm Linux - Newbie 3 08-21-2003 06:01 PM

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

All times are GMT -5. The time now is 02:59 AM.

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