package init

This commit is contained in:
ningjin 2021-07-06 14:04:12 +08:00
parent c12245903b
commit 852863ab46
2 changed files with 96 additions and 0 deletions

BIN
cockpit-ovirt-0.15.0.tar.gz Normal file

Binary file not shown.

96
cockpit-ovirt.spec Normal file
View File

@ -0,0 +1,96 @@
# 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 oVirt && echo 1 || echo 0)
%global yarn_install no
%define debug_package %{nil}
%global source_basename cockpit-ovirt-0.15.0
Name: cockpit-ovirt
Version: 0.15.0
Release: 1
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
# nodejs-modules embeds yarn and requires nodejs
BuildRequires: ovirt-engine-nodejs-modules >= 2.0.45
%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.5.0
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}
%if "%{yarn_install}" == "yes"
%{warn:Building the rpm with a yarn online install is dangerous, use of ovirt-engine-nodejs-modules is highly recommended.}
%else
# Setup yarn and the nodejs-modules via ovirt-engine-nodejs-modules
pushd dashboard
source %{_datadir}/ovirt-engine-nodejs-modules/setup-env.sh
popd
%endif
%build
%if 0%{?enable_autotools}
autoreconf -ivf
%endif
export PATH="%{_datadir}/ovirt-engine-nodejs-modules/bin:${PATH}"
%if "%{yarn_install}" == "yes"
%configure --with-yarn-install
%else
%configure
%endif
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 06 2021 ningjin <ningjin@kylinos.cn> - 0.15.0-1
- package init