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. Here 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
/var/lib/test/file1.txtOR the package that contains/var/lib/test/back.db, and put theback.dbfile in that separate package. Generally, however: Software installation should be fully independent of the data files that are on a system, so even that sounds like a bad idea.