forked from pool/libvirt
- Fixup systemd support as per openSUSE systemd packaging
guidelines. OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=185
This commit is contained in:
parent
2caea9a03a
commit
ff2439ca46
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 4 16:41:32 MST 2012 - jfehlig@suse.com
|
||||||
|
|
||||||
|
- Fixup systemd support as per openSUSE systemd packaging
|
||||||
|
guidelines.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jan 3 09:20:43 MST 2012 - jfehlig@suse.com
|
Tue Jan 3 09:20:43 MST 2012 - jfehlig@suse.com
|
||||||
|
|
||||||
|
59
libvirt.spec
59
libvirt.spec
@ -152,6 +152,10 @@
|
|||||||
# All supported version of openSUSE/SLE contain audit
|
# All supported version of openSUSE/SLE contain audit
|
||||||
%define with_audit 0%{!?_without_audit:1}
|
%define with_audit 0%{!?_without_audit:1}
|
||||||
|
|
||||||
|
%if 0%{?suse_version} > 1140
|
||||||
|
%define with_systemd 0%{!?_without_systemd:1}
|
||||||
|
%endif
|
||||||
|
|
||||||
# Disable some drivers when building without libvirt daemon.
|
# Disable some drivers when building without libvirt daemon.
|
||||||
# The logic is the same as in configure.ac
|
# The logic is the same as in configure.ac
|
||||||
%if ! %{with_libvirtd}
|
%if ! %{with_libvirtd}
|
||||||
@ -311,7 +315,7 @@ BuildRequires: systemtap-sdt-devel
|
|||||||
BuildRequires: sanlock-devel >= 1.8
|
BuildRequires: sanlock-devel >= 1.8
|
||||||
%endif
|
%endif
|
||||||
%if %{with_systemd}
|
%if %{with_systemd}
|
||||||
BuildRequires: systemd-units
|
BuildRequires: systemd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: libvirt
|
Name: libvirt
|
||||||
@ -385,10 +389,7 @@ Recommends: device-mapper
|
|||||||
Requires: dmidecode
|
Requires: dmidecode
|
||||||
# For service management
|
# For service management
|
||||||
%if %{with_systemd}
|
%if %{with_systemd}
|
||||||
Requires(post): systemd-units
|
%{?systemd_requires}
|
||||||
Requires(post): systemd-sysv
|
|
||||||
Requires(preun): systemd-units
|
|
||||||
Requires(postun): systemd-units
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Source0: %{name}-%{version}.tar.bz2
|
Source0: %{name}-%{version}.tar.bz2
|
||||||
@ -725,7 +726,7 @@ export CFLAGS="$RPM_OPT_FLAGS"
|
|||||||
make V=1 %{?jobs:-j%jobs} DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name}
|
make V=1 %{?jobs:-j%jobs} DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%makeinstall SYSTEMD_UNIT_DIR=%{buildroot}%{_unitdir} DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name}
|
%makeinstall SYSTEMD_UNIT_DIR=%{_unitdir} DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name}
|
||||||
cp -a AUTHORS ChangeLog COPYING NEWS README TODO $RPM_BUILD_ROOT%{_docdir}/%{name}/
|
cp -a AUTHORS ChangeLog COPYING NEWS README TODO $RPM_BUILD_ROOT%{_docdir}/%{name}/
|
||||||
cd docs ; cp -a *.html $RPM_BUILD_ROOT%{_docdir}/%{name} ; cp -a *.png $RPM_BUILD_ROOT%{_docdir}/%{name} ; cd ..
|
cd docs ; cp -a *.html $RPM_BUILD_ROOT%{_docdir}/%{name} ; cp -a *.png $RPM_BUILD_ROOT%{_docdir}/%{name} ; cd ..
|
||||||
# remove currently unsupported locale(s)
|
# remove currently unsupported locale(s)
|
||||||
@ -786,6 +787,9 @@ install -m 644 %{S:2} $RPM_BUILD_ROOT/%{_fwdefdir}/libvirtd-relocation-server
|
|||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
|
%if %{with_systemd}
|
||||||
|
%service_add_pre libvirtd.service
|
||||||
|
%endif
|
||||||
%{_bindir}/getent group libvirt >/dev/null || \
|
%{_bindir}/getent group libvirt >/dev/null || \
|
||||||
%{_sbindir}/groupadd -r libvirt 2>/dev/null
|
%{_sbindir}/groupadd -r libvirt 2>/dev/null
|
||||||
|
|
||||||
@ -802,37 +806,22 @@ then
|
|||||||
> %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
> %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
||||||
fi
|
fi
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?sles_version}
|
|
||||||
%if %{with_systemd}
|
|
||||||
if [ $1 -eq 1 ] ; then
|
|
||||||
# Initial installation
|
|
||||||
/bin/systemctl enable libvirtd.service >/dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
%else # !systemd
|
|
||||||
%{fillup_and_insserv -y libvirtd}
|
|
||||||
%endif
|
|
||||||
%else # ! sles
|
|
||||||
%if %{with_systemd}
|
%if %{with_systemd}
|
||||||
|
%service_add_post libvirtd.service libvirt-guests.service
|
||||||
%else
|
%else
|
||||||
|
%if 0%{?sles_version}
|
||||||
|
%{fillup_and_insserv -y libvirtd}
|
||||||
|
%else # ! sles
|
||||||
%{fillup_only -n libvirtd}
|
%{fillup_only -n libvirtd}
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if %{with_systemd}
|
|
||||||
%else
|
|
||||||
%{fillup_only -n libvirt-guests}
|
%{fillup_only -n libvirt-guests}
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%if %{with_libvirtd}
|
%if %{with_libvirtd}
|
||||||
%if %{with_systemd}
|
%if %{with_systemd}
|
||||||
if [ $1 -eq 0 ] ; then
|
%service_del_preun libvirtd.service libvirt-guests.service
|
||||||
# Package removal, not upgrade
|
|
||||||
/bin/systemctl --no-reload disable libvirtd.service > /dev/null 2>&1 || :
|
|
||||||
/bin/systemctl stop libvirtd.service > /dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
%else
|
%else
|
||||||
%stop_on_removal libvirtd
|
%stop_on_removal libvirtd
|
||||||
%endif
|
%endif
|
||||||
@ -842,21 +831,7 @@ fi
|
|||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
%if %{with_libvirtd}
|
%if %{with_libvirtd}
|
||||||
%if %{with_systemd}
|
%if %{with_systemd}
|
||||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
%service_del_postun libvirtd.service libvirt-guests.service
|
||||||
if [ $1 -ge 1 ] ; then
|
|
||||||
# Package upgrade, not uninstall
|
|
||||||
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
%triggerun -- libvirt < 0.9.4
|
|
||||||
%{_bindir}/systemd-sysv-convert --save libvirtd >/dev/null 2>&1 ||:
|
|
||||||
|
|
||||||
# If the package is allowed to autostart:
|
|
||||||
/bin/systemctl --no-reload enable libvirtd.service >/dev/null 2>&1 ||:
|
|
||||||
|
|
||||||
# Run these because the SysV package being removed won't do them
|
|
||||||
/sbin/chkconfig --del libvirtd >/dev/null 2>&1 || :
|
|
||||||
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
|
|
||||||
%else
|
%else
|
||||||
%restart_on_update libvirtd
|
%restart_on_update libvirtd
|
||||||
%endif
|
%endif
|
||||||
|
@ -275,3 +275,37 @@ Index: libvirt-0.9.8/daemon/Makefile.am
|
|||||||
else
|
else
|
||||||
install-init-redhat:
|
install-init-redhat:
|
||||||
uninstall-init-redhat:
|
uninstall-init-redhat:
|
||||||
|
Index: libvirt-0.9.8/daemon/libvirtd.sysconf
|
||||||
|
===================================================================
|
||||||
|
--- libvirt-0.9.8.orig/daemon/libvirtd.sysconf
|
||||||
|
+++ libvirt-0.9.8/daemon/libvirtd.sysconf
|
||||||
|
@@ -1,16 +1,25 @@
|
||||||
|
+## Path: System/Virtualization/libvirt
|
||||||
|
+
|
||||||
|
+## Type: string
|
||||||
|
+## Default: /etc/libvirt/libvirtd.conf
|
||||||
|
# Override the default config file
|
||||||
|
# NOTE: This setting is no longer honoured if using
|
||||||
|
# systemd. Set '--config /etc/libvirt/libvirtd.conf'
|
||||||
|
# in LIBVIRTD_ARGS instead.
|
||||||
|
-#LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
|
||||||
|
+LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
|
||||||
|
|
||||||
|
-# Listen for TCP/IP connections
|
||||||
|
-# NB. must setup TLS/SSL keys prior to using this
|
||||||
|
-#LIBVIRTD_ARGS="--listen"
|
||||||
|
+## Type: string
|
||||||
|
+## Default: --listen
|
||||||
|
+# Arguments to pass to libvirtd
|
||||||
|
+LIBVIRTD_ARGS="--listen"
|
||||||
|
|
||||||
|
+## Type: string
|
||||||
|
+## Default: none
|
||||||
|
# Override Kerberos service keytab for SASL/GSSAPI
|
||||||
|
#KRB5_KTNAME=/etc/libvirt/krb5.tab
|
||||||
|
|
||||||
|
+## Type: string
|
||||||
|
+## Default: none
|
||||||
|
# Override the QEMU/SDL default audio driver probing when
|
||||||
|
# starting virtual machines using SDL graphics
|
||||||
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user