File cockpit-docker.spec of Package cockpit-docker
#
# spec file for package cockpit-docker
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: cockpit-docker
Version: 16
Release: 0%{?dist}
Summary: Cockpit module for docker containers
License: LGPL-2.1-or-later
Group: System/Management
URL: https://github.com/chabad360/cockpit-docker
Source: %{name}-%{version}.tar.xz
# Generate package-lock.json with: npm install --package-lock-only --legacy-peer-deps
Source10: package-lock.json
Source11: node_modules.spec.inc
Source12: cockpit-po-plugin.js
%include %_sourcedir/node_modules.spec.inc
Patch1: systemd_path.patch
Patch2: docker-api-version.patch
BuildArch: noarch
BuildRequires: appstream-glib
BuildRequires: cockpit-devel >= 293
BuildRequires: local-npm-registry
BuildRequires: make
BuildRequires: sed
Requires: cockpit-bridge
Requires: docker >= 24.0.0
%description
This is the Cockpit user interface for docker containers.
The Cockpit team from RedHat stopped caring in version 215,
declaring they going 'in favor' of podman.
%prep
%autosetup -p1
mkdir -p pkg
cp -r %{_datadir}/cockpit/devel/lib pkg/lib
cp %{SOURCE12} pkg/lib
rm -rf package-lock.json node_modules
local-npm-registry %{_sourcedir} install --include=dev --ignore-scripts
%build
mkdir -p pkg
NODE_ENV=production npm run build
%install
export PREFIX=%{_prefix}
%make_install
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*
# drop source maps, they are large and just for debugging
find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs --no-run-if-empty rm --verbose
%files
%doc README.md
%license LICENSE dist/index.js.LEGAL.txt dist/index.css.LEGAL.txt
%{_datadir}/cockpit
%{_datadir}/metainfo/*
%changelog