diff --git a/branding-symlinks.patch b/branding-symlinks.patch deleted file mode 100644 index d5564a3..0000000 --- a/branding-symlinks.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-cockpit-0.64/branding/centos/Makefile.am ./branding/centos/Makefile.am ---- ../orig-cockpit-0.64/branding/centos/Makefile.am 2015-06-22 18:12:23.000000000 +0200 -+++ ./branding/centos/Makefile.am 2015-10-14 11:56:47.720876974 +0200 -@@ -5,8 +5,7 @@ - branding/centos/bg-login.jpg \ - $(NULL) - --# Opportunistically use fedora-logos - install-data-hook:: -- $(LN_S) -f /usr/share/pixmaps/system-logo-white.png $(DESTDIR)$(centosbrandingdir)/logo.png -- $(LN_S) -f /usr/share/pixmaps/fedora-logo-sprite.png $(DESTDIR)$(centosbrandingdir)/apple-touch-icon.png -- $(LN_S) -f /etc/favicon.png $(DESTDIR)$(centosbrandingdir)/favicon.ico -+ $(LN_S) -f ../default/logo.png $(DESTDIR)$(centosbrandingdir)/logo.png -+ $(LN_S) -f ../default/apple-touch-icon.png $(DESTDIR)$(centosbrandingdir)/apple-touch-icon.png -+ $(LN_S) -f ../default/favicon.ico $(DESTDIR)$(centosbrandingdir)/favicon.ico -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-cockpit-0.64/branding/fedora/Makefile.am ./branding/fedora/Makefile.am ---- ../orig-cockpit-0.64/branding/fedora/Makefile.am 2015-06-22 18:12:23.000000000 +0200 -+++ ./branding/fedora/Makefile.am 2015-10-14 11:54:30.418787310 +0200 -@@ -5,8 +5,7 @@ - branding/fedora/bg-login.jpg \ - $(NULL) - --# Opportunistically use fedora-logos - install-data-hook:: -- $(LN_S) -f /usr/share/pixmaps/system-logo-white.png $(DESTDIR)$(fedorabrandingdir)/logo.png -- $(LN_S) -f /usr/share/pixmaps/fedora-logo-sprite.png $(DESTDIR)$(fedorabrandingdir)/apple-touch-icon.png -- $(LN_S) -f /etc/favicon.png $(DESTDIR)$(fedorabrandingdir)/favicon.ico -+ $(LN_S) -f ../default/logo.png $(DESTDIR)$(fedorabrandingdir)/logo.png -+ $(LN_S) -f ../default/apple-touch-icon.png $(DESTDIR)$(fedorabrandingdir)/apple-touch-icon.png -+ $(LN_S) -f ../default/favicon.ico $(DESTDIR)$(fedorabrandingdir)/favicon.ico -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-cockpit-0.64/branding/rhel/Makefile.am ./branding/rhel/Makefile.am ---- ../orig-cockpit-0.64/branding/rhel/Makefile.am 2015-06-22 18:12:23.000000000 +0200 -+++ ./branding/rhel/Makefile.am 2015-10-14 11:53:47.144867940 +0200 -@@ -5,8 +5,7 @@ - branding/rhel/bg-login.jpg \ - $(NULL) - --# Opportunistically use redhat-logos ... yes they're called 'fedora' - install-data-hook:: -- $(LN_S) -f /usr/share/pixmaps/system-logo-white.png $(DESTDIR)$(rhelbrandingdir)/logo.png -- $(LN_S) -f /usr/share/pixmaps/fedora-logo-sprite.png $(DESTDIR)$(rhelbrandingdir)/apple-touch-icon.png -- $(LN_S) -f /etc/favicon.png $(DESTDIR)$(rhelbrandingdir)/favicon.ico -+ $(LN_S) -f ../default/logo.png $(DESTDIR)$(rhelbrandingdir)/logo.png -+ $(LN_S) -f ../default/apple-touch-icon.png $(DESTDIR)$(rhelbrandingdir)/apple-touch-icon.png -+ $(LN_S) -f ../default/favicon.ico $(DESTDIR)$(rhelbrandingdir)/favicon.ico diff --git a/cockpit-0.79.tar.bz2 b/cockpit-0.79.tar.bz2 deleted file mode 100644 index 54da3b3..0000000 --- a/cockpit-0.79.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:485a93b5b69f1cb266c8e82a1c0f9b2bfd630edd225fb091395fd699c898c52d -size 3180479 diff --git a/cockpit-195.tar.xz b/cockpit-195.tar.xz new file mode 100644 index 0000000..070fc40 --- /dev/null +++ b/cockpit-195.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eaf55c9abe36b310e9d34094f9481021b6013bb5679e4e531020bc4c45d603b9 +size 12864016 diff --git a/cockpit-fedora.pam b/cockpit-fedora.pam deleted file mode 100644 index 946b745..0000000 --- a/cockpit-fedora.pam +++ /dev/null @@ -1,16 +0,0 @@ -#%PAM-1.0 -auth required pam_sepermit.so -auth substack password-auth -auth include postlogin -account required pam_nologin.so -account include password-auth -password include password-auth -# pam_selinux.so close should be the first session rule -session required pam_selinux.so close -session required pam_loginuid.so -# pam_selinux.so open should only be followed by sessions to be executed in the user context -session required pam_selinux.so open env_params -session optional pam_keyinit.so force revoke -session include password-auth -session include postlogin - diff --git a/cockpit-rpmlintrc b/cockpit-rpmlintrc new file mode 100644 index 0000000..a47651e --- /dev/null +++ b/cockpit-rpmlintrc @@ -0,0 +1,9 @@ +# False positive +addFilter('explicit-lib-dependency.*libvirt-client'); +# Do not break build in home: +setBadness('polkit-untracked-privilege', 100); +setBadness('invalid-filepath-dependency', 100); +setBadness('non-ghost-in-run', 100); +setBadness('permissions-file-setuid-bit', 100); +# hmh... +setBadness('non-position-independent-executable', 100); \ No newline at end of file diff --git a/cockpit-suse.pam b/cockpit-suse.pam deleted file mode 100644 index a94b3f9..0000000 --- a/cockpit-suse.pam +++ /dev/null @@ -1,7 +0,0 @@ -#%PAM-1.0 -auth required pam_unix2.so nullok -auth required pam_nologin.so -account required pam_unix2.so -password required pam_pwcheck.so nullok -password required pam_unix2.so nullok use_first_pass use_authtok -session required pam_unix2.so none diff --git a/cockpit.changes b/cockpit.changes index b0bdbca..7e5747b 100644 --- a/cockpit.changes +++ b/cockpit.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Fri Jun 21 13:44:05 UTC 2019 - Boris Manojlovic + +- updated to latest release 195 + +------------------------------------------------------------------- +Thu Mar 7 13:23:36 UTC 2019 - Alex + +- New upstream version - 189 + +------------------------------------------------------------------- +Mon Feb 4 18:24:55 UTC 2019 - aevseev@gmail.com + +- New upstream version - 186 + +------------------------------------------------------------------- +Wed Oct 24 13:37:31 UTC 2018 - aevseev@gmail.com + +- New upstream version - 180 + +------------------------------------------------------------------- +Fri Sep 7 10:24:09 UTC 2018 - aevseev@gmail.com + +- New upstream version - 177 + +------------------------------------------------------------------- +Mon Aug 27 08:28:01 UTC 2018 - aevseev@gmail.com + +- First build. Version - 176. + ------------------------------------------------------------------- Tue Oct 13 11:41:44 UTC 2015 - kkaempf@suse.com @@ -14,4 +44,3 @@ Tue Oct 13 11:41:44 UTC 2015 - kkaempf@suse.com Sat Feb 7 13:22:23 UTC 2015 - kkaempf@suse.com - Initial release 0.38 - diff --git a/cockpit.pam b/cockpit.pam new file mode 100644 index 0000000..9cbc8ed --- /dev/null +++ b/cockpit.pam @@ -0,0 +1,8 @@ +#%PAM-1.0 +auth substack common-auth +account required pam_nologin.so +account include common-account +password include common-password +session required pam_loginuid.so +session optional pam_keyinit.so force revoke +session include common-session diff --git a/cockpit.spec b/cockpit.spec index 9935b5b..e47a9c5 100644 --- a/cockpit.spec +++ b/cockpit.spec @@ -7,183 +7,541 @@ # # Check first cockpit-devel@lists.fedorahosted.org # -%if 0%{?suse_version} -%global tag 0.79 -%else # Globals that may be defined elsewhere -# * gitcommit xxxx -# * selinux 1 -# * tag 0.71 +# * Version 122 +# * wip 1 # -%endif -%define branding auto -%define rev 1 +# earliest base that the subpackages work on; the instances of this get computed/updated +# by tools/gen-spec-dependencies during "make dist", but keep a hardcoded fallback +%define required_base 122 -%if %{defined gitcommit} -%define extra_flags CFLAGS='-O2 -Wall -Werror -fPIC -g -DWITH_DEBUG' -%define branding default -%endif - -#Defaults for our SELinux policy toggle -%if %{undefined selinux} -%if %{defined gitcommit} -%define selinux 1 -%endif -%if 0%{?fedora} > 0 && 0%{?fedora} <= 21 -%define selinux 1 -%endif -%if 0%{?rhel} -%define selinux 1 -%endif +# we generally want CentOS packages to be like RHEL; special cases need to check %{centos} explicitly %if 0%{?centos} -%define rhel 0 +%define rhel %{centos} %endif + +%if "%{!?__python3:1}" +%define __python3 /usr/bin/python3 +%endif + +# for testing this already gets set in fedora.install, as we want the target +# VERSION_ID, not the mock chroot's one +%if "%{!?os_version_id:1}" +%define os_version_id %(. /etc/os-release; echo $VERSION_ID) %endif %define _hardened_build 1 -%define libssh_version 0.7.1 -%if 0%{?fedora} > 0 && 0%{?fedora} < 22 -%define libssh_version 0.6.0 +# define to build the dashboard +%define build_dashboard 1 + +# build basic packages like cockpit-bridge +%define build_basic 1 +# build optional extensions like cockpit-docker +%define build_optional 1 + +# cockpit's firewall service definition moved to firewalld +%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 +%define firewalld_service 0 +%else +%define firewalld_service 1 +%endif + +%define __lib lib + +# on RHEL 7.x we build subscriptions; superseded later by +# external subscription-manager-cockpit +%if (0%{?rhel} >= 7 && 0%{?rhel} < 8) && 0%{?centos} == 0 +%define build_subscriptions 1 +%endif + +# cockpit-kubernetes is RHEL 7 and Fedora < 30 only, and 64 bit arches only +%if (0%{?fedora} && 0%{?fedora} < 30) || (0%{?rhel} >= 7 && 0%{?rhel} < 8) +%ifarch aarch64 x86_64 ppc64le s390x +%define build_kubernetes 1 +%endif +%endif + +# cockpit-machines-ovirt is RHEL 7 and Fedora < 30 only +%if (0%{?fedora} && 0%{?fedora} < 30) || (0%{?rhel} >= 7 && 0%{?rhel} < 8) +%define build_ovirt 1 +%endif + +%if 0%{?rhel} >= 8 +%global go_scl_prefix go-toolset-7- +%else +%global go_scl_prefix %{nil} +%endif + +%if 0%{?rhel} >= 7 +%define vdo_on_demand 1 %endif Name: cockpit -%if %{defined gitcommit} -Version: %{gitcommit} -%else -Version: %{tag} -%endif -Release: %{rev}%{?dist} -Summary: A user interface for Linux servers +Summary: Web Console for Linux servers -%if 0%{?suse_version} -License: LGPL-2.1+ -%else License: LGPLv2+ -%endif -URL: http://cockpit-project.org/ +URL: https://cockpit-project.org/ -%if %{defined gitcommit} +Version: 195 +%if %{defined wip} +Release: 1.%{wip}%{?dist} Source0: cockpit-%{version}.tar.gz %else -Source0: https://github.com/cockpit-project/cockpit/releases/download/%{version}/cockpit-%{version}.tar.bz2 +Release: 1%{?dist} +Source0: https://github.com/cockpit-project/cockpit/releases/download/%{version}/cockpit-%{version}.tar.xz %endif -%if 0%{?suse_version} -Source1: cockpit-suse.pam -%else -Source1: cockpit-fedora.pam -%endif -# openSUSE doesn't carry Fedora branding pixmaps -Patch1: branding-symlinks.patch +Source1: cockpit.pam +BuildRequires: gcc BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(json-glib-1.0) BuildRequires: pkgconfig(polkit-agent-1) >= 0.105 BuildRequires: pam-devel BuildRequires: autoconf automake +%if 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?suse_version} > 1315 +BuildRequires: /usr/bin/python3 +%else + %if 0%{?suse_version} +BuildRequires: python-base + %else +BuildRequires: /usr/bin/python2 + %endif +%endif BuildRequires: intltool -BuildRequires: libssh-devel >= %{libssh_version} +%if %{defined build_dashboard} +BuildRequires: libssh-devel >= 0.7.1 +%endif BuildRequires: openssl-devel BuildRequires: zlib-devel BuildRequires: krb5-devel BuildRequires: libxslt-devel -%if 0%{?suse_version} -BuildRequires: -post-build-checks -BuildRequires: -rpmlint-mini -BuildRequires: -rpmlint-Factory -%define extra_flags CFLAGS='$(RPM_OPT_FLAGS)' -BuildRequires: update-desktop-files -BuildRequires: docbook-xsl-stylesheets -BuildRequires: keyutils-devel -BuildRequires: dbus-1-devel -BuildRequires: libpcp-devel -%else +%if 0%{?fedora} || 0%{?rhel} BuildRequires: docbook-style-xsl -BuildRequires: keyutils-libs-devel -BuildRequires: pcp-libs-devel %endif BuildRequires: glib-networking BuildRequires: sed BuildRequires: glib2-devel >= 2.37.4 BuildRequires: systemd-devel -BuildRequires: gdb -BuildRequires: glib-networking -BuildRequires: systemd -BuildRequires: polkit - - -%if %{defined gitcommit} -BuildRequires: npm -BuildRequires: nodejs -# For kerberos tests +%if 0%{?fedora} || 0%{?rhel} +BuildRequires: pcp-libs-devel +%else + %if 0%{?suse_version} +BuildRequires: libpcp-devel +BuildRequires: pcp-devel +BuildRequires: libpcp3 +BuildRequires: libpcp_import1 + %endif +%endif BuildRequires: krb5-server +BuildRequires: gdb +%if 0%{?fedora} || 0%{?rhel} +BuildRequires: openssh-clients %endif - -# For selinux -%if 0%{?selinux} -BuildRequires: selinux-policy-devel -BuildRequires: checkpolicy -BuildRequires: selinux-policy-doc -BuildRequires: sed -%endif - # For documentation BuildRequires: xmlto -Requires: %{name}-bridge = %{version}-%{release} -Requires: %{name}-networkmanager = %{version}-%{release} -Requires: %{name}-ws = %{version}-%{release} -Requires: %{name}-shell = %{version}-%{release} -Requires: %{name}-storaged = %{version}-%{release} -%ifarch x86_64 armv7hl -Requires: %{name}-docker = %{version}-%{release} +# This is the "cockpit" metapackage. It should only +# Require, Suggest or Recommend other cockpit-xxx subpackages + +Requires: cockpit-bridge +Requires: cockpit-ws +Requires: cockpit-system + +# Optional components +%if 0%{?fedora} || 0%{?rhel} >= 8 +%if 0%{?rhel} == 0 +Recommends: cockpit-dashboard +%ifarch x86_64 %{arm} aarch64 ppc64le i686 s390x +Recommends: (cockpit-docker if /usr/bin/docker) %endif -%if 0%{?rhel} -Requires: %{name}-subscriptions = %{version}-%{release} +%endif +Recommends: (cockpit-networkmanager if NetworkManager) +Recommends: (cockpit-storaged if udisks2) +Recommends: cockpit-packagekit +%if 0%{?rhel} >= 8 && 0%{?centos} == 0 +Recommends: subscription-manager-cockpit +%endif +Suggests: cockpit-pcp +%if 0%{?build_kubernetes} +Suggests: cockpit-kubernetes +%endif +Suggests: cockpit-selinux %endif +%prep +%setup -q -n cockpit-%{version} + +%build +exec 2>&1 +%configure \ + --disable-silent-rules \ + --with-cockpit-user=cockpit-ws \ + --with-selinux-config-type=etc_t \ +%if 0%{?rhel} >= 7 && 0%{?rhel} < 8 + --without-storaged-iscsi-sessions \ +%endif +%if 0%{?suse_version} + --docdir=%_defaultdocdir/%{name} \ + --with-pamdir='/%{_lib}/security' \ +%endif + --with-appstream-data-packages='[ "appstream-data" ]' \ + --with-nfs-client-package='"nfs-utils"' \ + %{?vdo_on_demand:--with-vdo-package='"vdo"'} +make -j4 %{?extra_flags} all + +%check +exec 2>&1 +%if ! 0%{?opensuse_bs} +make -j4 check +%else +echo "we are in Build service most test fail as no network" +%endif + +%install +make install DESTDIR=%{buildroot} +make install-tests DESTDIR=%{buildroot} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d +install -p -m 644 %{S:1} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/cockpit +rm -f %{buildroot}/%{_libdir}/cockpit/*.so +%if 0%{?firewalld_service} == 0 +rm -f %{buildroot}/%{_prefix}/%{__lib}/firewalld/services/cockpit.xml +%endif +mkdir -p $RPM_BUILD_ROOT%{_docdir}/cockpit/ +install -p -m 644 AUTHORS COPYING README.md %{buildroot}%{_docdir}/cockpit/ + +# Build the package lists for resource packages +echo '%dir %{_datadir}/cockpit/base1' > base.list +find %{buildroot}%{_datadir}/cockpit/base1 -type f >> base.list +echo '%{_sysconfdir}/cockpit/machines.d' >> base.list +echo %{buildroot}%{_datadir}/polkit-1/actions/org.cockpit-project.cockpit-bridge.policy >> base.list +# RHEL 7 needs to keep cockpit-ssh in dashboard for backwards compat +%if 0%{?rhel} == 7 +find %{buildroot}%{_datadir}/cockpit/ssh -type f >> dashboard.list +echo '%{_libexecdir}/cockpit-ssh' >> dashboard.list +%else +find %{buildroot}%{_datadir}/cockpit/ssh -type f >> base.list +echo '%{_libexecdir}/cockpit-ssh' >> base.list +%endif + +%if %{defined build_dashboard} +echo '%dir %{_datadir}/cockpit/dashboard' >> dashboard.list +find %{buildroot}%{_datadir}/cockpit/dashboard -type f >> dashboard.list +%else +rm -rf %{buildroot}/%{_datadir}/cockpit/dashboard +touch dashboard.list +%endif + +echo '%dir %{_datadir}/cockpit/pcp' >> pcp.list +find %{buildroot}%{_datadir}/cockpit/pcp -type f >> pcp.list + +echo '%dir %{_datadir}/cockpit/realmd' >> system.list +find %{buildroot}%{_datadir}/cockpit/realmd -type f >> system.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 + +echo '%dir %{_datadir}/cockpit/systemd' >> system.list +find %{buildroot}%{_datadir}/cockpit/systemd -type f >> system.list + +echo '%dir %{_datadir}/cockpit/users' >> system.list +find %{buildroot}%{_datadir}/cockpit/users -type f >> system.list + +echo '%dir %{_datadir}/cockpit/kdump' >> kdump.list +find %{buildroot}%{_datadir}/cockpit/kdump -type f >> kdump.list + +echo '%dir %{_datadir}/cockpit/sosreport' > sosreport.list +find %{buildroot}%{_datadir}/cockpit/sosreport -type f >> sosreport.list + +%if %{defined build_subscriptions} +echo '%dir %{_datadir}/cockpit/subscriptions' >> system.list +find %{buildroot}%{_datadir}/cockpit/subscriptions -type f >> system.list +%else +rm -rf %{buildroot}/%{_datadir}/cockpit/subscriptions +%endif + +echo '%dir %{_datadir}/cockpit/storaged' > storaged.list +find %{buildroot}%{_datadir}/cockpit/storaged -type f >> storaged.list + +echo '%dir %{_datadir}/cockpit/networkmanager' > networkmanager.list +find %{buildroot}%{_datadir}/cockpit/networkmanager -type f >> networkmanager.list + +echo '%dir %{_datadir}/cockpit/packagekit' >> packagekit.list +find %{buildroot}%{_datadir}/cockpit/packagekit -type f >> packagekit.list + +echo '%dir %{_datadir}/cockpit/apps' >> packagekit.list +find %{buildroot}%{_datadir}/cockpit/apps -type f >> packagekit.list + +echo '%dir %{_datadir}/cockpit/machines' > machines.list +find %{buildroot}%{_datadir}/cockpit/machines -type f >> machines.list + +%if 0%{?build_ovirt} +echo '%dir %{_datadir}/cockpit/ovirt' > ovirt.list +find %{buildroot}%{_datadir}/cockpit/ovirt -type f >> ovirt.list +%else +rm -rf %{buildroot}/%{_datadir}/cockpit/ovirt +touch ovirt.list +%endif + +echo '%dir %{_datadir}/cockpit/selinux' > selinux.list +find %{buildroot}%{_datadir}/cockpit/selinux -type f >> selinux.list + +echo '%dir %{_datadir}/cockpit/playground' > tests.list +find %{buildroot}%{_datadir}/cockpit/playground -type f >> tests.list + +%ifarch x86_64 %{arm} aarch64 ppc64le i686 s390x +%if 0%{?fedora} || 0%{?rhel} < 8 +echo '%dir %{_datadir}/cockpit/docker' > docker.list +find %{buildroot}%{_datadir}/cockpit/docker -type f >> docker.list +%else +rm -rf %{buildroot}/%{_datadir}/cockpit/docker +touch docker.list +%endif +%else +rm -rf %{buildroot}/%{_datadir}/cockpit/docker +touch docker.list +%endif + +%if 0%{?build_kubernetes} +%if %{defined wip} +%else +rm %{buildroot}/%{_datadir}/cockpit/kubernetes/override.json +%endif +echo '%dir %{_datadir}/cockpit/kubernetes' > kubernetes.list +find %{buildroot}%{_datadir}/cockpit/kubernetes -type f >> kubernetes.list +%else +rm -rf %{buildroot}/%{_datadir}/cockpit/kubernetes +rm -f %{buildroot}/%{_libexecdir}/cockpit-kube-auth +rm -f %{buildroot}/%{_libexecdir}/cockpit-kube-launch +rm %{buildroot}/%{_libexecdir}/cockpit-stub +touch kubernetes.list +%endif + +# when not building basic packages, remove their files +%if 0%{?build_basic} == 0 +for pkg in base1 branding motd kdump networkmanager realmd selinux shell sosreport ssh static systemd tuned users; do + rm -r %{buildroot}/%{_datadir}/cockpit/$pkg + rm -f %{buildroot}/%{_datadir}/metainfo/org.cockpit-project.cockpit-${pkg}.metainfo.xml +done +for data in doc locale man pixmaps polkit-1; do + rm -r %{buildroot}/%{_datadir}/$data +done +for lib in systemd tmpfiles.d firewalld; do + rm -r %{buildroot}/%{_prefix}/%{__lib}/$lib +done +for libexec in cockpit-askpass cockpit-session cockpit-ws cockpit-desktop; do + rm %{buildroot}/%{_libexecdir}/$libexec +done +rm -r %{buildroot}/%{_libdir}/security %{buildroot}/%{_sysconfdir}/pam.d %{buildroot}/%{_sysconfdir}/motd.d %{buildroot}/%{_sysconfdir}/issue.d +rm %{buildroot}/usr/bin/cockpit-bridge %{buildroot}/usr/sbin/remotectl +rm -f %{buildroot}%{_libexecdir}/cockpit-ssh +rm -f %{buildroot}%{_datadir}/metainfo/cockpit.appdata.xml +%endif + +# when not building optional packages, remove their files +%if 0%{?build_optional} == 0 +for pkg in apps dashboard docker kubernetes machines ovirt packagekit pcp playground storaged; do + rm -rf %{buildroot}/%{_datadir}/cockpit/$pkg +done +# files from -tests +rm -r %{buildroot}/%{_prefix}/%{__lib}/cockpit-test-assets %{buildroot}/%{_sysconfdir}/cockpit/cockpit.conf +# files from -pcp +rm -r %{buildroot}/%{_libexecdir}/cockpit-pcp %{buildroot}/%{_localstatedir}/lib/pcp/ +# files from -kubernetes +rm -f %{buildroot}/%{_libexecdir}/cockpit-kube-auth %{buildroot}/%{_libexecdir}/cockpit-kube-launch %{buildroot}/%{_libexecdir}/cockpit-stub +# files from -machines +rm -f %{buildroot}/%{_prefix}/share/metainfo/org.cockpit-project.cockpit-machines.metainfo.xml +# files from -storaged +rm -f %{buildroot}/%{_prefix}/share/metainfo/org.cockpit-project.cockpit-storaged.metainfo.xml +%endif + +%if 0%{?suse_version} +rm -rf %{buildroot}/%{_datadir}/cockpit/branding/fedora +rm -rf %{buildroot}/%{_datadir}/cockpit/branding/scientific +rm -rf %{buildroot}/%{_datadir}/cockpit/branding/rhel +rm -rf %{buildroot}/%{_datadir}/cockpit/branding/debian +rm -rf %{buildroot}/%{_datadir}/cockpit/branding/ubuntu +rm -rf %{buildroot}/%{_datadir}/cockpit/branding/centos +mkdir -p %{buildroot}/%{_rundir}/cockpit/ +touch %{buildroot}/%{_rundir}/cockpit/motd +%endif +sed -i "s|%{buildroot}||" *.list + +# Build the package lists for debug package, and move debug files to installed locations +find %{buildroot}/usr/src/debug%{_datadir}/cockpit -type f -o -type l > debug.partial +sed -i "s|%{buildroot}/usr/src/debug||" debug.partial +sed -n 's/\.map\(\.gz\)\?$/\0/p' *.list >> debug.partial +sed -i '/\.map\(\.gz\)\?$/d' *.list +tar -C %{buildroot}/usr/src/debug -cf - . | tar -C %{buildroot} -xf - +rm -rf %{buildroot}/usr/src/debug + +# On RHEL kdump, networkmanager, selinux, and sosreport are part of the system package +%if 0%{?rhel} +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}/pixmaps/cockpit-sosreport.png +%endif + +find %{buildroot} -name "*.map" -exec rm -v {} \; +%if 0%{?rhel} +rm -f %{buildroot}%{_datadir}/metainfo/org.cockpit-project.cockpit-selinux.metainfo.xml +%endif + +%if 0%{?build_basic} +%find_lang cockpit +%endif + +# dwz has trouble with the go binaries +# https://fedoraproject.org/wiki/PackagingDrafts/Go +%global _dwz_low_mem_die_limit 0 +%if 0%{?fedora} || 0%{?rhel} >= 8 +%global _debugsource_packages 1 +%global _debuginfo_subpackages 0 +%endif + +%define find_debug_info %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} %{?_debugsource_packages:-S debugsourcefiles.list} "%{_builddir}/%{?buildsubdir}" + +# Redefine how debug info is built to slip in our extra debug files +%define __debug_install_post \ + %{find_debug_info} \ + cat debug.partial >> %{_builddir}/%{?buildsubdir}/debugfiles.list \ +%{nil} + +# ------------------------------------------------------------------------------- +# Basic Sub-packages + +%if 0%{?build_basic} + %description -Cockpit runs in a browser and can manage your network of GNU/Linux -machines. +The Cockpit Web Console enables users to administer GNU/Linux servers using a +web browser. + +It offers network configuration, log inspection, diagnostic reports, SELinux +troubleshooting, interactive command-line sessions, and more. + +%files +%{_docdir}/cockpit/AUTHORS +%{_docdir}/cockpit/COPYING +%{_docdir}/cockpit/README.md +%dir %{_datadir}/cockpit +%{_datadir}/metainfo/cockpit.appdata.xml +%{_datadir}/pixmaps/cockpit.png +%doc %{_mandir}/man1/cockpit.1.gz +%dir %{_rundir}/cockpit +%dir %{_datadir}/metainfo +%ghost %{_rundir}/cockpit/motd %package bridge Summary: Cockpit bridge server-side component -Provides: %{name}-daemon -Obsoletes: %{name}-daemon < 0.48-2 -Requires: polkit +Requires: glib-networking +%if 0%{?rhel} != 7 +Provides: cockpit-ssh = %{version}-%{release} +# cockpit-ssh moved from dashboard to bridge in 171 +Conflicts: cockpit-dashboard < 170.x +# PR #10430 dropped workaround for ws' inability to understand x-host-key challenge +Conflicts: cockpit-ws < 181.x +%endif %description bridge The Cockpit bridge component installed server side and runs commands on the system on behalf of the web based user interface. +%files bridge -f base.list +%doc %{_mandir}/man1/cockpit-bridge.1.gz +%{_bindir}/cockpit-bridge +%{_libexecdir}/cockpit-askpass +%dir %{_sysconfdir}/cockpit +%dir %{_datadir}/cockpit/base1/fonts +%dir %{_datadir}/cockpit/ssh + %package doc Summary: Cockpit deployment and developer guide +BuildArch: noarch %description doc The Cockpit Deployment and Developer Guide shows sysadmins how to deploy Cockpit on their machines as well as helps developers who want to embed or extend Cockpit. -%package pcp -Summary: Cockpit PCP integration -Requires: %{name}-bridge = %{version}-%{release} -Requires: pcp +%files doc +%exclude %{_docdir}/cockpit/AUTHORS +%exclude %{_docdir}/cockpit/COPYING +%exclude %{_docdir}/cockpit/README.md +%{_docdir}/cockpit -%description pcp -Cockpit support for reading PCP metrics and loading PCP archives. +%package system +Summary: Cockpit admin interface package for configuring and troubleshooting a system +BuildArch: noarch +Requires: cockpit-bridge >= %{version}-%{release} +%if !0%{?suse_version} +Requires: shadow-utils +%endif +Requires: grep +Requires: libpwquality +Requires: /usr/bin/date +Provides: cockpit-realmd = %{version}-%{release} +Provides: cockpit-shell = %{version}-%{release} +Provides: cockpit-systemd = %{version}-%{release} +Provides: cockpit-tuned = %{version}-%{release} +Provides: cockpit-users = %{version}-%{release} +%if 0%{?rhel} +Provides: cockpit-networkmanager = %{version}-%{release} +Obsoletes: cockpit-networkmanager +Requires: NetworkManager +Provides: cockpit-kdump = %{version}-%{release} +Requires: kexec-tools +# Optional components (only when soft deps are supported) +%if 0%{?fedora} || 0%{?rhel} >= 8 +Recommends: polkit +%endif +%if 0%{?rhel} >= 8 +Recommends: NetworkManager-team +Recommends: setroubleshoot-server >= 3.3.3 +%endif +Provides: cockpit-selinux = %{version}-%{release} +Provides: cockpit-sosreport = %{version}-%{release} +%endif +%if %{defined build_subscriptions} +Provides: cockpit-subscriptions = %{version}-%{release} +Requires: subscription-manager >= 1.13 +%endif +# NPM modules which are also available as packages +Provides: bundled(js-jquery) = 3.4.0 +Provides: bundled(js-moment) = 2.24.0 +Provides: bundled(nodejs-flot) = 0.8.3 +Provides: bundled(nodejs-promise) = 8.0.3 +Provides: bundled(xstatic-bootstrap-datepicker-common) = 1.8.0 +Provides: bundled(xstatic-patternfly-common) = 3.58.0 + +%description system +This package contains the Cockpit shell and system configuration interfaces. + +%files system -f system.list +%dir %{_datadir}/cockpit/shell/images %package ws Summary: Cockpit Web Service Requires: glib-networking Requires: openssl Requires: glib2 >= 2.37.4 -%if 0%{?suse_version} -Requires: libssh4 >= %{libssh_version} +# RHEL/CentOS 7 has firewalld 0.6.x, but does not ship cockpit service +%if 0%{?rhel} != 7 +%if 0%{?firewalld_service} +Conflicts: firewalld >= 0.6.0-1 %else -Requires: libssh >= %{libssh_version} +Conflicts: firewalld < 0.6.0-1 +%endif +%endif +%if 0%{?fedora} || 0%{?rhel} >= 8 +Recommends: sscg >= 2.3 +Recommends: system-logos %endif Requires(post): systemd Requires(preun): systemd @@ -192,318 +550,103 @@ Requires(postun): systemd %description ws The Cockpit Web Service listens on the network, and authenticates users. -%prep -%setup -q -%if 0%{?fedora} == 20 - sed -i s/unconfined_service_t/unconfined_t/g src/ws/test-server.service.in -%endif -%if 0%{?suse_version} -%patch1 -p1 -%endif - -%build -%if %{defined gitcommit} -env NOCONFIGURE=1 ./autogen.sh -%endif -%configure --disable-static --disable-silent-rules --with-cockpit-user=cockpit-ws --with-branding=%{branding} -make -j %{?extra_flags} all -%if 0%{?selinux} -make selinux -%endif - -%check -# needs full network access, doesn't work in build service -%if 0%{?suse_version} == 0 -make -j check -%endif - -%install -make install DESTDIR=%{buildroot} -%if %{defined gitcommit} -make install-test-assets DESTDIR=%{buildroot} -mkdir -p %{buildroot}/%{_datadir}/polkit-1/rules.d -cp src/bridge/polkit-workarounds.rules %{buildroot}/%{_datadir}/polkit-1/rules.d -%else -rm -rf %{buildroot}/%{_datadir}/%{name}/playground -%endif -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d -install -p -m 644 tools/cockpit.pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/cockpit -rm -f %{buildroot}/%{_libdir}/cockpit/*.so -%if 0%{?suse_version} -install -d %{buildroot}%{_docdir}/%{name} -%endif -install -p -m 644 AUTHORS COPYING README.md %{buildroot}%{_docdir}/%{name}/ -%if 0%{?selinux} -install -d %{buildroot}%{_datadir}/selinux/targeted -install -p -m 644 cockpit.pp %{buildroot}%{_datadir}/selinux/targeted/ -%endif - -# Build the package lists for resource packages -echo '%dir %{_datadir}/%{name}/base1' > shell.list -find %{buildroot}%{_datadir}/%{name}/base1 -type f >> shell.list - -echo '%dir %{_datadir}/%{name}/dashboard' >> shell.list -find %{buildroot}%{_datadir}/%{name}/dashboard -type f >> shell.list - -echo '%dir %{_datadir}/%{name}/domain' >> shell.list -find %{buildroot}%{_datadir}/%{name}/domain -type f >> shell.list - -echo '%dir %{_datadir}/%{name}/shell' >> shell.list -find %{buildroot}%{_datadir}/%{name}/shell -type f >> shell.list - -echo '%dir %{_datadir}/%{name}/system' >> shell.list -find %{buildroot}%{_datadir}/%{name}/system -type f >> shell.list - -echo '%dir %{_datadir}/%{name}/users' >> shell.list -find %{buildroot}%{_datadir}/%{name}/users -type f >> shell.list - -echo '%dir %{_datadir}/%{name}/subscriptions' > subscriptions.list -find %{buildroot}%{_datadir}/%{name}/subscriptions -type f >> subscriptions.list - -echo '%dir %{_datadir}/%{name}/storage' > storaged.list -find %{buildroot}%{_datadir}/%{name}/storage -type f >> storaged.list - -echo '%dir %{_datadir}/%{name}/network' > networkmanager.list -find %{buildroot}%{_datadir}/%{name}/network -type f >> networkmanager.list - -%ifarch x86_64 armv7hl -echo '%dir %{_datadir}/%{name}/docker' > docker.list -find %{buildroot}%{_datadir}/%{name}/docker -type f >> docker.list -%else -rm -rf %{buildroot}/%{_datadir}/%{name}/docker -touch docker.list -%endif -%if 0%{?suse_version} -%suse_update_desktop_file -u -r -G 'Cockpit Server Manager' %{name} System Utility -mv %{buildroot}%{_datadir}/doc/%{name} %{buildroot}%{_docdir}/%{name}/html -ln -sf /sbin/service $RPM_BUILD_ROOT/usr/sbin/rc%{name} -# no firewalld on SUSE -rm -rf %{buildroot}%{_prefix}/lib/firewalld -# PAM security -install -d %{buildroot}/%{_lib}/security -mv %{buildroot}%{_libdir}/security/pam_reauthorize.so %{buildroot}/%{_lib}/security -rm -rf %{_libdir}/security -%endif - -%ifarch x86_64 -echo '%dir %{_datadir}/%{name}/kubernetes' > kubernetes.list -find %{buildroot}%{_datadir}/%{name}/kubernetes -type f >> kubernetes.list -%else -rm -rf %{buildroot}/%{_datadir}/%{name}/kubernetes -touch kubernetes.list -%endif - -sed -i "s|%{buildroot}||" *.list - -# Build the package lists for debug package, and move debug files to installed locations -find %{buildroot}/usr/src/debug%{_datadir}/%{name} -type f -o -type l > debug.list -sed -i "s|%{buildroot}/usr/src/debug||" debug.list -tar -C %{buildroot}/usr/src/debug -cf - . | tar -C %{buildroot} -xf - -rm -rf %{buildroot}/usr/src/debug - -# On RHEL subscriptions, networkmanager, and docker are part of the shell package -%if 0%{?rhel} -cat subscriptions.list docker.list networkmanager.list >> shell.list -%endif - -# Only strip out debug info in non wip builds -%if %{defined gitcommit} -%define find_debug_info %{nil} -%else -%define find_debug_info %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}" -%endif - -# .css, .html, and .html are minified/gzipped but somehow the originals remain -%if 0%{?suse_version} -rm -rf %{buildroot}%{_datadir}/%{name}/*/*.{css,js,mustache} -rm -rf %{buildroot}%{_datadir}/%{name}/*/index.html -rm -rf %{buildroot}%{_datadir}/%{name}/*/console.html -rm -rf %{buildroot}%{_datadir}/%{name}/*/operation.html -rm -rf %{buildroot}%{_datadir}/%{name}/*/shell.html -rm -rf %{buildroot}%{_datadir}/%{name}/*/logs.html -rm -rf %{buildroot}%{_datadir}/%{name}/*/terminal.html -rm -rf %{buildroot}%{_datadir}/%{name}/*/services.html -rm -rf %{buildroot}%{_datadir}/%{name}/kubernetes/views/*body.html -rm -rf %{buildroot}%{_datadir}/%{name}/kubernetes/views/*bar.html -rm -rf %{buildroot}%{_datadir}/%{name}/kubernetes/views/*page.html -rm -rf %{buildroot}%{_datadir}/%{name}/kubernetes/views/*panel.html -%endif - -# Redefine how debug info is built to slip in our extra debug files -%define __debug_install_post \ - %{find_debug_info} \ - cat debug.list >> %{_builddir}/%{?buildsubdir}/debugfiles.list \ -%{nil} - -%files -%if 0%{?suse_version} -%defattr(-,root,root) -%endif -%{_docdir}/%{name}/AUTHORS -%{_docdir}/%{name}/COPYING -%{_docdir}/%{name}/README.md -%dir %{_datadir}/%{name} -%{_datadir}/appdata -%{_datadir}/applications -%{_datadir}/pixmaps - -%files bridge -%if 0%{?suse_version} -%defattr(-,root,root) -%endif -%doc %{_mandir}/man1/cockpit-bridge.1.gz -%{_bindir}/cockpit-bridge -%attr(4755, -, -) %{_libexecdir}/cockpit-polkit -%if 0%{?suse_version} -/%{_lib}/security/pam_reauthorize.so -%else -%{_libdir}/security/pam_reauthorize.so -%endif - -%files doc -%if 0%{?suse_version} -%defattr(-,root,root) -%endif -%exclude %{_docdir}/%{name}/AUTHORS -%exclude %{_docdir}/%{name}/COPYING -%exclude %{_docdir}/%{name}/README.md -%{_docdir}/%{name} - -%files pcp -%{_libexecdir}/cockpit-pcp -%{_localstatedir}/lib/pcp/config/pmlogconf/tools/cockpit - -%post pcp -# HACK - https://bugzilla.redhat.com/show_bug.cgi?id=1185749 -( cd %{_localstatedir}/lib/pcp/pmns && ./Rebuild -du ) -# HACK - https://bugzilla.redhat.com/show_bug.cgi?id=1185764 -# We can't use "systemctl reload-or-try-restart" since systemctl might -# be out of sync with reality. -/usr/share/pcp/lib/pmlogger reload - -%files ws -%{_sbindir}/rccockpit -%if 0%{?suse_version} -%defattr(-,root,root) -%endif +%files ws -f cockpit.lang +%doc %{_mandir}/man1/cockpit-desktop.1.gz %doc %{_mandir}/man5/cockpit.conf.5.gz %doc %{_mandir}/man8/cockpit-ws.8.gz %doc %{_mandir}/man8/remotectl.8.gz %doc %{_mandir}/man8/pam_ssh_add.8.gz -%config(noreplace) %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/cockpit/ws-certs.d %config(noreplace) %{_sysconfdir}/pam.d/cockpit +%dir %{_sysconfdir}/issue.d +%config %{_sysconfdir}/issue.d/cockpit.issue +%config %{_sysconfdir}/motd.d/cockpit +%{_datadir}/cockpit/motd/update-motd +%{_datadir}/cockpit/motd/inactive.motd %{_unitdir}/cockpit.service +%{_unitdir}/cockpit-motd.service %{_unitdir}/cockpit.socket -%if !0%{?suse_version} -%{_prefix}/lib/firewalld/services/cockpit.xml +%if 0%{?firewalld_service} +%{_prefix}/%{__lib}/firewalld/services/cockpit.xml %endif +%{_prefix}/%{__lib}/tmpfiles.d/cockpit-tempfiles.conf %{_sbindir}/remotectl +%if 0%{?suse_version} +/%{_lib}/security/pam_ssh_add.so +%else %{_libdir}/security/pam_ssh_add.so -%{_libexecdir}/cockpit-ws -%attr(4750, root, cockpit-ws) %{_libexecdir}/cockpit-session -%if !0%{?suse_version} -%attr(775, -, wheel) %{_localstatedir}/lib/%{name} %endif -%{_datadir}/%{name}/static -%{_datadir}/%{name}/branding +%{_libexecdir}/cockpit-ws +%{_libexecdir}/cockpit-desktop +%attr(4750, root, cockpit-ws) %{_libexecdir}/cockpit-session +%attr(775, -, wheel) %{_localstatedir}/lib/cockpit +%{_datadir}/cockpit/static +%{_datadir}/cockpit/branding +%dir %{_sysconfdir}/cockpit +%dir %{_sysconfdir}/motd.d +%{_libexecdir}/firewalld +%{_libexecdir}/firewalld/services +%{_datadir}/cockpit/motd %pre ws -%if 0%{?suse_version} -%service_add_pre %{name}.service %{name}.socket -%endif getent group cockpit-ws >/dev/null || groupadd -r cockpit-ws -getent passwd cockpit-ws >/dev/null || useradd -r -g cockpit-ws -d / -s /sbin/nologin -c "User for cockpit-ws" cockpit-ws +getent passwd cockpit-ws >/dev/null || useradd -r -g cockpit-ws -d /nonexisting -s /sbin/nologin -c "User for cockpit-ws" cockpit-ws %post ws -%if 0%{?suse_version} -%service_add_post %{name}.service %{name}.socket -%else %systemd_post cockpit.socket -%endif # firewalld only partially picks up changes to its services files without this test -f %{_bindir}/firewall-cmd && firewall-cmd --reload --quiet || true %preun ws -%if 0%{?suse_version} -%service_del_preun %{name}.service %{name}.socket -%else %systemd_preun cockpit.socket -%endif %postun ws -%if 0%{?suse_version} -%service_del_postun %{name}.service %{name}.socket -%else %systemd_postun_with_restart cockpit.socket -%endif +%systemd_postun_with_restart cockpit.service -%package shell -Summary: Cockpit Shell user interface package -Requires: %{name}-bridge = %{version}-%{release} -%if 0%{?suse_version} -Requires: shadow -%else -Requires: shadow-utils -%endif -Requires: grep -Requires: libpwquality -Requires: /usr/bin/date -%if 0%{?rhel} -Provides: %{name}-subscriptions = %{version}-%{release} -Requires: subscription-manager >= 1.13 -Provides: %{name}-networkmanager = %{version}-%{release} -Requires: NetworkManager -%ifarch x86_64 armv7hl -Provides: %{name}-docker = %{version}-%{release} -Requires: docker >= 1.3.0 -%endif -%endif -Provides: %{name}-assets -Obsoletes: %{name}-assets < 0.32 -BuildArch: noarch - -%description shell -This package contains the Cockpit shell UI assets. - -%files shell -f shell.list -%if 0%{?suse_version} -%defattr(-,root,root) -%endif - -%package storaged -Summary: Cockpit user interface for storage, using Storaged -Requires: storaged >= 2.1.1 -Requires: storaged-lvm2 >= 2.1.1 -%if 0%{?suse_version} -Requires: multipath-tools -%else -Requires: device-mapper-multipath -%endif -BuildArch: noarch - -%description storaged -The Cockpit component for managing storage. This package uses Storaged. - -%files storaged -f storaged.list - -# Conditionally built packages below +# ------------------------------------------------------------------------------- +# Sub-packages that are part of cockpit-system in RHEL/CentOS, but separate in Fedora %if 0%{?rhel} == 0 -%package subscriptions -Summary: Cockpit subscription user interface package -Requires: subscription-manager >= 1.13 +%package kdump +Summary: Cockpit user interface for kernel crash dumping +Requires: cockpit-bridge >= 122 +Requires: cockpit-shell >= 122 +Requires: kexec-tools BuildArch: noarch -%description subscriptions -This package contains the Cockpit user interface integration with local -subscription management. +%description kdump +The Cockpit component for configuring kernel crash dumping. -%files subscriptions -f subscriptions.list +%files kdump -f kdump.list +%{_datadir}/metainfo/org.cockpit-project.cockpit-kdump.metainfo.xml + +%package sosreport +Summary: Cockpit user interface for diagnostic reports +Requires: cockpit-bridge >= 122 +Requires: cockpit-shell >= 122 +Requires: sos +BuildArch: noarch + +%description sosreport +The Cockpit component for creating diagnostic reports with the +sosreport tool. + +%files sosreport -f sosreport.list +%dir %{_datadir}/metainfo +%{_datadir}/metainfo/org.cockpit-project.cockpit-sosreport.metainfo.xml +%{_datadir}/pixmaps/cockpit-sosreport.png %package networkmanager Summary: Cockpit user interface for networking, using NetworkManager +Requires: cockpit-bridge >= 122 +Requires: cockpit-shell >= 122 Requires: NetworkManager +# Optional components (only when soft deps are supported) +%if 0%{?fedora} || 0%{?rhel} >= 8 +Recommends: NetworkManager-team +%endif BuildArch: noarch %description networkmanager @@ -511,96 +654,252 @@ The Cockpit component for managing networking. This package uses NetworkManager %files networkmanager -f networkmanager.list -%ifarch x86_64 armv7hl +%endif -%package docker +%if 0%{?rhel} == 0 + +%package selinux +Summary: Cockpit SELinux package +Requires: cockpit-bridge >= 122 +Requires: cockpit-shell >= 122 +%if 0%{?fedora} || 0%{?rhel} >= 8 +Requires: setroubleshoot-server >= 3.3.3 +%endif +BuildArch: noarch + +%description selinux +This package contains the Cockpit user interface integration with the +utility setroubleshoot to diagnose and resolve SELinux issues. + +%files selinux -f selinux.list +%dir %{_datadir}/metainfo +%{_datadir}/metainfo/org.cockpit-project.cockpit-selinux.metainfo.xml + +%endif + +%else # build basic packages + +# RPM requires this +%description +Dummy package from building optional packages only; never install or publish me. + +%endif # build basic packages + +# ------------------------------------------------------------------------------- +# Sub-packages that are optional extensions + +%if 0%{?build_optional} + +%package -n cockpit-storaged +Summary: Cockpit user interface for storage, using udisks +Requires: cockpit-shell >= 122 +Requires: udisks2 >= 2.6 +%if 0%{?rhel} == 7 +# Recommends: not supported in RHEL <= 7 +Requires: udisks2-lvm2 >= 2.6 +Requires: udisks2-iscsi >= 2.6 +Requires: device-mapper-multipath +Requires: python +Requires: python-dbus +%else +Recommends: udisks2-lvm2 >= 2.6 +Recommends: udisks2-iscsi >= 2.6 +Recommends: device-mapper-multipath +Recommends: clevis-luks +Requires: %{__python3} + %if !0%{?suse_version} +Requires: python3-dbus + %else + %if 0%{?suse_version} == 1315 +Requires: dbus-1-python + %else +Requires: python3-dbus-python + %endif + %endif +%endif +BuildArch: noarch + +%description -n cockpit-storaged +The Cockpit component for managing storage. This package uses udisks. + +%files -n cockpit-storaged -f storaged.list +%dir %{_datadir}/metainfo +%dir %{_datadir}/cockpit/storaged/images +%{_datadir}/metainfo/org.cockpit-project.cockpit-storaged.metainfo.xml + +%package -n cockpit-tests +Summary: Tests for Cockpit +Requires: cockpit-bridge >= 138 +Requires: cockpit-system >= 138 +Requires: openssh-clients +Provides: cockpit-test-assets = %{version}-%{release} + +%description -n cockpit-tests +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 +%config(noreplace) %{_sysconfdir}/cockpit/cockpit.conf +%{_prefix}/%{__lib}/cockpit-test-assets + +%package -n cockpit-machines +BuildArch: noarch +Summary: Cockpit user interface for virtual machines +Requires: cockpit-bridge >= 122 +Requires: cockpit-system >= 122 +%if 0%{?rhel} == 7 || 0%{?suse_version} +Requires: libvirt +%else +Requires: (libvirt-daemon-kvm or libvirt) +%endif +Requires: libvirt-client +%if 0%{?fedora} || 0%{?rhel} >= 8 +Requires: libvirt-dbus >= 1.2.0 +# Optional components +Recommends: virt-install +Recommends: libosinfo +Recommends: python3-gobject-base +%endif + +%description -n cockpit-machines +The Cockpit components for managing virtual machines. + +If "virt-install" is installed, you can also create new virtual machines. + +%files -n cockpit-machines -f machines.list +%dir %{_datadir}/metainfo +%{_datadir}/metainfo/org.cockpit-project.cockpit-machines.metainfo.xml + +%if 0%{?build_ovirt} + +%package -n cockpit-machines-ovirt +BuildArch: noarch +Summary: Cockpit user interface for oVirt virtual machines +Requires: cockpit-bridge >= 122 +Requires: cockpit-system >= 122 +%if 0%{?rhel} == 7 +Requires: libvirt +%else +Requires: (libvirt-daemon-kvm or libvirt) +%endif +Requires: libvirt-client + +%description -n cockpit-machines-ovirt +The Cockpit components for managing oVirt virtual machines. + +%files -n cockpit-machines-ovirt -f ovirt.list + +%endif + +%package -n cockpit-pcp +Summary: Cockpit PCP integration +Requires: cockpit-bridge >= 134.x +Requires: pcp + +%description -n cockpit-pcp +Cockpit support for reading PCP metrics and loading PCP archives. + +%files -n cockpit-pcp -f pcp.list +%{_libexecdir}/cockpit-pcp +%dir %{_localstatedir}/lib/pcp +%dir %{_localstatedir}/lib/pcp +%dir %{_localstatedir}/lib/pcp/config +%dir %{_localstatedir}/lib/pcp/config/pmlogconf +%dir %{_localstatedir}/lib/pcp/config/pmlogconf/tools +%{_localstatedir}/lib/pcp/config/pmlogconf/tools/cockpit +%post -n cockpit-pcp +# HACK - https://bugzilla.redhat.com/show_bug.cgi?id=1185764 +# We can't use "systemctl reload-or-try-restart" since systemctl might +# be out of sync with reality. +/usr/share/pcp/lib/pmlogger condrestart || true + +%if %{defined build_dashboard} +%package -n cockpit-dashboard +Summary: Cockpit remote servers and dashboard +%if 0%{?rhel} == 7 +Provides: cockpit-ssh = %{version}-%{release} +# nothing depends on the dashboard, but we can't use it with older versions of the bridge +Conflicts: cockpit-bridge < 135 +# PR #10430 dropped workaround for ws' inability to understand x-host-key challenge +Conflicts: cockpit-ws < 173.1 +%else +BuildArch: noarch +Requires: cockpit-ssh >= 135 +Conflicts: cockpit-ws < 135 +%endif + +%description -n cockpit-dashboard +Cockpit support for connecting to remote servers (through ssh), +bastion hosts, and a basic dashboard. + +%files -n cockpit-dashboard -f dashboard.list + +%endif + +%ifarch x86_64 %{arm} aarch64 ppc64le i686 s390x + +%if 0%{?fedora} || 0%{?rhel} < 8 +%package -n cockpit-docker Summary: Cockpit user interface for Docker containers -Requires: docker >= 1.3.0 +Requires: cockpit-bridge >= 122 +Requires: cockpit-shell >= 122 +Requires: /usr/bin/docker +Requires: /usr/lib/systemd/system/docker.service +%if 0%{?fedora} || 0%{?suse_version} +Requires: %{__python3} +%else +Requires: python2 +%endif -%description docker +%description -n cockpit-docker The Cockpit components for interacting with Docker and user interface. This package is not yet complete. -%files docker -f docker.list -%if 0%{?suse_version} -%defattr(-,root,root) -%endif +%files -n cockpit-docker -f docker.list +%dir %{_datadir}/cockpit/docker/images %endif - %endif -%ifarch x86_64 +%if 0%{?build_kubernetes} -%package kubernetes +%package -n cockpit-kubernetes Summary: Cockpit user interface for Kubernetes cluster Requires: /usr/bin/kubectl +# Requires: Needs newer localization support +Requires: cockpit-bridge >= 137.x +Requires: cockpit-shell >= 137.x +BuildRequires: %{go_scl_prefix}golang-bin +BuildRequires: %{go_scl_prefix}golang-src +Provides: cockpit-stub = %{version}-%{release} -%description kubernetes +%description -n cockpit-kubernetes The Cockpit components for visualizing and configuring a Kubernetes cluster. Installed on the Kubernetes master. This package is not yet complete. -%files kubernetes -f kubernetes.list - +%if 0%{?rhel} >= 8 +%enable_gotoolset7 %endif -%if %{defined gitcommit} - -%package test-assets -Summary: Additional stuff for testing Cockpit -Requires: openssh-clients - -%description test-assets -This package contains programs and other files for testing Cockpit, and -pulls in some necessary packages via dependencies. - -%files test-assets -%if 0%{?suse_version} -%defattr(-,root,root) -%endif -%{_datadir}/%{name}/playground -%{_datadir}/cockpit-test-assets -%{_datadir}/polkit-1/rules.d -%{_unitdir}/cockpit-testing.service -%{_unitdir}/cockpit-testing.socket -%{_unitdir}/test-server.service -%{_unitdir}/test-server.socket - +%files -n cockpit-kubernetes -f kubernetes.list +%{_libexecdir}/cockpit-kube-auth +%{_libexecdir}/cockpit-kube-launch +%{_libexecdir}/cockpit-stub %endif -%if 0%{?selinux} - -%package selinux-policy -Summary: SELinux policy for Cockpit testing -Requires: %{name} = %{version}-%{release} -Requires: selinux-policy -Requires: selinux-policy-targeted -Requires(post): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles -Requires(postun): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles +%package -n cockpit-packagekit +Summary: Cockpit user interface for packages BuildArch: noarch +Requires: cockpit-bridge >= 138 +Requires: PackageKit -%description selinux-policy -SELinux policy for Cockpit testing. +%description -n cockpit-packagekit +The Cockpit components for installing OS updates and Cockpit add-ons, +via PackageKit. -%files selinux-policy -%defattr(-,root,root,0755) -%{_datadir}/selinux/targeted/cockpit.pp +%files -n cockpit-packagekit -f packagekit.list -%post selinux-policy -/usr/sbin/semodule -s targeted -i %{_datadir}/selinux/targeted/cockpit.pp -/sbin/fixfiles -R cockpit restore || : -/sbin/fixfiles -R cockpit-test-assets restore || : -/sbin/restorecon -R %{_localstatedir}/lib/%{name} - -%postun selinux-policy -if [ $1 -eq 0 ] ; then - /usr/sbin/semodule -s targeted -r cockpit &> /dev/null || : - /sbin/fixfiles -R cockpit-selinux-policy restore || : - [ -d %{_localstatedir}/lib/%{name} ] && \ - /sbin/restorecon -R %{_localstatedir}/lib/%{name} &> /dev/null || : -fi - -%endif +%endif # build optional extension packages +# The changelog is automatically generated and merged %changelog -# Upstream changelog is empty