starter-kit/packaging/cockpit-starter-kit.spec.in
Pino Toscano 4377c4fe19 po: merge translations for metainfo file
When installing the module, instead of copying the metainfo file to the
destination, merge the available translations for it. Since this is done
at install time, add gettext as BuildRequires for the RPM packaging;
add libappstream-glib-devel as well only on RHEL/CentOS 8, since it
contains the metainfo.its for gettext in order to handle .metainfo.xml
files.

This requires a LINGUAS file with the list of translations currently
available: this is the way msgfmt picks the available languages to
merge. Generate it dynamically from the list of available .po files.
2022-03-09 16:02:26 +01:00

45 lines
1.1 KiB
RPMSpec

Name: cockpit-starter-kit
Version: %{VERSION}
Release: 1%{?dist}
Summary: Cockpit Starter Kit Example Module
License: LGPLv2+
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
BuildRequires: nodejs
BuildRequires: make
BuildRequires: libappstream-glib
BuildRequires: gettext
%if 0%{?rhel} && 0%{?rhel} <= 8
BuildRequires: libappstream-glib-devel
%endif
Requires: cockpit-system
%description
Cockpit Starter Kit Example Module
%prep
%setup -q -n %{name}
%setup -q -a 1 -n %{name}
%build
# ignore pre-built webpack in release tarball and rebuild it
rm -rf dist
NODE_ENV=production make
%install
%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.LICENSE.txt.gz
%{_datadir}/cockpit/*
%{_datadir}/metainfo/*
%changelog