I\'m kinda a new to writing spec files and building RPM\'s. Currently I have one RPM that is supposed to deploy some files in 1 of 2 possible directories that will vary with
This is how I solved my problem
step 1 :
In Build section .. somewhere I wrote :
%build
.....
#check my condition here & if true define some macro
%define is_valid %( if [ -f /usr/bin/myfile ]; then echo "1" ; else echo "0"; fi )
#after his normal continuation
.....
...
Step 2: in install section
%install
......
#do something in that condition
if %is_valid
install -m 0644
%endif
#rest all your stuff
................
Step 3:in files section
%files
if %is_valid
%{_dir}/
%endif
That's it
It works.
PS : I cannot give you full code hence giving all useful snippet