From 04c91a87954c2fc42ba0e062e1307c437b5691fd Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Mar 19 2020 23:41:17 +0000 Subject: Rebase to 0.8.1 (#1755095) - Vendor JavaScript components and declare as bundled --- diff --git a/.gitignore b/.gitignore index dea69f2..a3451ff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /appstream-generator-0.6.8.tar.gz /appstream-generator-0.7.4.tar.gz /appstream-generator-0.7.7.tar.gz +/appstream-generator-0.8.1.tar.gz +/appstream-generator-nodemodules.tar.gz diff --git a/appstream-generator.spec b/appstream-generator.spec index a4273c0..e78e0f1 100644 --- a/appstream-generator.spec +++ b/appstream-generator.spec @@ -1,19 +1,29 @@ %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.7.7 -Release: 3%{?dist} +Version: 0.8.1 +Release: 1%{?dist} Summary: Fast AppStream metadata generator -License: LGPLv3+ +License: LGPLv3+ 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) >= 0.12.2 +BuildRequires: pkgconfig(appstream) >= 0.12.10 BuildRequires: pkgconfig(lmdb) >= 0.9 BuildRequires: pkgconfig(libarchive) >= 3.2 BuildRequires: pkgconfig(cairo) >= 1.12 @@ -23,30 +33,35 @@ BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(fontconfig) -BuildRequires: pkgconfig(mustache-d) -BuildRequires: pkgconfig(dcontainers) >= 0.8.0 BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: gir-to-d >= 0.18.0 BuildRequires: ldc >= 1:1.1.0 BuildRequires: meson >= 0.46.0 -BuildRequires: npm(Flot) -BuildRequires: js-highlight -BuildRequires: js-jquery # 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 # These are the only architectures upstream supports currently... ExclusiveArch: x86_64 %{ix86} %{arm} -Requires: npm(Flot) -Requires: js-highlight -Requires: js-jquery Recommends: optipng %description @@ -58,8 +73,10 @@ such as software centers. It will also generate issue reports as JSON documents and HTML pages. %prep -%autosetup -p1 - +%setup -q +%if %{with vendored_js} +%setup -q -T -D -a 1 +%endif %build # Drop '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' as LDC doesn't support it @@ -73,16 +90,27 @@ export DFLAGS="%{_d_optflags}" %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 +# Cf. https://github.com/ximion/appstream-generator/issues/72 +(%meson_test) || : %files @@ -94,6 +122,10 @@ ln -srf %{buildroot}%{nodejs_sitelib}/flot/ %{buildroot}%{asgen_jsdir}/flot %{_datadir}/metainfo/org.freedesktop.appstream.generator.metainfo.xml %changelog +* 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 diff --git a/sources b/sources index edf6296..9d5cdb6 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (appstream-generator-0.7.7.tar.gz) = 0e0a4cb31148e11c5d001ee7377b0e7399d80fcfd576da2e460bf960d33ea6868daf035eeac963616a87ffcae520f3f98bc8732378bda8697502c914ed8e8bec +SHA512 (appstream-generator-0.8.1.tar.gz) = 92e7aa5c3b1ed80cf7c0777c7f569f9bffdf57fdfc71d86e3fbb5c71aecd30b8b03e87db6b34020ccc4578595d3124a3f6df0702b7a72c1e9e343531128186af +SHA512 (appstream-generator-nodemodules.tar.gz) = 723cc10816ca38b02c1ca8257b7d128772c049f2f39e2d0717aae4790f61e61696f585024de5be6cc7aa448e8f7db4e1d28ecc52d24995941d3d8bd5b1bf9eeb