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 11-21-2008, 01:20 PM   #1
sandricky
LQ Newbie
 
Registered: Nov 2008
Posts: 14

Rep: Reputation: 0
Making the - - prefix option required when installing an RPM package


We packaged up some of our scripts that our company uses. In the %files section of the spec file the files contain a path that will most likely not be used by some of our target users. We have added the Prefix: option to allow them to install in it another location with the --prefix option and it works great. The question is can we somehow make the --prefix option a required option when trying to install the RPM?

Thanks
Rick
 
Old 11-22-2008, 10:09 PM   #2
penguiniator
Member
 
Registered: Feb 2004
Location: Olympia, WA
Distribution: SolydK
Posts: 442
Blog Entries: 3

Rep: Reputation: 60
Try looking at http://rpm.org/wiki/Docs#PackagerDocumentation. You may find the answer you need and more there.
 
Old 02-07-2009, 06:20 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,561
Blog Entries: 54

Rep: Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927
(Well within necroposting limits I hope) AFAIK .spec "Prefix:" != RPM CLI arg "--prefix" but "--reloc". In any case using something like this:
Code:
%pre
if [ "$1" = "1" ]; then
	grep -q -- "--reloc" /proc/`pgrep rpm`/cmdline
else
will make RPM skip installing the package on script error. This is in no way an "official" method, can be bypassed easily using "--noscripts" (though you can test for that as well) and can be easily thwarted if you have multiple 'rpm' commands running (though you could 'pgrep -f packagename_and_rpm-args').
 
Old 02-09-2009, 01:24 AM   #4
sandricky
LQ Newbie
 
Registered: Nov 2008
Posts: 14

Original Poster
Rep: Reputation: 0
Thumbs up Going with it.

Thanks, I've read and I asked but nothing that I found can make the --prefix a required option except adding the script option as unSpawn suggested. Thanks, I think I will go with it.
 
  


Reply

Tags
file, options, prefix, rpm, rpmbuild, spec


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
how do i use the prefix option in clish avi_al Linux - Newbie 1 04-08-2009 05:38 AM
how do i use the prefix option in clish avi_al Linux - Software 1 11-13-2008 05:29 AM
rpm -i --prefix=/home/user package.src.rpm doesn't work? registering Linux - Software 2 07-18-2007 12:28 PM
Making RPM package vikasumit Programming 1 09-02-2006 07:17 AM
making an RPM package ?? rinux Linux - Software 1 09-24-2003 08:11 PM


All times are GMT -5. The time now is 02:47 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration