[Rpm-maint] [rpm-software-management/rpm] Is it necessary to touch a %ghost? (Discussion #3380)

Miro Hrončok notifications at github.com
Tue Oct 15 08:49:09 UTC 2024


A very very old documentation says:

> There are times when a file should be owned by the package but not installed - log files and state files are good examples of cases you might desire this to happen.
> 
> The way to achieve this, is to use the %ghost directive. By adding this directive to the line containing a file, RPM will know about the ghosted file, but will not add it to the package. **However it still needs to be in the buildroot.** Here's an example of %ghost in action. 
>
> ```
> %install
> touch $RPM_BUILD_ROOT%{_localstatedir}/log/blather.log
>> %files
>> %ghost %{_localstatedir}/log/blather.log
> ```

http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-GHOST-DIRECTIVE

The current docs say no such thing:

https://rpm-software-management.github.io/rpm/manual/spec.html#ghost

It is possible to build a package with `%ghost %{_localstatedir}/log/blather.log` without first touching the path (at least with RPM 4.20), but rpmlint 2.5.0 says:

```
joft.noarch: E: non-readable /var/log/blather.log 0
```

That brings me to this question:

 - Is it necessary to create `%ghost` files in the buildroot, or was this only true in the past?
 - If it is necessary, should RPM fail ot build the package when the %ghost is not in the buildroot?
 - If it is not necessary, is this a bug in rpmlint?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3380
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/repo-discussions/3380 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241015/31575486/attachment-0001.html>


More information about the Rpm-maint mailing list