Blame appstream-generator.spec

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