#1260 mingw: document approach for integrating mingw with native packages
Merged by james. Opened by berrange.
berrange/packaging-committee mingw-native  into  master

Download 1260.patch

This merge request contains the updated mingw guidelines text to address

https://pagure.io/packaging-committee/issue/1259

which describes the goal to support MinGW packaging integrated into the native spec files, rather than as completely distinct source packages/components.

The idea of integrated packaging for MinGW + native builds was warmly received when discussed on the mailing lists.

The functional changes to the specfile are also largely un-interesting, as the existing mingw spec file directives could be copied straight into the native package and will do the right thing automatically, producing sub-RPMs for mingw that are indistinguishable from what has historically been produced.

The main notable addition is to suggest that all the mingw related spec directives are placed within conditionals, such that the specfile can be built in derivative distributions (eg CentOS Stream / RHEL) where the Mingw toolchain is not present.

Perhaps the most notable interesting question is how strongly to push towards favouring integrated packaging over separate packaging.

This proposal makes integrated packaging mandatory when the same contributor intends to maintain both native and mingw packages, since that is an maintenance win with little obvious downside. For the case where the mingw support is requested / proposed by someone who is not already the native maintainer, integrated packaging is encouraged, but the native maintainer still has discretion to decline it. It is hoped native package maintainers will be receptive, but we're mindful of not wanting to force them to do something against their will. Similar to the example of how Fedora maintainers are NOT forced to support EPEL branches against their will.

Ping: packaging committee. Does anyone have any comments on this proposal ?

@berrange

i'm not on the packaging committee, but I have a couple of doc suggestions.

specfile syntax highlighting

If you fence your specfile code snippets with:

[source, rpm-spec]
----
  .spec code here
----

Instead of ...., the code will be rendered syntax-highlighted which can make reading more comfortable.

Conditional mingw inclusion

Your example spec file contains,

%define with_mingw 0
%if 0%{?fedora}
    %define with_mingw 0%{!?_without_mingw:1}
%endif

Writing the condition this way will make it impossible for non-fedora users of the specfile to include mingw subpackages, even if they use rpmbuild --with=mingw.

To make the build as flexible as possible, I'd suggest setting the default based on the distro, using conditional %bcond_{with,without} calls. The %bcond_ macros will take care of defining with_mingw properly based on both the defaults plus the command line, and the %{with} macro can be used to check it later using the same argument that was passed to the %bcond_ macro.

IOW, if the specfile is written as...

%if 0%{?fedora}
  %bcond_without mingw
%else
  %bcond_with mingw
%endif
[...]
%if %{with mingw}
  (optional MinGW parts of the build...)
%endif

Then it'll always DTRT.

On Fedora:

  • rpmbuild will make %{with mingw} test true
  • rpmbuild --without=mingw will make %{with mingw} test false

On other distros:

  • rpmbuild will make %{with mingw} test false
  • rpmbuild --with=mingw will make %{with mingw} test true

Metadata Update from @james:
- Pull-request tagged with: meeting

rebased onto 33d7924d64a86833701627dc82da383460fbf1db

@ferdnyc thanks for the suggestions, I've made those changes

That should probably be s/Experiance/Experience/?

This paragraph seems to be redundant with bullet point 4 from the previous section.

s/experiance/experience/

Other than those minor issues, looks good to me. Thank you for working on this!

This paragraph seems to be redundant with bullet point 4 from the previous section.

To an extent everything under this heading is redundant, but I felt it worth spelling it out explicitly. I'll simplify this second paragraph to just refer back to the earlier one.

2 new commits added

  • mingw: document approach for integrating mingw with native packages
  • mingw: use RPM source syntax highlighting

Pull-Request has been merged by james

Metadata