File systemd-presets-branding-SLE.spec of Package systemd-presets-branding-SLE
#
# spec file for package systemd-presets-branding-SLE
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: systemd-presets-branding-SLE
Version: 12.1
Release: 0
Summary: systemd default presets for SUSE Linux Enterprise
License: ISC
Group: System/Base
Source0: default-SLE.preset
Source1: 99-default-disable.preset
BuildRequires: systemd
#!BuildIgnore: systemd-presets-branding
Provides: systemd-presets-branding = %{version}
Supplements: packageand(systemd:branding-SLE)
Conflicts: otherproviders(systemd-presets-branding)
# For the stuff that the systemd_preset_pre macro does.
PreReq: coreutils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
Default presets for systemd on openSUSE distribution.
%prep
%setup -q -T -c
%build
%install
mkdir -p %{buildroot}/usr/lib/systemd/system-preset
install -m644 %{SOURCE0} %{buildroot}/usr/lib/systemd/system-preset/90-default-SLE.preset
install -m644 %{SOURCE1} %{buildroot}/usr/lib/systemd/system-preset/
%pre -p /bin/bash
# This macro thing doesn't rely on systemctl.
%systemd_preset_pre
# HACK: uuidd has its own preset file that was introduced in SLE12
# Update, but preset was deliberately never called. Upgrade to SLE12
# SP1 means a major update, and we want to perform one-shot preset
# (bnc#900935#c46, FATE#318949). uuidd package itself has no chance to
# do it, as there are no differences in the package. Attempt to detect
# SLE12 Update -> SLE12 SP1 and force preset. Use smartd fix as an
# indicator of SLE12 Update and older.
if test -f /usr/lib/systemd/system-preset/90-default-SLE.preset ; then
if ! grep -q smartd /usr/lib/systemd/system-preset/90-default-SLE.preset ; then
sed -i 's/enable uuidd.service/disable uuidd.service/' /usr/lib/systemd/system-preset/systemd_preset-old.rpm-tmp
fi
fi
%posttrans -p /bin/bash
# Assume systemctl is installed at this point.
%systemd_preset_posttrans
%files
%defattr(-,root,root)
%dir /usr/lib/systemd
%dir /usr/lib/systemd/system-preset/
/usr/lib/systemd/system-preset/90-default-SLE.preset
/usr/lib/systemd/system-preset/99-default-disable.preset
%changelog