starter-kit/packaging/cockpit-starter-kit.spec.in
Martin Pitt 5aa20207b7 Move to PatternFly Elements and lit
PFE uses lit, so it makes sense to just use that for the main
application as well. Web components are pretty much React built into the
web platform, and lit adds some convenience around that.

This is mostly a demo -- for real Cockpit pages, PF Elements is still
missing too many components.
2024-11-19 08:30:09 +01:00

64 lines
1.6 KiB
RPMSpec

Name: cockpit-starter-kit
Version: %{VERSION}
Release: 1%{?dist}
Summary: Cockpit Starter Kit Example Module
License: LGPL-2.1-or-later
Source0: https://github.com/cockpit-project/starter-kit/releases/download/%{version}/%{name}-%{version}.tar.xz
Source1: https://github.com/cockpit-project/starter-kit/releases/download/%{version}/%{name}-node-%{version}.tar.xz
BuildArch: noarch
%if ! 0%{?suse_version}
ExclusiveArch: %{nodejs_arches} noarch
%endif
%if ! 0%{?rhel} || 0%{?rhel} >= 10
BuildRequires: nodejs >= 18
%endif
BuildRequires: make
%if 0%{?suse_version}
# Suse's package has a different name
BuildRequires: appstream-glib
%else
BuildRequires: libappstream-glib
%endif
BuildRequires: gettext
%if 0%{?rhel} && 0%{?rhel} <= 8
BuildRequires: libappstream-glib-devel
%endif
Requires: cockpit-bridge
%{NPM_PROVIDES}
%description
Cockpit Starter Kit Example Module
%prep
%autosetup -n %{name} -a 1
# ignore pre-built bundle in release tarball and rebuild it
# but keep it in RHEL/CentOS-8/9, as that has a too old nodejs
%if ! 0%{?rhel} || 0%{?rhel} >= 10
rm -rf dist
%endif
%build
NODE_ENV=production make
%install
%make_install PREFIX=/usr
# drop source maps, they are large and just for debugging
find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs --no-run-if-empty rm --verbose
%check
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*
# this can't be meaningfully tested during package build; tests happen through
# FMF (see plans/all.fmf) during package gating
%files
%doc README.md
%license LICENSE dist/index.js.LEGAL.txt
%{_datadir}/cockpit/*
%{_datadir}/metainfo/*
%changelog