[libvirt] [PATCH 0/2] spec file fixups

Here's a couple of spec file cleanups that should go in prior to 1.0.5, particularly since the FPC recently changed packaging guidelines because of an issue highlighted in libvirt's spec file. Eric Blake (2): spec: collect all BuildRequires into one area spec: proper soft static allocation of qemu uid libvirt.spec.in | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) -- 1.8.1.4

Conditional BuildRequires: should be at the top level, rather than appearing in conditional sub-package sections. This appears to be the only offender. * libvirt.spec.in (BuildRequires): Move libblkid-devel into correct area. Signed-off-by: Eric Blake <eblake@redhat.com> --- libvirt.spec.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 328b009..a333f64 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -412,6 +412,10 @@ BuildRequires: gettext BuildRequires: libtasn1-devel BuildRequires: gnutls-devel BuildRequires: libattr-devel +%if %{with_libvirtd} +# For pool-build probing for existing pools +BuildRequires: libblkid-devel >= 2.17 +%endif %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 # for augparse, optionally used in testing BuildRequires: augeas @@ -655,8 +659,6 @@ Requires: PolicyKit >= 0.6 Requires: nfs-utils # For mkfs Requires: util-linux -# For pool-build probing for existing pools -BuildRequires: libblkid-devel >= 2.17 # For glusterfs %if 0%{?fedora} >= 11 Requires: glusterfs-client >= 2.0.1 -- 1.8.1.4

On 05/01/2013 04:32 PM, Eric Blake wrote:
Conditional BuildRequires: should be at the top level, rather than appearing in conditional sub-package sections. This appears to be the only offender.
* libvirt.spec.in (BuildRequires): Move libblkid-devel into correct area.
Signed-off-by: Eric Blake <eblake@redhat.com> --- libvirt.spec.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 328b009..a333f64 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -412,6 +412,10 @@ BuildRequires: gettext BuildRequires: libtasn1-devel BuildRequires: gnutls-devel BuildRequires: libattr-devel +%if %{with_libvirtd} +# For pool-build probing for existing pools +BuildRequires: libblkid-devel >= 2.17 +%endif %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 # for augparse, optionally used in testing BuildRequires: augeas @@ -655,8 +659,6 @@ Requires: PolicyKit >= 0.6 Requires: nfs-utils # For mkfs Requires: util-linux -# For pool-build probing for existing pools -BuildRequires: libblkid-devel >= 2.17 # For glusterfs %if 0%{?fedora} >= 11 Requires: glusterfs-client >= 2.0.1
ACK.

On 05/01/2013 03:22 PM, Laine Stump wrote:
On 05/01/2013 04:32 PM, Eric Blake wrote:
Conditional BuildRequires: should be at the top level, rather than appearing in conditional sub-package sections. This appears to be the only offender.
* libvirt.spec.in (BuildRequires): Move libblkid-devel into correct area.
ACK.
Thanks; I've pushed this one while waiting for a review on 2/2. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

https://bugzilla.redhat.com/show_bug.cgi?id=924501 tracks a problem that occurs if uid 107 is already in use at the time libvirt is first installed. In response that problem, Fedora packaging guidelines were recently updated. This fixes the spec file to comply with the new guidelines: https://fedoraproject.org/wiki/Packaging:UsersAndGroups * libvirt.spec.in (daemon): Follow updated Fedora guidelines. Signed-off-by: Eric Blake <eblake@redhat.com> --- libvirt.spec.in | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index a333f64..ae1bd21 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -718,6 +718,8 @@ Requires: numad %endif # libvirtd depends on 'messagebus' service Requires: dbus +# For uid creation during pre +Requires(pre): shadow-utils %description daemon Server side daemon required to manage the virtualization capabilities @@ -1444,14 +1446,19 @@ make check %if %{with_libvirtd} %pre daemon %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 -# Normally 'setup' adds this in /etc/passwd, but this is -# here for case of upgrades from earlier Fedora/RHEL. This -# UID/GID pair is reserved for qemu:qemu -getent group kvm >/dev/null || groupadd -g 36 -r kvm -getent group qemu >/dev/null || groupadd -g 107 -r qemu -getent passwd qemu >/dev/null || \ - useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ - -c "qemu user" qemu +# We want soft static allocation of well-known ids, as disk images +# are commonly shared across NFS mounts by id rather than name; see +# https://fedoraproject.org/wiki/Packaging:UsersAndGroups +getent group kvm >/dev/null || groupadd -f -g 36 -r kvm +getent group qemu >/dev/null || groupadd -f -g 107 -r qemu +if ! getent passwd qemu >/dev/null; then + if ! getent passwd 107 >/dev/null; then + useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + else + useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + fi +fi +exit 0 %endif %post daemon -- 1.8.1.4

On 05/01/13 22:32, Eric Blake wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=924501 tracks a problem that occurs if uid 107 is already in use at the time libvirt is first installed. In response that problem, Fedora packaging guidelines were recently updated. This fixes the spec file to comply with the new guidelines: https://fedoraproject.org/wiki/Packaging:UsersAndGroups
* libvirt.spec.in (daemon): Follow updated Fedora guidelines.
Signed-off-by: Eric Blake <eblake@redhat.com> --- libvirt.spec.in | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
ACK, this patch brings the libvirt file to sync with the fedora guideline. Peter

On 05/06/2013 01:30 PM, Peter Krempa wrote:
On 05/01/13 22:32, Eric Blake wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=924501 tracks a problem that occurs if uid 107 is already in use at the time libvirt is first installed. In response that problem, Fedora packaging guidelines were recently updated. This fixes the spec file to comply with the new guidelines: https://fedoraproject.org/wiki/Packaging:UsersAndGroups
* libvirt.spec.in (daemon): Follow updated Fedora guidelines.
Signed-off-by: Eric Blake <eblake@redhat.com> --- libvirt.spec.in | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
ACK, this patch brings the libvirt file to sync with the fedora guideline.
Thanks; I've pushed this now, and will backport to v0.10.2-maint (for Fedora 18, as original place where the problem was reported) and v1.0.5-maint (I don't know if Fedora 19 will end up on 1.0.5 or be able to rebase to 1.0.6, but it can't hurt). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
Laine Stump
-
Peter Krempa