100 lines
2.6 KiB
RPMSpec
100 lines
2.6 KiB
RPMSpec
# 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: 2
|
|
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-2.9
|
|
|
|
%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
|
|
* Fri Sep 24 2021 wutao <wutao61@huawei.com> - 0.15.0-2
|
|
- change ansible to ansible-2.9
|
|
|
|
* Tue Jul 06 2021 ningjin <ningjin@kylinos.cn> - 0.15.0-1
|
|
- package init
|