LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 01-31-2009, 04:31 PM   #1
shaybery
Member
 
Registered: Jan 2008
Posts: 30

Rep: Reputation: 15
3 questions about rpm


(1) There is a way in rpm to install a specific file only if an action is made?

example : there is a rpm that contain 2 files /etc/file1 and /etc/file2. on the system /etc/file1 is already exist but /etc/file2 is not exist.
Now we install the rpm via rpm -i and we want that the rpm will install only /etc/file2. is it possible?

(2) Where can I define a variable\function(in the spec file) that will be available for all the un\pre\post install scripts? (if I define variable in %pre it will be available only inside the %pre script)

(3) Why it is not good to create rpm that will installs other rpms in his post-script?
 
Old 01-31-2009, 06:48 PM   #2
watcher69b
Member
 
Registered: Nov 2007
Location: /home/watcher69b
Distribution: RH, Fedora & CentOS
Posts: 552

Rep: Reputation: 41
1. yes, you can extract files from rpms using file roller

2. no idea...

3. i don't know, i guess that maybe its because each rpm installed goes into a lists of everything that is installed on your system. Perhaps if you installed multiple packages under 1 rpm then it may not enter them correctly into the rpm list
 
Old 01-31-2009, 07:37 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by shaybery View Post
There is a way in rpm to install a specific file only if an action is made?
If file0 is marked %config(noreplace) then on update %config file1 should be added? Sure you can --justdb later on but IMHO extracting files from a package should not constitute installing because you bypass the whole reason for using a package manager in the first place.


Quote:
Originally Posted by shaybery View Post
Where can I define a variable\function(in the spec file) that will be available for all the un\pre\post install scripts? (if I define variable in %pre it will be available only inside the %pre script)
As far as I know .spec files "just" drive building a package. It's not like a %define lives past building the package. What would the variable store?


Quote:
Originally Posted by shaybery View Post
Why it is not good to create rpm that will installs other rpms in his post-script?
If you're talking dependency resolution RPM should handle it all by itself. If you mean something else please supply an example.
 
Old 02-01-2009, 01:38 AM   #4
shaybery
Member
 
Registered: Jan 2008
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by watcher69b View Post
1. yes, you can extract files from rpms using file roller
What is a file roller and how can I use it?

Quote:
Originally Posted by watcher69b View Post
2. no idea.

3. i don't know, i guess that maybe its because each rpm installed goes into a lists of everything that is installed on your system. Perhaps if you installed multiple packages under 1 rpm then it may not enter them correctly into the rpm list
 
Old 02-01-2009, 01:54 AM   #5
shaybery
Member
 
Registered: Jan 2008
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
If file0 is marked %config(noreplace) then on update %config file1 should be added? Sure you can --justdb later on but IMHO extracting files from a package should not constitute installing because you bypass the whole reason for using a package manager in the first place..
But if I use config(noreplace) it must be a configration file, and I want to control also none config files.
Can I execute a roll before each file that is going to be installed on the rpm?


Quote:
Originally Posted by unSpawn View Post
As far as I know .spec files "just" drive building a package. It's not like a %define lives past building the package. What would the variable store?
for example I want to define a const variable that we be define in the preinstall postinstall and unpreinstall unpostinstall, so I will not need to define it on each scriptlet.


Quote:
Originally Posted by unSpawn View Post
If you're talking dependency resolution RPM should handle it all by itself. If you mean something else please supply an example.
 
Old 02-01-2009, 02:25 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by shaybery View Post
But if I use config(noreplace) it must be a configration file, and I want to control also none config files.
Maybe it's time you posted a Real Life example.


Quote:
Originally Posted by shaybery View Post
Can I execute a roll
A WHAT?


Quote:
Originally Posted by shaybery View Post
I want to
You can't define an environment variable outside of %pre, %post, %preun, %postun et cetera and hope it will survive building the package.
 
Old 02-02-2009, 01:19 AM   #7
shaybery
Member
 
Registered: Jan 2008
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
Maybe it's time you posted a Real Life example..
I already posted an example,I will repeat that example :
spec file contain 2 files ,/etc/a /etc/b, and I want that during the installation of the rpm only /etc/a will be installed and not /etc/b, because the file /etc/b is already exist in the system at the same location.
So there is a way to do that? it is like to run a rule because each file that going to be installed and by this rule the file will be installed or not.


Quote:
Originally Posted by unSpawn View Post
You can't define an environment variable outside of %pre, %post, %preun, %postun et cetera and hope it will survive building the package.
OK, I just wanted to do some thing simillar that you can do in solaris pkgs by using the checkinstall scriptlet, you can see it in the link :
http://www.ibiblio.org/pub/packages/....packages.html
 
Old 02-02-2009, 01:34 AM   #8
shaybery
Member
 
Registered: Jan 2008
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by watcher69b View Post
1. yes, you can extract files from rpms using file roller
file roller it just an external program that can extract files from rpm(like rpm2cpio), I didn't ment to do that. I want to do thome thing that you can do in solaris pkgs, but I didn't find how to do it in rpm packages. read the following link :
http://docsrv.sco.com/SDK_tools/pkgs...on_Script.html
 
Old 02-03-2009, 05:14 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by shaybery View Post
I already posted an example,I will repeat that example :
I asked for a Real Life example. As in show me packagers who actually do this.


Quote:
Originally Posted by shaybery View Post
OK, I just wanted to do some thing simillar that you can do in solaris pkgs by using the checkinstall scriptlet
Ah, I see. OK. Use Solaris then ;-p
 
  


Reply



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
cannot build source rpm/ rpm questions kpachopoulos Fedora 3 07-24-2005 09:15 AM
Some RPM questions hcclnoodles Linux - General 6 08-03-2004 08:00 PM
questions about rpm mnguyen Linux - Software 3 02-19-2004 08:04 PM
binary vs source RPM (and other RPM questions) calimer Linux - Software 4 06-22-2003 12:33 AM
RPM Questions gauge73 Linux - Newbie 2 01-20-2003 03:18 PM

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

All times are GMT -5. The time now is 06:58 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