2011-09-29 11:35:44 +02:00
|
|
|
#
|
|
|
|
# spec file for package systemd-presets-branding-openSUSE
|
|
|
|
#
|
2018-01-15 15:54:26 +01:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2011-09-29 11:35:44 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-12-10 08:47:44 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-09-29 11:35:44 +02:00
|
|
|
#
|
|
|
|
|
2011-10-07 14:57:22 +02:00
|
|
|
|
2016-12-12 13:42:29 +01:00
|
|
|
%define generic_name systemd-presets-branding
|
|
|
|
|
|
|
|
Name: %{generic_name}-openSUSE
|
2017-03-20 07:54:41 +01:00
|
|
|
Version: 12.2
|
2011-09-29 11:35:44 +02:00
|
|
|
Release: 0
|
2016-12-12 13:42:29 +01:00
|
|
|
Summary: Systemd default presets for openSUSE
|
2018-03-05 09:49:18 +01:00
|
|
|
License: GPL-2.0-or-later
|
2011-09-29 11:35:44 +02:00
|
|
|
Group: System/Base
|
2017-11-06 15:09:45 +01:00
|
|
|
Source1: default-openSUSE.preset
|
2016-12-12 13:42:29 +01:00
|
|
|
# FIXME: why systemd is required ?
|
2011-09-29 11:35:44 +02:00
|
|
|
BuildRequires: systemd
|
2011-10-16 11:53:08 +02:00
|
|
|
#!BuildIgnore: systemd-presets-branding
|
2016-06-03 16:56:16 +02:00
|
|
|
PreReq: coreutils
|
2018-03-01 09:25:36 +01:00
|
|
|
BuildRequires: systemd-presets-common-SUSE
|
|
|
|
Requires(pre): systemd-presets-common-SUSE
|
2016-12-12 13:42:29 +01:00
|
|
|
Provides: %{generic_name} = %{version}
|
2011-09-29 11:35:44 +02:00
|
|
|
Supplements: packageand(systemd:branding-openSUSE)
|
2016-12-12 13:42:29 +01:00
|
|
|
Conflicts: otherproviders(%{generic_name})
|
2011-09-29 11:35:44 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildArch: noarch
|
|
|
|
|
2016-12-12 13:42:29 +01:00
|
|
|
Requires(pre): bash
|
|
|
|
Requires(post): bash
|
|
|
|
|
2011-09-29 11:35:44 +02:00
|
|
|
%description
|
|
|
|
Default presets for systemd on openSUSE distribution.
|
|
|
|
|
2018-03-05 09:49:18 +01:00
|
|
|
These are the openSUSE specific presets. The default
|
2018-03-01 09:25:36 +01:00
|
|
|
presets needed for all SUSE based distributions can be
|
|
|
|
found in systemd-presets-branding-common-SUSE.
|
|
|
|
|
2011-09-29 11:35:44 +02:00
|
|
|
%prep
|
|
|
|
%setup -q -T -c
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
2016-12-12 13:42:29 +01:00
|
|
|
mkdir -p %{buildroot}%{_prefix}/lib/%{generic_name}
|
|
|
|
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-preset
|
2017-11-06 15:09:45 +01:00
|
|
|
# everything that must be enabled to have a working system.
|
|
|
|
# everything that must be enabled only in openSUSE
|
|
|
|
install -m644 %{SOURCE1} %{buildroot}%{_prefix}/lib/systemd/system-preset/90-default-openSUSE.preset
|
2011-09-29 11:35:44 +02:00
|
|
|
|
2016-12-12 13:42:29 +01:00
|
|
|
%pre
|
2017-02-10 12:03:01 +01:00
|
|
|
# On initial installation, branding-preset-states does not yet exist,
|
|
|
|
# which is why we also check for the file to be present/executable
|
2016-12-16 17:14:35 +01:00
|
|
|
if [ $1 -gt 1 -a -x %{_prefix}/lib/%{generic_name}/branding-preset-states ] ; then
|
2016-12-12 13:42:29 +01:00
|
|
|
#
|
|
|
|
# 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
|
2017-12-11 17:11:14 +01:00
|
|
|
elif [ $1 -eq 1 ]; then
|
|
|
|
touch /run/rpm-%{name}-preset-all
|
2016-12-12 13:42:29 +01:00
|
|
|
fi
|
2015-08-17 22:19:42 +02:00
|
|
|
|
2011-09-29 11:35:44 +02:00
|
|
|
%post
|
2016-12-12 13:42:29 +01:00
|
|
|
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
|
2011-09-29 11:35:44 +02:00
|
|
|
fi
|
|
|
|
|
2017-12-11 17:11:14 +01:00
|
|
|
%posttrans
|
|
|
|
if [ -f /run/rpm-%{name}-preset-all ]; then
|
2017-12-12 10:18:50 +01:00
|
|
|
# Enable all services, which were installed before systemd
|
|
|
|
# Don't disable services, since this would disable the
|
|
|
|
# complete network stack.
|
|
|
|
systemctl preset-all --preset-mode=enable-only
|
2017-12-11 17:11:14 +01:00
|
|
|
fi
|
|
|
|
rm -f /run/rpm-%{name}-preset-all
|
|
|
|
|
2011-09-29 11:35:44 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2016-12-12 13:42:29 +01:00
|
|
|
%{_prefix}/lib/%{generic_name}/
|
|
|
|
%{_prefix}/lib/systemd/system-preset/*
|
2011-09-29 11:35:44 +02:00
|
|
|
|
|
|
|
%changelog
|