[libvirt] [PATCH] build: move file deleting action from %files list to %install
Laine Stump
laine at laine.org
Thu Jan 10 13:47:11 UTC 2013
On 01/09/2013 07:13 PM, Eric Blake wrote:
> On 01/09/2013 05:18 AM, Yufang Zhang wrote:
>> When building libvirt rpms on rhel5, I got the following error:
>>
>> File must begin with "/": rm
>> File must begin with "/": -f
>> File must begin with "/": $RPM_BUILD_ROOT/etc/sysctl.d/libvirtd
>> Installed (but unpackaged) file(s) found:
>> /etc/sysctl.d/libvirtd
>>
>> It is triggerd by the %files list of libvirt daemon:
>>
>> %if 0%{?fedora} >= 14 || 0%{?rhel} >= 6
>> %config(noreplace) %{_prefix}/lib/sysctl.d/libvirtd.conf
>> %else
>> rm -f $RPM_BUILD_ROOT%{_prefix}/lib/sysctl.d/libvirtd.conf
>> %endif
>>
>> After checking document of rpm spec file, I think it would be better
>> to move the file deleting line from %files list to %install script.
> Correct intention, but not quite the right patch.
>
>>
>> +%if 0%{?fedora} < 14 || 0%{?rhel} == 5
> Oops; this fails on RHEL 6 (since there, %{?fedora} is 0 so the left
> half is always true); and on RHEL 4 (if anyone seriously tries to port
> that far back). The correct inversion of:
>
> %if 0%{?fedora} >= 14 || 0%{?rhel} >= 6
>
> would be:
>
> %if 0%{?fedoa} < 14 && 0%{?rhel} < 6
>
> ACK with that change, and will push shortly.
Does anybody other than RHEL or Fedora use the specfile? If they ever
did, yours would fail too :-)
More information about the libvir-list
mailing list