Hi Federico,
I'm also a beginner, but maybe I can help.
On 2 February 2018 at 14:58, Federico Bruni <fede(a)inventati.org> wrote:
Il giorno gio 1 feb 2018 alle 10:06, Paul Howarth
<paul(a)city-fan.org> ha
scritto:
> On Thu, 01 Feb 2018 06:52:57 +0100
> Federico Bruni <fede(a)inventati.org> wrote:
>>
>> >> %license COPYING
>> >>
>> >> %doc README.* COPYING
>> >
>> > If including the file COPYING as a licence file already, duplicating
>> > it also as a separate doc file isn't necessary and should not be
>> > done.
>>
>> I must duplicate it, since upstream is copying that file in the doc
>> dir:
>>
>> [extractpdfmark-1.0.2]$ grep COPYING Makefile
>> $(srcdir)/config.h.in $(dist_doc_DATA) COPYING compile \
>> dist_doc_DATA = README.md README.ja.md COPYING
>>
>>
>> So if I remove it from %doc, I'll get an error:
>>
>> error: Installed (but unpackaged) file(s) found:
>> /usr/share/doc/extractpdfmark/COPYING
>> Installed (but unpackaged) file(s) found:
>> /usr/share/doc/extractpdfmark/COPYING
>>
>> Should I ask upstream to fix it and put COPYING under
>> /usr/share/licenses?
>
>
> You could remove the copy in /usr/share/doc/extractpdfmark at the end
> of %install to avoid this problem.
>
Good idea, but I cannot make it work. I've tried this first:
%install
%make_install
rm -f %{_docdir}/extractpdfmark/COPYING
But it seems that it tries to remove the file in my system instead of that
in chroot?
Try
rm -f %{buildroot}/%{_docdir}/extractpdfmark/COPYING
During the %install phase, %make_install should be "installing" stuff
into subdirectories of %{buildroot} (which lives inside a directory
called BUILDROOT, sister to SPECS). %make_install shouldn't be able
to write anything into %{_docdir} itself (usually /usr/share/doc),
because you are not root (which is good).
I cannot find any good tutorial on this subject. If you have links
to
suggest please let me know.
Old as it is, I found Maximum RPM still useful:
http://ftp.rpm.org/max-rpm/
though there are some conventions / best practices that have changed,
it is still a good tutorial.
Besides that, the Fedora packaging guidelines
https://fedoraproject.org/wiki/Packaging:Guidelines
and the howto on the wiki:
https://fedoraproject.org/wiki/How_to_create_an_RPM_package
In particular, for this issue, scroll down to "Macros", or see
https://fedoraproject.org/wiki/Packaging:RPMMacros
Best
Alex