name = systemd
version = 204
-release = 2
+release = 3
maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
groups = System/Base
python-cairo
python-dbus
python-gobject3
+ %{name}-libs=%{thisver}
%{name}-units=%{thisver}
util-linux>=2.19
end
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
+ /\<myhostname\>/ 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