Skip to main content
Became Hot Network Question
add spec file snippet
Source Link
giomanda
  • 155
  • 2
  • 9

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

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 example

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

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

Source Link
giomanda
  • 155
  • 2
  • 9

how to code spec file to install a file on system only if a file is missing

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 example

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