I am new to rpm building and for the past week I am trying to code a spec file to install a file on the system only if a specific files is missing. For exampleHere is a snippet
%global homedir %{_var}/lib/test
Source10: main.db
Source11: back.db
%files data
%defattr(-,%{updateuser},%{updateuser},-)
%config(noreplace) %verify(not size md5 mtime) %{homedir}/*.db
I would like to add a condition where, If file /var/lib/test/file1.txt is missing, install /var/lib/test/back.db
I am aware I need to use the %files macro but so far I am not able to figure out how to write the if condition