%global asgen_jsdir %{_datadir}/appstream/templates/default/static/js # missing js dependencies ## TODO: One day, fix this? %bcond_without vendored_js Name: appstream-generator Version: 0.9.1 Release: 6%{?dist} Summary: Fast AppStream metadata generator License: LGPL-3.0-or-later AND MIT URL: https://github.com/ximion/%{name} Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # Generated by running the following commands # $ tar xvf %{name}-%{version}.tar.gz # $ cd %{name}-%{version}/contrib/setup # $ yarn install --no-bin-links --prod --no-lockfile --non-interactive # $ cd ../../ && tar czvf %{name}-nodemodules.tar.gz contrib/setup/node_modules Source1: %{name}-nodemodules.tar.gz BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(glibd-2.0) BuildRequires: pkgconfig(appstream) >= 1.0.0 BuildRequires: pkgconfig(appstream-compose) >= 1.0.0 BuildRequires: pkgconfig(lmdb) >= 0.9 BuildRequires: pkgconfig(libarchive) >= 3.2 BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: gir-to-d >= 0.18.0 BuildRequires: ldc >= 1:1.1.0 BuildRequires: meson >= 0.46.0 # For man pages BuildRequires: %{_bindir}/xsltproc BuildRequires: docbook-dtds BuildRequires: docbook-style-xsl %if %{with vendored_js} Provides: bundled(npm(Flot)) = 0.8.3 Provides: bundled(js-highlight) = 9.16.2 Provides: bundled(js-jquery) = 3.4.1 %else BuildRequires: npm(Flot) BuildRequires: js-highlight BuildRequires: js-jquery # For nodejs macros BuildRequires: nodejs-packaging # For JS macros BuildRequires: web-assets-devel Requires: npm(Flot) Requires: js-highlight Requires: js-jquery %endif ExclusiveArch: %{ldc_arches} Recommends: ffmpeg-free Recommends: optipng %description appstream-generator is a tool to generate distribution metadata from package repositories. It will extract icons, download screenshots, validate and transform the metadata, and return XML or YAML files that can be read by AppStream clients, such as software centers. It will also generate issue reports as JSON documents and HTML pages. %prep %setup -q %if %{with vendored_js} %setup -q -T -D -a 1 %endif %autopatch -p1 %build # Drop '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' as LDC doesn't support it export LDFLAGS="-Wl,-z,relro" # Export DFLAGS export DFLAGS="%{_d_optflags}" %meson -Ddownload-js=false %meson_build %install %meson_install %if ! %{with vendored_js} # link in JavaScript libraries... mkdir -p %{buildroot}%{asgen_jsdir}/jquery ln -srf %{buildroot}%{_jsdir}/jquery/latest/jquery.min.js %{buildroot}%{asgen_jsdir}/jquery/jquery.min.js mkdir -p %{buildroot}%{asgen_jsdir}/highlight ln -srf %{buildroot}%{_jsdir}/highlight.js/highlight.pack.js %{buildroot}%{asgen_jsdir}/highlight/highlight.pack.js ln -srf %{buildroot}%{nodejs_sitelib}/flot/ %{buildroot}%{asgen_jsdir}/flot %else # install vendored JavaScript libraries mkdir -p %{buildroot}%{asgen_jsdir}/jquery install contrib/setup/node_modules/jquery/dist/*.min.js -t %{buildroot}%{asgen_jsdir}/jquery mkdir -p %{buildroot}%{asgen_jsdir}/highlight install contrib/setup/node_modules/highlightjs/*.js -t %{buildroot}%{asgen_jsdir}/highlight mkdir -p %{buildroot}%{asgen_jsdir}/flot install contrib/setup/node_modules/jquery-flot/jquery.flot*.js -t %{buildroot}%{asgen_jsdir}/flot %endif %check %meson_test %files %license LICENSE %doc MAINTAINERS NEWS README.md TODO %{_bindir}/appstream-generator %{_mandir}/man1/appstream-generator.1* %{_datadir}/appstream/ %{_datadir}/metainfo/org.freedesktop.appstream.generator.metainfo.xml %changelog * Wed Dec 18 2024 Kalev Lember - 0.9.1-6 - Rebuilt for ldc 1.40 * Tue Aug 06 2024 Kalev Lember - 0.9.1-5 - Rebuilt for ldc 1.39 * Wed Jul 17 2024 Fedora Release Engineering - 0.9.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 0.9.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Fri Jan 19 2024 Fedora Release Engineering - 0.9.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Fri Nov 17 2023 Neal Gompa - 0.9.1-1 - Update to 0.9.1 final * Tue Nov 07 2023 Neal Gompa - 0.9.1~git20231008.4d2ebc3-1 - Bump to 0.9.1 git snapshot for AppStream 1.0 compatibility * Wed Jul 19 2023 Fedora Release Engineering - 0.8.8-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Jan 18 2023 Fedora Release Engineering - 0.8.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Wed Jul 27 2022 Kalev Lember - 0.8.8-2 - Rebuilt for ldc 1.30 * Wed Jul 27 2022 Neal Gompa - 0.8.8-1 - Update to 0.8.8 * Wed Jul 20 2022 Fedora Release Engineering - 0.8.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Sat Apr 16 2022 Neal Gompa - 0.8.7-1 - Update to 0.8.7 * Wed Jan 19 2022 Fedora Release Engineering - 0.8.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Sat Aug 28 2021 Neal Gompa - 0.8.5-1 - Update to 0.8.5 * Wed Aug 18 2021 Neal Gompa - 0.8.4-1 - Update to 0.8.4 (#1924378) * Wed Jul 21 2021 Fedora Release Engineering - 0.8.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Mon Feb 22 2021 Kalev Lember - 0.8.2-3 - Use ldc_arches macro rather than hardcoding supported arches - Rebuilt for ldc 1.25 * Tue Jan 26 2021 Fedora Release Engineering - 0.8.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Mon Sep 21 2020 Neal Gompa - 0.8.2-1 - Update to 0.8.2 (#1834975) * Mon Jul 27 2020 Fedora Release Engineering - 0.8.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Thu Mar 19 2020 Neal Gompa - 0.8.1-1 - Rebase to 0.8.1 (#1755095) - Vendor JavaScript components and declare as bundled * Tue Jan 28 2020 Fedora Release Engineering - 0.7.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Wed Jul 24 2019 Fedora Release Engineering - 0.7.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Tue Apr 16 2019 Neal Gompa - 0.7.7-1 - Update to 0.7.7 (#1674286) * Mon Feb 18 2019 Kalev Lember - 0.7.4-2 - Rebuilt for ldc 1.14 * Sat Feb 02 2019 Neal Gompa - 0.7.4-1 - Rebase to 0.7.4 (#1563877) * Thu Jan 31 2019 Fedora Release Engineering - 0.6.8-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Thu Jul 12 2018 Fedora Release Engineering - 0.6.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Mon Jul 09 2018 Kalev Lember - 0.6.8-2 - Rebuilt for ldc 1.11 * Wed Feb 21 2018 Neal Gompa - 0.6.8-1 - Update to 0.6.8 (#1544598) * Mon Feb 19 2018 Kalev Lember - 0.6.7-3 - Rebuilt for ldc 1.8 * Wed Feb 07 2018 Fedora Release Engineering - 0.6.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Sun Oct 8 2017 Neal Gompa - 0.6.7-1 - Initial packaging for Fedora (#1498468)