Linux - SoftwareThis 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.
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.
(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?
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
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.
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
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.