Mass changes to packaging

Tom Callaway tcallawa at redhat.com
Mon Aug 27 13:54:01 UTC 2012


On 08/27/2012 05:04 AM, Paul Howarth wrote:
> He's not ignoring it, he's saying that on F18+, the expansion of
> %systemd_post_enable should be exactly the same as the expansion of
> %systemd_post, i.e. not enabled by default and honoring whatever
> presets are set for the spin.

Hmm, okay, this is clearer.

So, for Fedora 16 and 17:

1) %systemd_post should be redefined as follows:

%systemd_post() \
if [ $1 -eq 1 ] ; then \
        # Initial installation \
       	/bin/systemctl daemon-reload >/dev/null 2>&1 || : \
fi \
%{nil}

2) Create a new macro defined like this:

%systemd_post_enable() \
if [ $1 -eq 1 ] ; then \
        # Initial installation \
        /bin/systemctl enable %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}

Then, on Fedora 18+:

1) %systemd_post stays as it is currently defined:

%systemd_post() \
if [ $1 -eq 1 ] ; then \
        # Initial installation \
        /usr/bin/systemctl preset %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}

2) Create a new macro defined like this:

%systemd_post_enable() \
if [ $1 -eq 1 ] ; then \
        # Initial installation \
        /usr/bin/systemctl preset %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}

(Note: I'm sure there is a way to actually have this macro just call the
%systemd_post() macro, but I couldn't get the args to pass through.)

***

The result is that if your package is permitted to enable a service by
default in F16/F17, it can use "%systemd_post_enable foo.service" on
F16/F17/F18. It is essentially a no-op on F18+ (identical to
"%systemd_post foo.service").

Lennart, this seems like a good path forward, please let me know how
you'd like to proceed (I can patch this in Fedora and push updates, but
you might want to handle it yourself).

~tom

==
Fedora Project


More information about the devel mailing list