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.
|
 |
01-31-2009, 04:31 PM
|
#1
|
Member
Registered: Jan 2008
Posts: 30
Rep:
|
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?
|
|
|
01-31-2009, 06:48 PM
|
#2
|
Member
Registered: Nov 2007
Location: /home/watcher69b
Distribution: RH, Fedora & CentOS
Posts: 552
Rep:
|
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
|
|
|
01-31-2009, 07:37 PM
|
#3
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by shaybery
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
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
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.
|
|
|
02-01-2009, 01:38 AM
|
#4
|
Member
Registered: Jan 2008
Posts: 30
Original Poster
Rep:
|
Quote:
Originally Posted by watcher69b
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
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
|
|
|
|
02-01-2009, 01:54 AM
|
#5
|
Member
Registered: Jan 2008
Posts: 30
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
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
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
If you're talking dependency resolution RPM should handle it all by itself. If you mean something else please supply an example.
|
|
|
|
02-01-2009, 02:25 PM
|
#6
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by shaybery
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
Can I execute a roll
|
A WHAT?
Quote:
Originally Posted by shaybery
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.
|
|
|
02-02-2009, 01:19 AM
|
#7
|
Member
Registered: Jan 2008
Posts: 30
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
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
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
|
|
|
02-02-2009, 01:34 AM
|
#8
|
Member
Registered: Jan 2008
Posts: 30
Original Poster
Rep:
|
Quote:
Originally Posted by watcher69b
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
|
|
|
02-03-2009, 05:14 PM
|
#9
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by shaybery
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
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
|
|
|
All times are GMT -5. The time now is 07:38 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
|
|