Re: sysusers scriptlets: what to do if upstream includes the config files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 27, 2021 at 03:29:05PM -0800, Adam Williamson wrote:
> On Sat, 2021-11-27 at 09:01 -0500, Frank Ch. Eigler wrote:
> > Adam Williamson <adamwill@xxxxxxxxxxxxxxxxx> writes:
> > 
> > > [...]
> > > 
> > > https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/#_dynamic_allocation
> > > 
> > > say:
> > > 
> > > "Create a <package-name>.sysusers file with the user definition and add
> > > where usr/lib/sysusers.d/geekotest.conf is the path to one of the
> > > sysusers config file within the upstream source, but it doesn't seem to
> > > work. [...]
> > 
> > One problem with these sysusers rpm macros is that they expand to the
> > scriptlets very early: before even the main source tarball is extracted.
> 
> Yeah, I figured that was probably the issue. I could not find any
> documentation of exactly when macro expansion happens, but I probably
> didn't look hard enough.
> 
> > This is why the fedora packaging guideline more or less forces them to
> > be first-class spec sources.
> > 
> > In the case of systemtap, we worked around this by moving the sysusers
> > config files right into the spec file - out of the source tarball - and
> > feed them to %pre and %install scripts by hand.
> > 
> > https://src.fedoraproject.org/rpms/systemtap/blob/rawhide/f/systemtap.spec#_91
> > https://src.fedoraproject.org/rpms/systemtap/blob/rawhide/f/systemtap.spec#_688
> > https://src.fedoraproject.org/rpms/systemtap/blob/rawhide/f/systemtap.spec#_818
> > 
> > IMO this is ugly and unfortunate.
> 
> I agree. I'd really like a less icky solution to this :(

Yes, this is a problem. It would be nice if rpm allowed more flexibility here.
https://github.com/rpm-software-management/rpm/pull/1485 looks promising:
we could do away with *all* scriptlets in the spec file, and the sysusers
stuff would be handled by a generator.

A similar problem occurs with transfiletriggers in the systemd package:
they are defined in a long file that is created as part of the build. But
rpmbuild requires that their definition is always available. We copy
the file out [1] and after the build check that it hasn't changed [2],
but that's ugly and fragile.

[1] https://src.fedoraproject.org/rpms/systemd/blob/rawhide/f/triggers.systemd
[2] https://src.fedoraproject.org/rpms/systemd/blob/rawhide/f/systemd.spec#_533

Zbyszek
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux