[Rpm-maint] [rpm-software-management/rpm] Add %optional tag (#417)

Bernhard Rosenkraenzer notifications at github.com
Thu Mar 15 02:47:50 UTC 2018


@n3npq There are arch specific includes in the toolchains themselves (not necessarily located in /usr/include). I'm talking about the likes of xmmintrin.h (which is x86 specific intrinsics for x86 SIMD in gcc) and other bits in /usr/lib64/gcc/*/*/include.

Especially when building compilers and cross-compilers from the same source package, it can be useful to tell the corresponding packages to include xmmintrin.h if it's there (target = x86 or x86_64 or x32) and not barf if it isn't there (e.g. while building ARM targets).
It gets more complicated than just %ifarch because of cross-compilers (arm crosscompiler built on x86_64 won't have xmmintrin.h), so it can get a little convoluted.
(And no, just including /usr/lib64/gcc/*/*/include/*.h or the likes doesn't do the trick because some of those headers go into C++ or Fortran specific subpackages).

The libreoffice language pack bits would be as simple as you're saying if libreoffice didn't invent its own directory structure.
We have:
%{_libdir}/libreoffice/program/resource/$LANGNAME <--- contains translations
%{_libdir}/libreoffice/readmes/README_$LANGNAME <--- translated README file
%{_libdir}/libreoffice/share/autotext/$LANGNAME <--- per-language auto-completions
%{_libdir}/libreoffice/share/registry/Langpack-$LANGNAME.xcd <--- translation metadata
%{_libdir}/libreoffice/share/registry/res/*_$LANGNAME.xcd <--- translated resource metadata
%{_libdir}/libreoffice/help/$LANGNAME <--- help files
It was even worse in some older versions with extras along the lines of
%{_datadir}/hyphen/$LANGNAME <--- hyphenation rules
%{_datadir}/autocorr/$LANGNAME <--- autocorrection
(those have moved to separate libraries lately).
There's loads of different combinations of incomplete translations -- some languages have translations, but no README, no auto-completion, no help, others have a translation, a README, auto-completion, no help, others have only translated help, ...

Of course it's possible to generate the help packages by specifying what's there for every language (and keep that up to date with every update that has a new language related feature or that drops a language), but this is far simpler, more readable and less of a pain to maintain:
%optional %{_libdir}/libreoffice/program/resource/$LANGNAME
%optional %{_libdir}/libreoffice/readmes/README_$LANGNAME
%optional %{_libdir}/libreoffice/share/autotext/$LANGNAME
%optional %{_libdir}/libreoffice/share/registry/Langpack-$LANGNAME.xcd
%optional %{_libdir}/libreoffice/share/registry/res/*_$LANGNAME.xcd
%optional %{_libdir}/libreoffice/help/$LANGNAME
%optional %{_datadir}/hyphen/$LANGNAME
%optional %{_datadir}/autocorr/$LANGNAME


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/417#issuecomment-373242839
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180314/eb8620da/attachment.html>


More information about the Rpm-maint mailing list