SHA256
1
0
forked from cockpit/cockpit

Accepting request 1090518 from home:adamm:branches:systemsmanagement:cockpit

- new version 293:
  - https://cockpit-project.org/blog/cockpit-293.html
- refreshed: css-overrides.patch

- new version 292:
  - https://cockpit-project.org/blog/cockpit-292.html
- refreshed patches: css-overrides.patch, hide-pcp.patch,
  0001-selinux-allow-login-to-read-motd-file.patch

OBS-URL: https://build.opensuse.org/request/show/1090518
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:cockpit/cockpit?expand=0&rev=124
This commit is contained in:
2023-06-02 14:08:12 +00:00
committed by Git OBS Bridge
parent 480ac8c5ec
commit 6c8e1f745c
12 changed files with 2245 additions and 13787 deletions

View File

@@ -50,7 +50,7 @@ Summary: Web Console for Linux servers
License: LGPL-2.1-or-later
URL: https://cockpit-project.org/
Version: 276.1
Version: 293
Release: 0
Source0: cockpit-%{version}.tar
Source1: cockpit.pam
@@ -69,6 +69,11 @@ Patch5: storage-btrfs.patch
Patch101: hide-pcp.patch
Patch102: 0002-selinux-temporary-remove-setroubleshoot-section.patch
# Experimental Python support
%if !%{defined cockpit_enable_python}
%define cockpit_enable_python 0
%endif
# in RHEL 8 the source package is duplicated: cockpit (building basic packages like cockpit-{bridge,system})
# and cockpit-appstream (building optional packages like cockpit-{pcp})
# This split does not apply to EPEL/COPR nor packit c8s builds, only to our own
@@ -90,6 +95,13 @@ Patch102: 0002-selinux-temporary-remove-setroubleshoot-section.patch
%define build_optional 1
%endif
# Allow root login in Cockpit on RHEL 8 and lower as it also allows password login over SSH.
%if 0%{?rhel} && 0%{?rhel} <= 8
%define disallow_root 0
%else
%define disallow_root 1
%endif
# Ship custom SELinux policy (but not for cockpit-appstream)
%if 0%{?rhel} >= 9 || 0%{?fedora} || 0%{?suse_version}
%if "%{name}" == "cockpit"
@@ -173,12 +185,28 @@ Suggests: cockpit-pcp
%if 0%{?rhel} == 0
Recommends: (cockpit-networkmanager if NetworkManager)
# c-ostree is not in RHEL 8/9
Recommends: (cockpit-ostree if rpm-ostree)
Suggests: cockpit-selinux
%endif
%if 0%{?rhel} && 0%{?centos} == 0
Requires: subscription-manager-cockpit
%endif
%if %{cockpit_enable_python}
BuildRequires: python3-devel
BuildRequires: python3-pip
%if 0%{?rhel} == 0
# All of these are only required for running pytest (which we only do on Fedora)
BuildRequires: procps-ng
BuildRequires: pyproject-rpm-macros
BuildRequires: python3-pytest-asyncio
BuildRequires: python3-pytest-cov
BuildRequires: python3-pytest-timeout
BuildRequires: python3-tox-current-env
%endif
%endif
%prep
%setup -q -n cockpit-%{version} -a 3
%patch1 -p1
@@ -214,6 +242,9 @@ autoreconf -fvi -I tools
--docdir=%_defaultdocdir/%{name} \
%endif
--with-pamdir='%{pamdir}' \
%if %{cockpit_enable_python}
--enable-pybridge \
%endif
%if 0%{?build_basic} == 0
--disable-ssh \
%endif
@@ -226,6 +257,10 @@ bzip2 -9 cockpit.pp
%check
make -j$(nproc) check
%if %{cockpit_enable_python} && 0%{?rhel} == 0
%tox
%endif
%install
# In obs we get write error: stdout
%make_install | tee make_install.log
@@ -269,9 +304,6 @@ echo '%{_libexecdir}/cockpit-ssh' >> base.list
echo '%dir %{_datadir}/cockpit/pcp' > pcp.list
find %{buildroot}%{_datadir}/cockpit/pcp -type f >> pcp.list
echo '%dir %{_datadir}/cockpit/tuned' > system.list
find %{buildroot}%{_datadir}/cockpit/tuned -type f >> system.list
echo '%dir %{_datadir}/cockpit/shell' >> system.list
find %{buildroot}%{_datadir}/cockpit/shell -type f >> system.list
@@ -314,28 +346,30 @@ find %{buildroot}%{_datadir}/cockpit/static -type f >> static.list
# when not building basic packages, remove their files
%if 0%{?build_basic} == 0
for pkg in base1 branding motd kdump networkmanager selinux shell sosreport ssh static systemd tuned users metrics; do
for pkg in base1 branding motd kdump networkmanager selinux shell sosreport ssh static systemd users metrics; do
rm -r %{buildroot}/%{_datadir}/cockpit/$pkg
rm -f %{buildroot}/%{_datadir}/metainfo/org.cockpit-project.cockpit-${pkg}.metainfo.xml
done
for data in doc man pixmaps polkit-1; do
rm -r %{buildroot}/%{_datadir}/$data
done
for lib in systemd tmpfiles.d; do
rm -r %{buildroot}/%{_prefix}/%{__lib}/$lib
done
rm -r %{buildroot}/%{_prefix}/%{__lib}/tmpfiles.d
find %{buildroot}/%{_unitdir}/ -type f ! -name 'cockpit-session*' -delete
for libexec in cockpit-askpass cockpit-session cockpit-ws cockpit-tls cockpit-wsinstance-factory cockpit-client cockpit-client.ui cockpit-desktop cockpit-certificate-helper cockpit-certificate-ensure; do
rm %{buildroot}/%{_libexecdir}/$libexec
rm -f %{buildroot}/%{_libexecdir}/$libexec
done
rm -r %{buildroot}/%{_libdir}/security %{buildroot}/%{_sysconfdir}/motd.d %{buildroot}/%{_sysconfdir}/issue.d
rm -r %{buildroot}/%{_sysconfdir}/pam.d %{buildroot}/%{_sysconfdir}/motd.d %{buildroot}/%{_sysconfdir}/issue.d
%if 0%{?suse_version} > 1500
rm -r %{buildroot}/%{_pam_vendordir}
%else
rm -r %{buildroot}/%{_sysconfdir}/pam.d
%endif
rm %{buildroot}/usr/bin/cockpit-bridge
rm -f %{buildroot}/%{_libdir}/security/pam_*
rm -f %{buildroot}/usr/bin/cockpit-bridge
rm -f %{buildroot}%{_libexecdir}/cockpit-ssh
rm -f %{buildroot}%{_datadir}/metainfo/cockpit.appdata.xml
rm -rf %{buildroot}%{python3_sitelib}/cockpit/
rm -rf %{buildroot}%{python3_sitelib}/cockpit-%{version}.dist-info/
%endif
# when not building optional packages, remove their files
@@ -344,7 +378,9 @@ for pkg in apps packagekit pcp playground storaged; do
rm -rf %{buildroot}/%{_datadir}/cockpit/$pkg
done
# files from -tests
rm -r %{buildroot}/%{_prefix}/%{__lib}/cockpit-test-assets
rm -f %{buildroot}/%{pamdir}/mock-pam-conv-mod.so
rm -f %{buildroot}/%{_unitdir}/cockpit-session.socket
rm -f %{buildroot}/%{_unitdir}/cockpit-session@.service
# files from -pcp
rm -r %{buildroot}/%{_libexecdir}/cockpit-pcp %{buildroot}/%{_localstatedir}/lib/pcp/
# files from -storaged
@@ -381,6 +417,7 @@ cat kdump.list sosreport.list networkmanager.list selinux.list >> system.list
rm -f %{buildroot}%{_datadir}/metainfo/org.cockpit-project.cockpit-sosreport.metainfo.xml
rm -f %{buildroot}%{_datadir}/metainfo/org.cockpit-project.cockpit-kdump.metainfo.xml
rm -f %{buildroot}%{_datadir}/metainfo/org.cockpit-project.cockpit-selinux.metainfo.xml
rm -f %{buildroot}%{_datadir}/metainfo/org.cockpit-project.cockpit-networkmanager.metainfo.xml
rm -f %{buildroot}%{_datadir}/pixmaps/cockpit-sosreport.png
%endif
@@ -412,8 +449,6 @@ troubleshooting, interactive command-line sessions, and more.
Summary: Cockpit bridge server-side component
Requires: glib-networking
Provides: cockpit-ssh = %{version}-%{release}
# PR #10430 dropped workaround for ws' inability to understand x-host-key challenge
Conflicts: cockpit-ws < 181.x
# 233 dropped jquery.js, pages started to bundle it (commit 049e8b8dce)
Conflicts: cockpit-dashboard < 233
Conflicts: cockpit-networkmanager < 233
@@ -430,6 +465,10 @@ system on behalf of the web based user interface.
%doc %{_mandir}/man1/cockpit-bridge.1.gz
%{_bindir}/cockpit-bridge
%{_libexecdir}/cockpit-askpass
%if %{cockpit_enable_python}
%{python3_sitelib}/%{name}/
%{python3_sitelib}/%{name}-%{version}.dist-info/
%endif
%package doc
Summary: Cockpit deployment and developer guide
@@ -454,7 +493,9 @@ Requires: cockpit-bridge >= %{version}-%{release}
Requires: shadow-utils
%endif
Requires: grep
%if !0%{?sle_version}
Requires: /usr/bin/pwscore
%endif
Requires: /usr/bin/date
Provides: cockpit-shell = %{version}-%{release}
Provides: cockpit-systemd = %{version}-%{release}
@@ -478,6 +519,8 @@ Provides: cockpit-sosreport = %{version}-%{release}
Recommends: (reportd if abrt)
%endif
#NPM_PROVIDES
%description system
This package contains the Cockpit shell and system configuration interfaces.
@@ -530,6 +573,7 @@ authentication via sssd/FreeIPA.
# created in %post, so that users can rm the files
%ghost %{_sysconfdir}/issue.d/cockpit.issue
%ghost %{_sysconfdir}/motd.d/cockpit
%ghost %attr(0644, root, root) %{_sysconfdir}/cockpit/disallowed-users
%ghost %dir /run/cockpit
%ghost /run/cockpit/motd
%dir %{_datadir}/cockpit/motd
@@ -586,10 +630,16 @@ if [ -x %{_sbindir}/selinuxenabled ]; then
fi
# set up dynamic motd/issue symlinks on first-time install; don't bring them back on upgrades if admin removed them
# disable root login on first-time install; so existing installations aren't changed
if [ "$1" = 1 ]; then
mkdir -p /etc/motd.d /etc/issue.d
ln -s ../../run/cockpit/motd /etc/motd.d/cockpit
ln -s ../../run/cockpit/motd /etc/issue.d/cockpit.issue
printf "# List of users which are not allowed to login to Cockpit\n" > /etc/cockpit/disallowed-users
%if 0%{?disallow_root}
printf "root\n" >> /etc/cockpit/disallowed-users
%endif
chmod 644 /etc/cockpit/disallowed-users
fi
# switch old self-signed cert group from cockpit-wsintance to cockpit-ws on upgrade
if [ "$1" = 2 ]; then
@@ -606,7 +656,7 @@ fi
test -f %{_bindir}/firewall-cmd && firewall-cmd --reload --quiet || true
# check for deprecated PAM config
if grep --color=auto pam_cockpit_cert %{_sysconfdir}/pam.d/cockpit; then
if test -f %{_sysconfdir}/pam.d/cockpit && grep -q pam_cockpit_cert %{_sysconfdir}/pam.d/cockpit; then
echo '**** WARNING:'
echo '**** WARNING: pam_cockpit_cert is a no-op and will be removed in a'
echo '**** WARNING: future release; remove it from your /etc/pam.d/cockpit.'
@@ -685,6 +735,7 @@ BuildArch: noarch
The Cockpit component for managing networking. This package uses NetworkManager.
%files networkmanager -f networkmanager.list
%{_datadir}/metainfo/org.cockpit-project.cockpit-networkmanager.metainfo.xml
%endif
@@ -752,8 +803,8 @@ The Cockpit component for managing storage. This package uses udisks.
%package -n cockpit-tests
Summary: Tests for Cockpit
Requires: cockpit-bridge >= 138
Requires: cockpit-system >= 138
Requires: cockpit-bridge >= %{required_base}
Requires: cockpit-system >= %{required_base}
Requires: openssh-clients
Provides: cockpit-test-assets = %{version}-%{release}
@@ -762,7 +813,9 @@ This package contains tests and files used while testing Cockpit.
These files are not required for running Cockpit.
%files -n cockpit-tests -f tests.list
%{_prefix}/%{__lib}/cockpit-test-assets
%{pamdir}/mock-pam-conv-mod.so
%{_unitdir}/cockpit-session.socket
%{_unitdir}/cockpit-session@.service
%package devel
Summary: Development files for for Cockpit