SHA256
1
0
forked from cockpit/cockpit
Klaus Kämpf 2015-02-07 15:27:01 +00:00 committed by Git OBS Bridge
parent 71775674d7
commit 29c4404bbb
2 changed files with 91 additions and 2 deletions

8
add-genericname.patch Normal file
View File

@ -0,0 +1,8 @@
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-cockpit-0.38/src/ws/cockpit.desktop.in ./src/ws/cockpit.desktop.in
--- ../orig-cockpit-0.38/src/ws/cockpit.desktop.in 2015-01-09 13:41:41.000000000 +0100
+++ ./src/ws/cockpit.desktop.in 2015-02-07 15:29:04.307418107 +0100
@@ -7,3 +7,4 @@
Type=Application
Categories=GNOME;GTK;System;Profiling;
_Keywords=Remote;Administration;
+GenericName=Cockpit server manager

View File

@ -7,7 +7,7 @@
%define extra_flags CFLAGS='-O2 -Wall -Werror' %define extra_flags CFLAGS='-O2 -Wall -Werror'
%define selinux 1 %define selinux 1
%endif %endif
%if 0%{?fedora} <= 21 %if 0%{?fedora} > 0 && 0%{?fedora} <= 21
%define selinux 1 %define selinux 1
%endif %endif
%if 0%{?rhel} %if 0%{?rhel}
@ -23,7 +23,11 @@ Version: 0.38
Release: 1%{?dist} Release: 1%{?dist}
Summary: A user interface for Linux servers Summary: A user interface for Linux servers
%if 0%{?suse_version}
License: LGPL-2.1+
%else
License: LGPLv2+ License: LGPLv2+
%endif
URL: http://cockpit-project.org/ URL: http://cockpit-project.org/
%if %{defined gitcommit} %if %{defined gitcommit}
@ -32,6 +36,9 @@ Source0: cockpit-%{version}.tar.gz
Source0: https://github.com/cockpit-project/cockpit/releases/download/%{version}/cockpit-%{version}.tar.bz2 Source0: https://github.com/cockpit-project/cockpit/releases/download/%{version}/cockpit-%{version}.tar.bz2
%endif %endif
Source1: cockpit.pam Source1: cockpit.pam
%if 0%{?suse_version}
Patch1: add-genericname.patch
%endif
BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(gudev-1.0) BuildRequires: pkgconfig(gudev-1.0)
@ -49,13 +56,28 @@ BuildRequires: openssl-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: krb5-devel BuildRequires: krb5-devel
BuildRequires: libxslt-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
%{?systemd_requires}
BuildRequires: -systemd-mini
BuildRequires: -systemd-mini-devel
%else
BuildRequires: docbook-style-xsl BuildRequires: docbook-style-xsl
BuildRequires: keyutils-libs-devel BuildRequires: keyutils-libs-devel
BuildRequires: dbus-devel BuildRequires: dbus-devel
BuildRequires: pcp-libs-devel
%endif
BuildRequires: glib-networking BuildRequires: glib-networking
BuildRequires: systemd BuildRequires: systemd
BuildRequires: polkit BuildRequires: polkit
BuildRequires: pcp-libs-devel
%if %{defined gitcommit} %if %{defined gitcommit}
BuildRequires: npm BuildRequires: npm
@ -71,7 +93,11 @@ BuildRequires: sed
%endif %endif
# For documentation # For documentation
%if 0%{?suse_version}
BuildRequires: xmlto
%else
BuildRequires: /usr/bin/xmlto BuildRequires: /usr/bin/xmlto
%endif
Requires: %{name}-bridge = %{version}-%{release} Requires: %{name}-bridge = %{version}-%{release}
Requires: %{name}-daemon = %{version}-%{release} Requires: %{name}-daemon = %{version}-%{release}
@ -142,6 +168,9 @@ The Cockpit Web Service listens on the network, and authenticates users.
%if 0%{?fedora} == 20 %if 0%{?fedora} == 20
sed -i s/unconfined_service_t/unconfined_t/g src/ws/test-server.service.in sed -i s/unconfined_service_t/unconfined_t/g src/ws/test-server.service.in
%endif %endif
%if 0%{?suse_version}
%patch1 -p1
%endif
%build %build
%if %{defined gitcommit} %if %{defined gitcommit}
@ -164,9 +193,14 @@ make install-test-assets DESTDIR=%{buildroot}
mkdir -p %{buildroot}/%{_datadir}/polkit-1/rules.d mkdir -p %{buildroot}/%{_datadir}/polkit-1/rules.d
cp src/bridge/polkit-workarounds.rules %{buildroot}/%{_datadir}/polkit-1/rules.d cp src/bridge/polkit-workarounds.rules %{buildroot}/%{_datadir}/polkit-1/rules.d
%endif %endif
%if !0%{?suse_version}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/cockpit install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/cockpit
%endif
rm -f %{buildroot}/%{_libdir}/cockpit/*.so 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}/ install -p -m 644 AUTHORS COPYING README.md %{buildroot}%{_docdir}/%{name}/
%if %{defined selinux} %if %{defined selinux}
install -d %{buildroot}%{_datadir}/selinux/targeted install -d %{buildroot}%{_datadir}/selinux/targeted
@ -175,67 +209,112 @@ install -p -m 644 cockpit.pp %{buildroot}%{_datadir}/selinux/targeted/
%ifnarch x86_64 %ifnarch x86_64
rm -rf %{buildroot}/%{_datadir}/%{name}/docker rm -rf %{buildroot}/%{_datadir}/%{name}/docker
%endif %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
%endif
%files %files
%defattr(-,root,root)
%{_docdir}/%{name}/AUTHORS %{_docdir}/%{name}/AUTHORS
%{_docdir}/%{name}/COPYING %{_docdir}/%{name}/COPYING
%{_docdir}/%{name}/README.md %{_docdir}/%{name}/README.md
%if 0%{?suse_version}
%dir %{_datadir}/%{name}
%endif
%{_datadir}/appdata %{_datadir}/appdata
%{_datadir}/applications %{_datadir}/applications
%{_datadir}/pixmaps %{_datadir}/pixmaps
%files bridge %files bridge
%defattr(-,root,root)
%doc %{_mandir}/man1/cockpit-bridge.1.gz %doc %{_mandir}/man1/cockpit-bridge.1.gz
%{_bindir}/cockpit-bridge %{_bindir}/cockpit-bridge
%attr(4755, -, -) %{_libexecdir}/cockpit-polkit %attr(4755, -, -) %{_libexecdir}/cockpit-polkit
%if 0%{?suse_version}
%dir %{_libdir}/security
%endif
%{_libdir}/security/pam_reauthorize.so %{_libdir}/security/pam_reauthorize.so
%files daemon %files daemon
%defattr(-,root,root)
%doc %{_mandir}/man8/cockpitd.8.gz %doc %{_mandir}/man8/cockpitd.8.gz
%{_datadir}/dbus-1/services/com.redhat.Cockpit.service %{_datadir}/dbus-1/services/com.redhat.Cockpit.service
%{_libexecdir}/cockpitd %{_libexecdir}/cockpitd
%files doc %files doc
%defattr(-,root,root)
%exclude %{_docdir}/%{name}/AUTHORS
%exclude %{_docdir}/%{name}/COPYING
%exclude %{_docdir}/%{name}/README.md
%{_docdir}/%{name} %{_docdir}/%{name}
%files shell %files shell
%defattr(-,root,root)
%{_datadir}/%{name}/base %{_datadir}/%{name}/base
%{_datadir}/%{name}/shell %{_datadir}/%{name}/shell
%{_datadir}/%{name}/playground %{_datadir}/%{name}/playground
%{_datadir}/%{name}/server-systemd %{_datadir}/%{name}/server-systemd
%if !0%{?suse_version}
%post shell %post shell
# HACK - https://bugzilla.redhat.com/show_bug.cgi?id=1185749 # HACK - https://bugzilla.redhat.com/show_bug.cgi?id=1185749
( cd /var/lib/pcp/pmns && ./Rebuild -du ) ( cd /var/lib/pcp/pmns && ./Rebuild -du )
%endif
%files ws %files ws
%defattr(-,root,root)
%doc %{_mandir}/man5/cockpit.conf.5.gz %doc %{_mandir}/man5/cockpit.conf.5.gz
%doc %{_mandir}/man8/cockpit-ws.8.gz %doc %{_mandir}/man8/cockpit-ws.8.gz
%config(noreplace) %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}
%if !0%{?suse_version}
%config(noreplace) %{_sysconfdir}/pam.d/cockpit %config(noreplace) %{_sysconfdir}/pam.d/cockpit
%endif
%{_unitdir}/cockpit.service %{_unitdir}/cockpit.service
%{_unitdir}/cockpit.socket %{_unitdir}/cockpit.socket
%if 0%{?suse_version}
%dir %{_prefix}/lib/firewalld
%dir %{_prefix}/lib/firewalld/services
%endif
%{_prefix}/lib/firewalld/services/cockpit.xml %{_prefix}/lib/firewalld/services/cockpit.xml
%{_sbindir}/remotectl %{_sbindir}/remotectl
%{_libexecdir}/cockpit-ws %{_libexecdir}/cockpit-ws
%attr(4750, root, cockpit-ws) %{_libexecdir}/cockpit-session %attr(4750, root, cockpit-ws) %{_libexecdir}/cockpit-session
%if !0%{?suse_version}
%attr(775, -, wheel) %{_sharedstatedir}/%{name} %attr(775, -, wheel) %{_sharedstatedir}/%{name}
%endif
%{_datadir}/%{name}/static %{_datadir}/%{name}/static
%pre ws %pre ws
%if 0%{?suse_version}
%service_add_pre %{name}.service
%else
getent group cockpit-ws >/dev/null || groupadd -r cockpit-ws 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 / -s /sbin/nologin -c "User for cockpit-ws" cockpit-ws
%endif
%post ws %post ws
%if 0%{?suse_version}
%service_add_post %{name}.service
%else
%systemd_post cockpit.socket %systemd_post cockpit.socket
%endif
# firewalld only partially picks up changes to its services files without this # firewalld only partially picks up changes to its services files without this
test -f %{_bindir}/firewall-cmd && firewall-cmd --reload --quiet || true test -f %{_bindir}/firewall-cmd && firewall-cmd --reload --quiet || true
%preun ws %preun ws
%if 0%{?suse_version}
%service_del_preun %{name}.service
%else
%systemd_preun cockpit.socket %systemd_preun cockpit.socket
%endif
%postun ws %postun ws
%if 0%{?suse_version}
%service_del_postun %{name}.service
%else
%systemd_postun_with_restart cockpit.socket %systemd_postun_with_restart cockpit.socket
%endif
# Conditionally built packages below # Conditionally built packages below
@ -250,6 +329,7 @@ The Cockpit components for interacting with Docker and user interface.
This package is not yet complete. This package is not yet complete.
%files docker %files docker
%defattr(-,root,root)
%{_datadir}/%{name}/docker %{_datadir}/%{name}/docker
%endif %endif
@ -265,6 +345,7 @@ This package contains programs and other files for testing Cockpit, and
pulls in some necessary packages via dependencies. pulls in some necessary packages via dependencies.
%files test-assets %files test-assets
%defattr(-,root,root)
%{_datadir}/cockpit-test-assets %{_datadir}/cockpit-test-assets
%{_datadir}/polkit-1/rules.d %{_datadir}/polkit-1/rules.d
/usr/lib/systemd/system/cockpit-testing.service /usr/lib/systemd/system/cockpit-testing.service