From 519776fd6f0d5cd4903e8703c25cac8abaee028b Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Thu, 13 Jun 2013 22:18:34 +0200 Subject: [PATCH] systemd: Fix conflict with nss-myhostname. nss-myhostname has become a part of systemd since version 201. So the old nss-myhostname package is obsolet and can be dropped. Fixes #10370. --- systemd/systemd.nm | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/systemd/systemd.nm b/systemd/systemd.nm index cc9c0562c..5d971f9e0 100644 --- a/systemd/systemd.nm +++ b/systemd/systemd.nm @@ -5,7 +5,7 @@ name = systemd version = 204 -release = 2 +release = 3 maintainer = Stefan Schantl groups = System/Base @@ -140,6 +140,7 @@ packages python-cairo python-dbus python-gobject3 + %{name}-libs=%{thisver} %{name}-units=%{thisver} util-linux>=2.19 end @@ -273,6 +274,49 @@ packages package %{name}-libs template LIBS + + groups += Base + + prerequires + /etc/nsswitch.conf + end + + provides + nss-myhostname = %{thisver} + end + + obsoletes + nss-myhostname <= 0.3-3 + end + + conflicts + nss-myhostname <= 0.3-3 + + # Ensure that the version of systemd matches systemd-libs. + systemd > %{thisver} + systemd < %{thisver} + end + + # Add myhostname to the hosts line of /etc/nsswitch.conf + script postin + if [ -f "/etc/nsswitch.conf" ]; then + sed -i.bak -e ' + /^hosts:/ !b + /\/ b + s/[[:blank:]]*$/ myhostname/ + ' /etc/nsswitch.conf + fi + end + + # Remove myhostname from the hosts line of /etc/nsswitch.conf + script postun + if [ -f "/etc/nsswitch.conf" ]; then + sed -i.bak -e ' + /^hosts:/ !b + s/[[:blank:]]\+myhostname\>// + ' /etc/nsswitch.conf + fi + end end package %{name}-devel -- 2.47.3