https://bugzilla.redhat.com/show_bug.cgi?id=1859627



--- Comment #9 from Andy Mender <[email protected]> ---
> In this way won't I need to copy the needed file from the specified prefix to 
> placed like %{_bindir} in the %install section for it to reside in correct 
> path?
If the files to be installed has been listed explicitly in the %files section,
how would this option "invade" other normal GCC packages?

Honestly, I'm a little torn regarding this. I'm reviewing another package, a
GCC version for a non-standard target:
https://bugzilla.redhat.com/show_bug.cgi?id=1350884 (relevant section of the
Packaging guidelines:
https://fedoraproject.org/wiki/Packaging_Cross_Compiling_Toolchains#Cross-compiling_GCC_tool-chains)
In that case it seems like all of the extra trickery is needed. However, for
instance avr-gdb, a package extremely similar to yours, doesn't do any of that
(a snippet from its SPEC file):

%prep
%setup -q -c
cp %{SOURCE1} .


%build
mkdir -p build
pushd build
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" \
  ../gdb-%{version}/configure --prefix=%{_prefix} \
  --libdir=%{_libdir} --mandir=%{_mandir} --infodir=%{_infodir} \
  --target=%{target} --disable-nls --disable-werror \
  --with-system-zlib
make %{?_smp_mflags}
popd


%install
pushd build
make install DESTDIR=$RPM_BUILD_ROOT
popd

# we don't want these as we are a cross version
rm -r $RPM_BUILD_ROOT%{_infodir}
rm -r $RPM_BUILD_ROOT%{_datadir}/gdb
# Should not be installed
rm    $RPM_BUILD_ROOT%{_libdir}/libavr-sim.a

# no need for devel files
rm -rf $RPM_BUILD_ROOT%{_includedir}

%files
%doc gdb-%{version}/COPYING* gdb-%{version}/README*
%{_bindir}/%{name}*
%{_bindir}/avr-run
%{_mandir}/man1/avr-*
%{_mandir}/man5/avr-*

The %doc line is not correct, because it includes also COPYING* license files.
However, both avr-gdb and your arm-none-eabi-gdb are not full compiler
toolchains so perhaps many of the general cross-compiler guidelines can be
relaxed.

> I'm not sure about the right way to deal with it. Is there a standard(or 
> distribution-independent) path to
place arch-specific header files when the package itself doesn't have a safe
default path?

Not that I'm aware of. Usually stuff goes into "/usr/include" or
"/usr/local/include" and then into subdirs like "/usr/include/%{name}".

> I have only seen similar things in /usr/lib like placing object files in 
> directories like x86_64-linux-gnu.
But they still create possibly conflicting symlinks in /usr/lib .
I also haven't learned about how to do this correctly for header files(maybe
there is an config options like --libdir ?)

I had a look at the gdb's "configure" script and there is an option for header
files called "--includedir".

> As I personally don't use it, is it OK not to install it and remove the whole 
> devel subpackage(which includes only this file)?

I'd say you probably can remove the -devel subpackage. Headers if provided
should sit in -devel subpackages, but I haven't seen a rule which would say
that you always have to distribute them, unless they're required by the
binaries to function. Notice that the avr-gdb package doesn't have a -devel
subpackage either.


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]

Reply via email to