File cockpit-docker.spec of Package cockpit-docker

#
# Copyright (C) 2017-2020 Red Hat, Inc and 2023 Jewish Education Media.
#
# Cockpit-docker is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Cockpit-docker is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Cockpit-docker; If not, see <http://www.gnu.org/licenses/>.
#

Name:           cockpit-docker
Epoch:          1
Version:        16
Release:        0
Summary:        Cockpit component for docker containers
License:        LGPL-2.1-or-later
URL:            https://github.com/chabad360/cockpit-docker

Source0:        %{name}-%{version}.tar.xz
Source1:        %{name}-devel-%{version}.tar.xz
BuildArch:      noarch
%if 0%{?suse_version}
# Suse's package has a different name
BuildRequires:  appstream-glib
%else
BuildRequires:  libappstream-glib
%endif
BuildRequires:  make
BuildRequires: gettext
%if 0%{?rhel} && 0%{?rhel} <= 8
BuildRequires: libappstream-glib-devel
%endif

Requires:       cockpit-bridge
Requires:       (docker >= 24.0.0 or docker-ce >= 3:24.0.0)
# HACK https://github.com/containers/crun/issues/1091
%if 0%{?centos} == 9
Requires:       criu-libs
%endif

Source10:       package-lock.json
Source11:       node_modules.spec.inc
%include        %{_sourcedir}/node_modules.spec.inc
BuildRequires:  local-npm-registry

Source12:       provides_bundled.spec.inc
%include        %{_sourcedir}/provides_bundled.spec.inc

%description
The Cockpit user interface for docker containers.

%prep
%autosetup

# Use the -m option to prevent pkg/lib from being downloaded.
tar -Jxmf %{SOURCE1} --strip-components=1

local-npm-registry %{_sourcedir} install --with=dev --legacy-peer-deps

%build
NODE_ENV=production npm run build

%install
%make_install PREFIX=/usr
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*

%files
%doc README.md
%license LICENSE dist/index.js.LEGAL.txt dist/index.css.LEGAL.txt
%{_datadir}/cockpit/*
%{_datadir}/metainfo/*

%changelog
openSUSE Build Service is sponsored by