File opensuse-ecsos-leap.spec of Package opensuse-ecsos-leap

#
# spec file for package opensuse-ecsos-leap
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           opensuse-ecsos-leap
Version:        1.3
Release:        0
Summary:        Rollback some various changes to meaningful settings bevor Leap16
License:        GPL-3.0-or-later
#URL:
Source1:        cockpit.desktop
Source90:       README.md
Source99:       %{name}-rpmlintrc
BuildRequires:  login_defs
BuildRequires:  sudo
BuildRequires:  zypper
BuildRequires:  pkgconfig(systemd)
Requires:       cronie
Requires:       firefox
Requires:       grub2-compat-ia32
Requires:       mc
Requires:       selinux-policy-targeted-gaming
Requires:       patterns-cockpit
Requires:       ecsos-virt-viewer
BuildArch:      noarch

%description
This package attempts to restore the familiar and proven configurations
and other things from before Leap 16 as far as possible.
In addition, cockpit is installed in such a way that it can be accessed via the menu.
Among other things: The first user is no longer root, familiar root behavior,
reactivation of 32-bit and installation of necessary SELinux settings for Steam.
Further rollbacks may follow.

%prep
#%%setup -q
cp -a %{SOURCE90} .

%build
# nothing to build


%install
# Generate new/old rights for sudoers
cat > ecsos-sudoers << EOF
# This will aktivate and rollback to the default UserRights
# as we knew them until Leap 15.6.
Defaults        targetpw
ALL             ALL = (ALL) ALL
EOF
install -Dm 0644 ecsos-sudoers %{buildroot}%{_sysconfdir}/sudoers.d/ecsos-sudoers

# Generate old login.defs, so user group is users again.
cat > ecsos-login.defs << EOF
# This will activate and rollback to the default USERGROUPS_ENAB = no
# and thus, a user once again receives the group = user and not the user group = username.
USERGROUPS_ENAB = no
EOF
install -Dm 0644 ecsos-login.defs %{buildroot}%{_sysconfdir}/login.defs.d/ecsos-login.defs

# Install cockpit desktop file
install -Dm 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/cockpit.desktop


%post
systemctl enable --now cockpit.socket ||:
systemctl enable --now sshd ||:

# Fix defect crontab
sed -i -e "s|run-parts /etc/cron|run-parts --regex \'.*sh$\' /etc/cron|g" /etc/crontab ||:


%postun


%files
#%%license add-license-file-here
%doc README.md
%config (noreplace) %{_sysconfdir}/sudoers.d/ecsos-sudoers
%config (noreplace) %{_sysconfdir}/login.defs.d/ecsos-login.defs
%{_datadir}/applications/cockpit.desktop

%changelog
openSUSE Build Service is sponsored by