diff --git a/cockpit-ovirt-0.14.10.tar.gz b/cockpit-ovirt-0.14.10.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b838e7556217b4f2cb29a9546b048d4b8567b530 Binary files /dev/null and b/cockpit-ovirt-0.14.10.tar.gz differ diff --git a/cockpit-ovirt.spec b/cockpit-ovirt.spec new file mode 100644 index 0000000000000000000000000000000000000000..3b5c6ad385051169ce5cb85ed4cc621bead9dc3b --- /dev/null +++ b/cockpit-ovirt.spec @@ -0,0 +1,111 @@ +# Used for rpm-packaging of pre-bundled application with already resolved JS dependencies +%global _plugindir %{_datarootdir}/cockpit/ +%global _ovirtenginedir %{_datarootdir}/ovirt-engine +%global product oVirt +%global use_rhev %( test -z && echo 1 || echo 0) +%define debug_package %{nil} + + +%global source_basename cockpit-ovirt-0.14.10 + +Name: cockpit-ovirt +Version: 0.14.10 +Release: 1%{?release_suffix}%{?checkout}%{?dist} +Summary: Dashboard for Cockpit based on %{product} +License: ASL 2.0 +URL: https://gerrit.ovirt.org/gitweb?p=cockpit-ovirt.git;a=summary +Source0: http://resources.ovirt.org/pub/src/%{name}/%{source_basename}.tar.gz + + +%if 0%{?rhel} +ExclusiveArch: x86_64 +%else +BuildRequires: nodejs-packaging +ExclusiveArch: %{nodejs_arches} noarch +%endif + +%if 0%{?fedora} >= 30 +# On Fedora npm is not required anymore from nodejs +BuildRequires: npm +%endif +BuildRequires: nodejs + +# ovirt-engine-nodejs-modules >= 2.0.19 includes yarn. +BuildRequires: ovirt-engine-nodejs-modules >= 2.0.19 + +%if 0%{?enable_autotools} +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gettext-devel +%endif + +%package dashboard +Summary: Dashboard for Cockpit based on %{product} +BuildArch: noarch + + +Requires: cockpit +Requires: cockpit-storaged +Requires: ovirt-hosted-engine-setup >= 2.4.4 +Requires: otopi >= 1.9.0 + +Requires: ansible + +%description +This package provides a Cockpit dashboard for use with %{product}. + +%description dashboard +This package provides a Cockpit dashboard for use with %{product}. + +%prep +%setup -q -n %{source_basename} + +for d in dashboard ; do + pushd . + cd ${d} + %{_datadir}/ovirt-engine-nodejs-modules/setup-env.sh + popd +done + +# Copy the Node.js dependencies to the local "node_modules" directory +ln -s "%{_sharedstatedir}/ovirt-engine-nodejs-modules/node_modules" +ln -s "%{_sharedstatedir}/ovirt-engine-nodejs-modules/node_modules" ./dashboard/node_modules + +%build +%if 0%{?enable_autotools} +autoreconf -ivf +%endif + + +%if 0%{?use_rhev} +%configure --with-rhev +%else +%configure +%endif #END RHEV + +export PATH="./node_modules/.bin:${PATH}" +make + +%install +make install DESTDIR=%{buildroot} + +# Create /var/lib/ovirt-hosted-engine-setup/cockpit +install -dm 700 %{buildroot}%{_sharedstatedir}/ovirt-hosted-engine-setup/cockpit + +# Create cockpit conf file to disable inactivity timeout +mkdir -p %{buildroot}/etc/cockpit/ +cat <<__EOF__ >%{buildroot}/etc/cockpit/cockpit.conf +[Session] +IdleTimeout=0 +__EOF__ + +%files dashboard +%doc README.md +%license LICENSE +%config /etc/cockpit/cockpit.conf +%{_plugindir}/ovirt-dashboard +%dir %attr(700, root, root) %{_sharedstatedir}/ovirt-hosted-engine-setup/cockpit + +%changelog +Tue Jul 28 2020 jiangxinyu - 0.14.10-1 +- Init cockpit-ovirt project \ No newline at end of file