%define _unpackaged_files_terminate_build 1

%define as_plugin_version               5

%global _vpath_srcdir .
%global _vpath_builddir build
%global __global_cflags %{optflags}
%global __global_ldflags ""

Summary:	Library for AppStream metadata
Summary(ja):	AppStream メタデータ用ライブラリ
Name:		libappstream-glib
Version:	0.7.18
Release:	1%{?_dist_release}
Group:		admin-tools,system
Vendor:		Project Vine
Distribution:	Vine Linux

License:	LGPLv2+
URL:		https://people.freedesktop.org/~hughsient/appstream-glib/

Source:		https://people.freedesktop.org/~hughsient/appstream-glib/releases/appstream-glib-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildRequires:	libyaml-devel
BuildRequires:	gcab-devel

BuildRequires: glib2-devel
BuildRequires: docbook-utils
BuildRequires: gtk-doc
BuildRequires: gobject-introspection-devel
BuildRequires: gperf
BuildRequires: libarchive-devel
BuildRequires: libsoup-devel
BuildRequires: gdk-pixbuf2-devel
BuildRequires: gtk3-devel
BuildRequires: gettext
BuildRequires: libuuid-devel
BuildRequires: json-glib-devel
BuildRequires: meson

# for the builder component
BuildRequires: fontconfig-devel
BuildRequires: freetype-devel
BuildRequires: pango-devel
BuildRequires: rpm-devel
BuildRequires: sqlite3-devel

# for the manpages
BuildRequires: libxslt
BuildRequires: docbook-style-xsl

Requires:      gsettings-desktop-schemas

Obsoletes: appdata-tools < 0.1.9
Provides: appdata-tools

Obsoletes: libappstream-glib-builder-devel < 0.7.15

%description
This library provides GObjects and helper methods to make it easy
to read and write AppStream metadata. It also provides a simple DOM
implementation that makes it easy to edit nodes and convert to and
from the standardized XML representation. 

%package		devel
Summary:		Development tools for %{name}
Summary(ja):	%{name} の開発環境
Group:			programming
Requires:		%{name} = %{version}-%{release}
Requires:		pkgconfig

%description	devel
Header files and libraries for building a extension library for the %{name}.


%package		docs
Summary:		Documentation for %{name}
Summary(ja):	%{name} 用のドキュメント
Group:			documentation
Requires:		%{name} = %{version}-%{release}
BuildArch:		noarch

%description	docs
This package contains documentation for %{name}.


%package -n libappstream-builder
Summary:		Library and command line tools for building AppStream metadata
Summary(ja):	AppStream メタデータを生成するためのライブラリ及びコマンドラインツール
Group:			admin-tools,system
Requires:		%{name} = %{version}-%{release}

%description -n libappstream-builder
%{summary}


%debug_package


%prep
%autosetup -p1 -n appstream-glib-%{version}

%build
export LANG=ja_JP.UTF-8

%meson \
%ifarch x86_64
    -Dgtk-doc=true \
%endif
    -Dstemmer=false \
    -Ddep11=false
%meson_build

%install
rm -rf $RPM_BUILD_ROOT
export LANG=ja_JP.UTF-8

%meson_install

find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;

%find_lang appstream-glib

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files -f appstream-glib.lang
%defattr(-,root,root,-)
%license COPYING
%doc README.md AUTHORS NEWS
%{_libdir}/libappstream-glib.so.*
%{_libdir}/girepository-1.0/*.typelib
%{_bindir}/appstream-util
%{_bindir}/appstream-compose
%dir %{_datadir}/bash-completion/completions/
%{_datadir}/bash-completion/completions/appstream-util
%{_mandir}/man1/appstream-util.1.gz
%{_mandir}/man1/appstream-compose.1.gz

%files devel
%defattr(-,root,root,-)
%{_libdir}/libappstream-glib.so
%{_libdir}/pkgconfig/appstream-glib.pc
%dir %{_includedir}/libappstream-glib
%{_includedir}/libappstream-glib/*.h
%{_datadir}/gir-1.0/AppStreamGlib-1.0.gir
%{_datadir}/aclocal/*.m4
%{_datadir}/installed-tests/appstream-glib/*.test
%{_datadir}/gettext/its/appdata.its
%{_datadir}/gettext/its/appdata.loc

%ifarch x86_64
%files docs
%defattr(-,root,root,-)
%{_datadir}/gtk-doc/html/appstream-glib
%endif

%files -n libappstream-builder
%defattr(-,root,root,-)
%license COPYING
%{_bindir}/appstream-builder
%{_datadir}/bash-completion/completions/appstream-builder
%{_libdir}/asb-plugins-%{as_plugin_version}/libasb_plugin_appdata.so
%{_libdir}/asb-plugins-%{as_plugin_version}/libasb_plugin_desktop.so
%{_libdir}/asb-plugins-%{as_plugin_version}/libasb_plugin_font.so
%{_libdir}/asb-plugins-%{as_plugin_version}/libasb_plugin_gettext.so
%{_libdir}/asb-plugins-%{as_plugin_version}/libasb_plugin_hardcoded.so
%{_libdir}/asb-plugins-%{as_plugin_version}/libasb_plugin_icon.so
%{_libdir}/asb-plugins-%{as_plugin_version}/libasb_plugin_shell_extension.so
%{_mandir}/man1/appstream-builder.1.gz


%changelog
* Mon Feb 22 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.7.18-1
- new upstream release.

* Sun Aug 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.7.17-2
- added R:gsettins-desktop-schemas.

* Sat Aug 01 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.7.17-1
- new upstream release.

* Mon Sep 23 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.7.15-1
- new upstream release.
- dropped Patch0.
- drop a subpackage "libappstream-builder-devel": vanished in upstream.

* Tue Dec 11 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.7.14-1
- new upstream release.

* Thu Oct 29 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.5.2-1
- new upstream release
- add BuildRequires: gcab-devel

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.3.1-1
- initial build

