Bug 850186

Summary: Introduce new systemd-rpm macros in libvirt spec file
Product: [Fedora] Fedora Reporter: Lukáš Nykrýn <lnykryn>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 18CC: berrange, clalancette, crobinso, eblake, itamar, jforbes, jyang, laine, libvirt-maint, luto, veillard, virt-maint, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-06 15:14:59 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 850016, 1090684    
Description Flags
Patch replaces scriptlets with new systemd macros none

Description Lukáš Nykrýn 2012-08-21 09:46:45 EDT
Fedora 18 changes the way how to work with services in spec files. It introduces new macros - %systemd_post, %systemd_preun and %systemd_postun; which replace scriptlets from Fedora 17 and older (see https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd, https://bugzilla.redhat.com/show_bug.cgi?id=850016).
Comment 1 Václav Pavlín 2012-10-19 09:01:27 EDT
Created attachment 630021 [details]
Patch replaces scriptlets with new systemd macros
Comment 2 Eric Blake 2012-10-19 09:07:51 EDT
Would you mind also posting the proposed patch upstream at libvir-list@redhat.com for a faster review?
Comment 3 Václav Pavlín 2012-10-24 07:05:46 EDT
Posted to the list.
Comment 4 Eric Blake 2012-10-24 13:18:41 EDT
Unfortunately, the libvirt.spec file has to continue to work with Fedora 17, and therefore, we cannot convert to the scriptlets until F17 is retired as obsolete.  I'm tempted to close this as WONTFIX, except that I want something still around so that we remember to revisit this in a year.
Comment 5 Eric Blake 2012-10-24 13:19:42 EDT
(In reply to comment #4)
> Unfortunately, the libvirt.spec file has to continue to work with Fedora 17,
> and therefore, we cannot convert to the scriptlets until F17 is retired as
> obsolete.

Another alternative would be to backport the scriptlet support into F17, so that use of the scriptlets when building on F17 doesn't break libvirt, but that would require a bug against systemd.
Comment 6 Eric Blake 2012-10-24 13:21:04 EDT
(In reply to comment #3)
> Posted to the list.

For reference, here is the list conversation:
Comment 7 Václav Pavlín 2012-10-25 09:02:28 EDT
I sent new patch upstream. Do you need another updated patch for Fedora?
Comment 8 Cole Robinson 2012-10-27 13:04:18 EDT
I think we can just wait to apply this until after F18 is out, then we don't need to worry about virt-preview
Comment 9 Eric Blake 2012-11-05 16:32:03 EST
The upstream patch is now applied, and conditional on snippet support being present, so it should be safe for F18 (via without negatively impacting F17 fedora-virt-preview.

commit ec02d49dfd98313d1c8c4179e88754f10a82ca46
Author: Václav Pavlín <vpavlin@redhat.com>
Date:   Thu Oct 25 12:10:55 2012 +0200

    spec: replace scriptlets with new systemd macros
    I added %with_systemd_macros so it should now work in F17 with old
    scriptlets and in F18+/RHEL7+ with systemd macros
    (see https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd)
    I missed libvirt-guests.service because there is no systemctl call for
    it. So I only added systemd macros calls.
Comment 10 Fedora Update System 2012-12-09 19:47:42 EST
libvirt- has been submitted as an update for Fedora 18.
Comment 11 Eric Blake 2014-05-06 13:28:56 EDT
*** Bug 1094914 has been marked as a duplicate of this bug. ***