systemd-presets-branding-op.../systemd-presets-branding-openSUSE.spec
Marcus Meissner 38ce564eef Accepting request 445123 from home:fbui:branches:Base:System
- Import preset macros from systemd-rpm-macro and convert them into
  scripts.
  Presets are not supposed to be shipped by other packages as the
  default policy needs to be reviewed by the secteam. Therefore don't
  encourage packagers to do that and make those macros private to this
  package.
  Also convert them into real scripts so they're much easier to
  maintain and debug. Also working in %posttrans is unneeded as this
  package is assumed to be the only one to update the preset.

- There's no need to reload the daemon configuration as presets are
  not part of the dameon config.

OBS-URL: https://build.opensuse.org/request/show/445123
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-presets-branding-openSUSE?expand=0&rev=83
2016-12-12 12:42:29 +00:00

84 lines
2.5 KiB
RPMSpec

#
# spec file for package systemd-presets-branding-openSUSE
#
# 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/
#
%define generic_name systemd-presets-branding
Name: %{generic_name}-openSUSE
Version: 0.3.0
Release: 0
Summary: Systemd default presets for openSUSE
License: GPL-2.0+
Group: System/Base
Source0: default-openSUSE.preset
Source1: 99-default-disable.preset
Source2: branding-preset-states
# FIXME: why systemd is required ?
BuildRequires: systemd
#!BuildIgnore: systemd-presets-branding
PreReq: coreutils
Provides: %{generic_name} = %{version}
Supplements: packageand(systemd:branding-openSUSE)
Conflicts: otherproviders(%{generic_name})
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Requires(pre): bash
Requires(post): bash
%description
Default presets for systemd on openSUSE distribution.
%prep
%setup -q -T -c
%build
%install
mkdir -p %{buildroot}%{_prefix}/lib/%{generic_name}
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-preset
install -m644 %{SOURCE0} %{buildroot}%{_prefix}/lib/systemd/system-preset/90-default-openSUSE.preset
install -m644 %{SOURCE1} %{buildroot}%{_prefix}/lib/systemd/system-preset/
install -m755 %{SOURCE2} %{buildroot}%{_prefix}/lib/%{generic_name}/
%pre
if [ $1 -gt 1 ] ; then
#
# Save the old state so we can detect which package have its
# default changed later.
#
# Note: the old version of the script is used here.
#
%{_prefix}/lib/%{generic_name}/branding-preset-states save
fi
%post
if [ $1 -gt 1 ] ; then
#
# Now that the updated presets are installed, find the ones
# that have been changed and apply "systemct preset" on them.
#
%{_prefix}/lib/%{generic_name}/branding-preset-states apply-changes
fi
%files
%defattr(-,root,root)
%{_prefix}/lib/%{generic_name}/
%{_prefix}/lib/systemd/system-preset/*
%changelog