ad101
May 20, 2015, 1:24pm
1
I am creating binary RPM on RedHat 6 and would like to do this:
at install time, depending on situation, install a file or not install it
For comparison, I do this on solaris using "installf",
is there a way of achieving similar functionality in RPM?
And conversely for conditional removal (like "removef" on solaris)
That's done with dependencies -- depending on a certain package to make sure a certain file's available, etc.
sea
May 20, 2015, 2:44pm
3
Are you talking about the Require: packagename
of a specfile? (also available: BuildRequires)
Which basicly is the same like what Corona said.
hth
ad101
May 20, 2015, 3:27pm
4
No, I am not talking about package dependencies.
It's like this, in the post install pseudo-code
first part of post install script
if [ some condition ] ; then
install /opt/dir/file
end if
rest of post install script
IOW, if "some condition" is true then /opt/dir/file becomes part of the installed package, otherwise not.
That sounds like data files, which are the sort of thing a package manager doesn't generally remove on uninstall, or strictly consider part of its set of installed files.
RPM does turn out to have pre/post install scripts though.