https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd says to use
BuildRequires: systemd-rpm-macros
but this does not seem to work on EPEL 7 because the macros are in the systemd package. It also fails on RHEL8 beta in copr, did not check RHEL 8 GA, though.
https://fedoraproject.org/wiki/EPEL:Packaging does not mention systemd.
To address this, an empty systemd-rpm-macros package that just depends on systemd could be added to EPEL or the packaging guidelines could be adapted. In the long term the RHEL maintainers could be asked to add a systemd-rpm-macros provides to the RHEL systemd package.
Would it be better to:
if 0%{?el7}%{?el8} BuildRequires: systemd else BuildRequires: systemd-rpm-macros
Info: rpm macros are in systemd for RHEL8 (not systemd-rpm-macros)
Changing epel-rpm-macros to provide systemd-rpm-macros and depend on systemd would also be a nice solution. Still we can ask RHEL to add the provides to the systemd package so it would be a temporary solution (hopefully).
If changing epel-rpm-macros is not feasible, I would prefer the empty package to reduce the pitfalls/special cases for EPEL packaging.
Ouch, no. systemd-rpm-macros includes the macros for things like %systemd_post, which is used all over the place. By having an empty package you are trading one %if for two ore more %if's or empty %post, %pre, ...etc.
If changing epel-rpm-macros is not feasible, I would prefer the empty package to reduce the pitfalls/special cases for EPEL packaging. Ouch, no. systemd-rpm-macros includes the macros for things like %systemd_post, which is used all over the place. By having an empty package you are trading one %if for two ore more %if's or empty %post, %pre, ...etc.
Sorry ... nevermind. I just re-read your original request to have an empty package that requires systemd. I had read the above thing in an email, out of context, and that's what I replied to. Again, sorry for that.
We talked about this in today's EPEL Steering Committee meeting. In addition to the original scope of this issue, we would like to be able to define additional systemd macros that are not defined in RHEL but should be, such as %_userpresetdir for RHEL7.
%_userpresetdir
Considering that goal as well as the original goal of making BuildRequires: systemd-rpm-macros work everywhere, I'd like to propose adding a systemd subpackage to epel-rpm-macros. It should require systemd in both EPEL7 and EPEL8 in order to pull in /usr/lib/rpm/macros.d/macros.systemd. In EPEL7 it should provide systemd-rpm-macros. In RHEL8, systemd already provides systemd-rpm-macros.
/usr/lib/rpm/macros.d/macros.systemd
The only open question would be how to ensure epel-rpm-macros-systemd is installed in the chroot when systemd-rpm-macros is a buildrequires. Originally I wanted to have epel-rpm-macros-systemd supplement systemd, until I realized that weak dependencies are disabled in when koji sets up chroots. We could have epel-rpm-macros require epel-rpm-macros-systemd, but that would add systemd to every EPEL8 chroot, even when it isn't needed. We could just not have epel-rpm-macros-systemd require systemd in EPEL8 only, which might give us partially defined macros if a spec file is missing BuildRequires: systemd-rpm-macros to pull in systemd, but spec files using systemd macros should have that, per the guidelines.
Add the following stanza to epel-rpm-macros:
epel-rpm-macros
Requires: (epel-rpm-macros-systemd if systemd-rpm-macros)
That ensures that when BuildRequires: systemd-rpm-macros is satisfied in a transaction, your extra package will get pulled in.
Metadata Update from @carlwgeorge: - Issue assigned to pgreco
Note that systemd-rpm-macros is a Provides of systemd in RHEL 8.
systemd-rpm-macros
systemd
This has been implemented since March 16.
Metadata Update from @tdawson: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.